Skip to content

Instantly share code, notes, and snippets.

@asmuth
asmuth / gist:1285498
Created October 13, 2011 20:54
if you're happy and you know it (ruby --debug)
puts "if you're happy and you know it, NoMethodError"
(nil.fnord rescue nil)
@asmuth
asmuth / gist:1064005
Created July 4, 2011 22:10
json<->marshal loading in ruby1.8<->ruby1.9
require 'json'
MY_JSON_FILE = File.open('big_json.json').read
MY_MARSHAL_FILE = File.open('big_json.dat').read
class FileLoader
def load_via_json
JSON.parse(MY_JSON_FILE)
end