Skip to content

Instantly share code, notes, and snippets.


Nate Murray jashmenn

View GitHub Profile
jashmenn / gist:6206
Created Aug 19, 2008
growl notify for irssi
View gist:6206
upgraded to a real git repository. Please see:
jashmenn / gist:6626
Created Aug 21, 2008
nate murray's .irbrc
View gist:6626
# Nate Murray's ~/.irbrc
# Can be found at:
# git clone git:// gist-6626
# Include colorization
require 'rubygems'
require 'wirble'
View gist:7109
# paste whatever is in the clipboard to gist using gisit from
# and MacClipboard code from
# this goes in your ~/.irbrc
# * todo, change code to update an existing gist
def gistit
require 'mechanize'
require 'gistit'
gist =
number = gist.paste( # => 12345
gist_url = Gistit::LOGIN_SUCCESS_URL + number.to_s
View gist:7162
ruby -e "require 'irb'; IRB.setup(__FILE__); gistit"
View gist:9998
# Function to check for a minimum rubygems version
# Can be found at:
def check_rubygems_version
min_version = '1.2.0'
local_version = %x[gem --version].chomp
unless local_version >= min_version
puts "You need to update the RubyGems utility to #{min_version} using the following"
puts ""
jashmenn / gist:13686
Created Sep 29, 2008
use inflectors from cli
View gist:13686
#!/usr/bin/env ruby
# Nate Murray 2008
require 'activesupport'
# Examples:
# * inflect camelize foo_bar
# * echo "foo_bar" | inflect camelize
unless method = ARGV[0]
puts "usage: #{$0} method string"
View gist:14584
# exponential random backoff ala ethernet
# Nate Murray, 2008
# inspired by code found in
class EthernetBackoff
class Error < StandardError
# Retries block with exponential random backoff ala ethernet The retry is
# based on the return value of &block. If the value evaluates to a boolean
# true then the value is returned. Otherwise it will sleep for the calculated
jashmenn / gist:16729
Created Oct 14, 2008
A tiny utility to generate graphviz dot files from objects that use pluginaweek's excellent state_machine library.
View gist:16729
#!/usr/bin/env ruby
require 'trollop'
require 'pp'
opts = Trollop::options do
version "#{$0} (c) 2008 Nate Murray"
banner <<-EOS
A tiny utility to generate graphviz dot files from objects that use pluginaweek's
jashmenn / gist:16738
Created Oct 14, 2008
View gist:16738
#!/usr/bin/env ruby
# from
require 'rubygems'
require 'activesupport'
class String
def self.random_pronounceable(syllables = 2)
alphabet = ('a'..'z').to_a
vowels = %w{ a e i o u }
jashmenn / remote.rb
Created Nov 6, 2008
sake task to create a new bare git repo on a foreign server
View remote.rb
# Nate Murray 2008
# based on ssh:install_public_key
namespace :git do
namespace :init do
namespace :bare do
desc "Init a new bare repository on a foreign server"
task :remote do