Skip to content

Instantly share code, notes, and snippets.


Jack Danger JackDanger

View GitHub Profile
View 1.9.3-p545-railsexpress.diff
diff --git a/.gitignore b/.gitignore
index 57557c9..7955376 100644
--- a/.gitignore
+++ b/.gitignore
@@ -129,3 +129,4 @@
# /win32/
diff --git a/array.c b/array.c
View t.rb
class C
attr_accessor :b
def foo
b ? : raise(
alias gob foo
View google-says.rb
# Saves an MP3 of the phrase using Google's text-to-voice.
# From the command line:
# $ ruby google-say.rb Hello World
# Or you can just require it and call Google.say(phrase)
require 'open-uri'
View urlmonitor.rb
#!/usr/bin/env ruby
# urlmonitor - print out the URLs requested system wide on the main network interface
# Accept a network interface name as an optional argument
iface = ARGV.first
# No interface specified? Try to guess which one is king..
unless iface
`ifconfig -l`.split.each do |iface|
next if iface =~ /^lo/
View shoulda.rb
module Shoulda
module Macros
def should_change(expression, options = {})
by, from, to = get_options!([options], :by, :from, :to)
stmt = "change #{expression.inspect}"
stmt << " from #{from.inspect}" if from
stmt << " to #{to.inspect}" if to
stmt << " by #{by.inspect}" if by
expression_eval = lambda { eval(expression) }
View seattlerb_stats.rb
require 'rubygems'
require 'yaml'
require 'set'
'aaron patterson',
'alex vollmer',
'andy smith',
'damon danieli',
'dave myron',