According to Cordell

Rails app start guide

Set up a rails app with heroku, zerigo DNS, and bitbucket in one pomodoro: rails new {app_name} --skip-test-unit cd {app_name} git init git add . git commit -m "generated skeleton" vim Gemfile Gemfile changes < gem 'sqlite3' --- > group :development do 9a10,11 > gem 'sqlite3' > end …

Large HTML tables with fixed first column and header

Recently I wanted to create a large text heavy table (cells had large blocks of text in them) in HTML. Furthermore, I wanted an Excel-like “split” on the first column and row. I realized that this could probably not be solved in pure CSS and would likely require a Javascript solution. After much hunting I …

Branch & Bound problem in Ruby

Problem definition I want to find the set of widgets out of a list of widgets, that best fits a set of requirements. This is a problem of my own design that model’s a larger problem I am having for a project. Specifics: Widget has numeric qualities that correspond to the requirement categories There is a single …

Notes on creating a new ruby project

Quickest way to set up a new project. Use snake_case on project name. bundle gem my_gem_name cd ./my_gem_name/ git commit -m "empty project" rspec --init

Microsoft Access Database to SQL file

I had an existing Microsoft Access database that was quite large that I needed to migrate to a more manageable MySQL database. I wanted to export the database to a .sql file for portability sake. Strangely, this feature is absent from Access the program. Here is the easiest solution. Download the program DBWScript. It …

Setting up Jekyl in a sub directory

Jekyll is a blog-aware static site generator. The operative words in that sentence being static site, there is no php, no database, running on this blog. There are few advantages to this setup over the traditional alternatives such as wordpress: Speed of service: no code execution means the limiting factor is how fast …

Technical tips for running a neuroscience (fMRI GLM) experiment

Having worked on a neuroscience experiment for the last 1.5 years I have learned a great deal along the way. I offer this post as what I would do if I were starting from scratch. I’m focused on the technical details rather than neuroscience aspects of experiment design. This focuses on a basic GLM with fMRI data, so …

Useful Rail Gems

Below are a list of Gems have found to be useful as I was learning rails: Testing gem 'factory_girl_rails' FactoryGirl automates the process of model creation for the purpose of testing. gem 'launchy' Launch allows you to open a webpage in testing, good for debugging tests gem 'annotate' …

Installing Rails

Ruby rails install sudo apt-get install ruby rubygems Install rails: gem install rails Long wait and then this result: Fetching: i18n-0.6.1.gem (100%) ERROR: While executing gem ... (Errno::EACCES) Permission denied - /var/lib/gems Installing RVM per Stackoverflow answer .: curl -L https://get.rvm.io | bash -s stable …

Compiling Git on a Shared Host without administrator rights (sudo)

This is guide focuses on how to get git working on a server where you do not have administrative rights (e.g. a webhost). You must have ssh (shell) access and gcc must be working. On my server I lacked expat.h library. Rather than try to install this library, I merely compiled git without it. I have not noticed a usage …

Pages