Skip to content

Instantly share code, notes, and snippets.

View robbyrussell's full-sized avatar
:bowtie:
Focusing on @planetargon at the moment

Robby Russell robbyrussell

:bowtie:
Focusing on @planetargon at the moment
View GitHub Profile
I use Cucumber 0.3.97. Your mileage may vary with older versions.
# install rspactor
sudo gem install guillaumegentil-rspactor
# Change your database.yml to include the following
test: &TEST
database: your_database_name_here
<<: *login
# notify me by echo, text-to-speech, AND growl.
function shout {
echo $1 && say $1 && growlnotify -m $1;
}
# usage
shout "I'm using this in my bash scripts so that my scripts talk to me and get my attention."
!.*/(\.[^/]*|vendor/rails|coverage|sphinx|script|tmp|data|log|doc|CVS|_darcs|_MTN|\{arch\}|blib|.*~\.nib|.*\.(framework|app|pbproj|pbxproj|xcode(proj)?|bundle))$
@robbyrussell
robbyrussell / remove old LH branches
Created May 8, 2009 23:55
remove old LH branches
➜ ~projectname git:(master) git br -l|grep '^ LH'|awk '{print $1}'
LH_1429
LH_1631
LH_1646
LH_1660
LH_1667
LH_1669
LH_1712
LH_1721
LH_1737
# the lack of indenting came directly from the app i am reviewing code for
m=[[1,1,1,1,1]]
i=j=0
while i < 30 do
m[i]=[i,i,i,i,i]
i+=1
end
<input type="hidden" id="x_something" value="1" />
<%= periodically_call_remote :update => 'some shit',
:url => {:action => :action_name},
:condition => "$('x_something') == '1'",
:frequency => 2.0 %>
# then...
# aiming to have something like:
# link_to(article.title, article_path(article))
# and build out /articles/2009/03/10/foo-bar-baz
#
map.article 'articles/:year/:month/:day/:permalink', :controller => 'articles', :action => 'show',
:year => /\d{4}/, :day => /\d{1,2}/, :month => /\d{1,2}/
@robbyrussell
robbyrussell / move-to-front-of-line.rb
Created February 27, 2009 00:21
moving an item in an Array to the front while preserving original order for rest of Array
class Array
def move_to_front_of_line(x)
return [ self[x] ] | self
end
end
@robbyrussell
robbyrussell / commit-msg.sh
Created February 16, 2009 19:55
lighthouse ticket status updating via git commit hooks
#!/bin/sh
#
# Will append the current Lighthouse ticket number to the commit message automatically
# when you use the LH_* branch naming convention.
#
# Drop into .git/hooks/commit-msg
# chmod +x .git/hooks/commit-msg
exec < /dev/tty
@robbyrussell
robbyrussell / commit-msg.sh
Created February 16, 2009 19:41
automatically add LH # to your git commit messages when you use LH_* naming conventions
#!/bin/sh
#
# Will append the current Lighthouse ticket number to the commit message automatically
# when you use the LH_* branch naming convention.
#
# Drop into .git/hooks/commit-msg
# chmod +x .git/hooks/commit-msg
commit_message=$1