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
Missing these required gems:
feedtools = 0.2.29
You're running:
ruby 1.8.6.114 at /opt/local/bin/ruby
rubygems 1.3.1 at /Users/robbyrussell/.gem/ruby/1.8, /opt/local/lib/ruby/gems/1.8
Run `rake gems:install` to install the missing gems.
git:(master):
git:(master): gem list|grep feed
map.resources :containers do |container|
container.resources :widgets
end
# gives us...
# /containers/:container_id
# /containers/:container_id/widgets/
# /containers/:container_id/widgets/:id
# but what i really want is...
@robbyrussell
robbyrussell / container_of_widgets.html
Created January 29, 2009 06:02
basic carousel-like class using Prototype
<div id="x_container">
<a id="x_back_button"><img src="/images/left-arrow.png" /></a>
<a id="x_forward_button"><img src="/images/right-arrow.png" /></a>
<div class="x_widget">
<p>content...1</p>
</div>
<div class="x_widget" style="display:none;">
<p>content...2</p>
# get the name of the branch we are on
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
branch=${ref#refs/heads/}
if [[ -d .git ]]; then
CURRENT_BRANCH="%{$fg[red]%}git:(%{$fg[green]${branch}$(parse_git_dirty)%{$fg[red])"
else
CURRENT_BRANCH=''
fi
@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
@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
# 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}/
<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...
# 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
@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