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
@robbyrussell
robbyrussell / we-love-github.txt
Created June 22, 2011 21:55
Oh My Zsh loves github
When I released Oh My Zsh to share with coworkers, I decided to toss it on Github instead of sending them a tarball. If you had told me that less than two years later, we'd be approaching 900 forks and I'd have accepted patches from 150 different people... I'd have rolled my eyes and laughed.
Yet, I find myself leading such a project, which now receives more pull-requests submissions than I can keep up with. Github has provided tools that enabled me to distribute some management of the project with other people, which means that I don't have to be a huge bottle neck in the process. Even if I don't keep up (ie., take a vacation), people can easily fork, make their tweaks, and share their patches with the rest of the community. This allows me to get engaged with the community when it's convenient for me.
Outside of that, the people who use Oh My Zsh appear to be huge fans of the project. It seems to make a positive difference in how people feel about working with their terminal environment. Being able to re
@robbyrussell
robbyrussell / post-checkout
Created May 10, 2011 16:57
post-checkout hook to reload bundler and restart passenger
#!/bin/sh
#
# Just save this as .git/hooks/post-checkout in your Rails application
#
env ARCHFLAGS="-arch x86_64" bundle install
touch tmp/restart.txt
@robbyrussell
robbyrussell / my.zshrc
Created April 26, 2011 17:01
oh-my-zsh v0.0.1
# my ~/.zshrc BEFORE oh-my-zsh
# Input stuff.
bindkey -e
# History stuff.
setopt HIST_VERIFY
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY
@robbyrussell
robbyrussell / B testing with GWO
Created January 5, 2011 21:18
open question...
I'm hoping to run an A/B test on a product preview page, which has URLs like so:
* http://domain.com/products/14/preview
* http://domain.com/products/104/preview
* http://domain.com/products/135/preview
* http://domain.com/products/2045/preview
* http://domain.com/products/2045/preview
We have a variation of the 'preview' view that we want to compare... across all our products.
# just showing one of our designers how to tighten up some conditionals..
if @foo == "bar" || @foo == "baz" || @foo == "meep"
# do something
end
# can also be written like so...
if ["bar", "baz", "meep"].include?(@foo)
# do something
end

This is my script for handling unsolicited sales calls. I can tell by the caller id as they usually come in on our second (unpublished) phone number.

Tips

  • _for best effect… leave off ‘Thank’ to make it sound like the tape already started…

The Script

Thank you for calling Planet Argon. If you know your party’s extension, please say or enter it followed by the pound key.

...so we're working on an existing project and we come across comments like this..
def to_param
# Let's use the invoice_no so nobody gets any bright ideas.
self.invoice_no
end
# This class represents the user's shopping cart. Vrrm vrrm!
# add this to your .oh-my-zsh config for fun in the sun
function chirp() {
growlnotify -t "Chirp Chirp" -m $1;
say -v "Bells" "chirp. chirp. ${1}";
}
# then when you are running a big task and want to be reminded when it finishes (so you don't have to keep checking on it...)
rake your-rake-command && chirp "finished running the command that you were waiting on"
# found in a controller...
@lead.update_attribute(:type, 'Customer')
@customer = Customer.find(@lead.id)
>> x
=> []
>> x.slice!(10..-1)
=> nil
>> x
=> [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]