Main Contents

New naming scheme for Rails Partials?

March 11, 2008

I personally dislike the current naming scheme of partials. Right now they follow the format of _somepartial.html.erb (Rails 2.*). I find it rather distracting and hard to find what I want when I am in a directory full of partial files following that naming format.
My suggestion is to use .perb for partials. [...]

Filed under: Everything | Comments (3)

Using multiple versions of rubygems

March 9, 2008

I was trying to figure out how to run a specific version of a gem, in this case, capistrano. I had capistrano 2.2.0 and 1.4.1 installed and I wanted to run the older version.
Trying to run /opt/local/lib/ruby/gems/1.8/gems/capistrano-1.4.1/bin/cap only gave me an error:
undefined method `execute!’ for Capistrano::CLI:Class (NoMethodError).
Turns out the trick is to use:
cap _1.4.1_ [...]

Filed under: Everything | Comments (1)

Reproduction in math?

March 9, 2008

28384376 * 1024 = 29065601024
The 1024 is repeated in the answer. I initially thought it was a bug in my program, but double-checked, and I thought it was pretty cool how the 1024 ends up at the end, with a buffer (the zero) between it and the rest of the number.
Perhaps alife could be [...]

Filed under: Everything | Comments (0)

Bash script to remove deleted files from git

March 7, 2008

for i in ` git st | grep deleted | awk ‘{print $3}’ ` ; do git rm $i; done

Filed under: Everything | Comments (1)

How to tie your shoelaces really fast

March 6, 2008

I just figured this out from YouTube and made my very first video by using my macbook’s built-in webcam and the iMovie HD software that comes with Mac OS X. No worries, I’m not a Mac fanboy, that’s just what I happen to have.
Fast Version:

Slow Version:

Download (right click with mouse & choose ’save as’): [...]

Filed under: Everything | Comments (0)