Skip to content

Instantly share code, notes, and snippets.

View jcf's full-sized avatar
❤️

James Conroy-Finn jcf

❤️
View GitHub Profile
Ruby Wins
by James CF
C#m G#m F#m A
Use a block to print your name,
Use equality to test the same,
Blocks and lambdas you can call,
Private methods, send from all.
@jcf
jcf / gist:156139
Created July 27, 2009 10:57 — forked from jamierumbelow/gist:154644
Just having some fun with a song about love and my Ruby
Ruby Wins
by James CF
C#m G#m F#m A
Use a block to print your name,
Use equality to test the same,
Blocks and lambdas you can call,
Private methods, send from all.
# exhibit a
{:conditions => case f.to_s
when 'active' then {:state => @@states[2]}
when 'disabled' then {:state => @@states[0..1]}
when 'all' then {}
else {:state => @@states[3]}
end}
# exhibit b
case f.to_s
#!/opt/local/bin/bash
# .git/hooks/commit-msg
exec < /dev/tty
commit_message=$1
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
branch=${ref#refs/heads/}
# Exit if commit message empty
@jcf
jcf / snippet.sh
Created December 10, 2008 00:23 — forked from anonymous/snippet.sh
Open important Rails directories with TextMate's mate link
function rmate {
if [[ $# -eq 1 ]]; then
mate "${1}/app" "${1}/config" "${1}/lib" "${1}/public" "${1}/spec" "${1}/stories"
else
mate "app" "config" "lib" "public" "spec" "stories"
fi
}