Skip to content

Instantly share code, notes, and snippets.

View cbrumelle's full-sized avatar

Colin Brumelle cbrumelle

View GitHub Profile
require 'irb/completion'
ARGV.concat [ "--readline",
"--prompt-mode",
"simple" ]
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history"
# load wirble
# Currently in Rails 2 and 3...
# https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/action_dispatch/http/headers.rb
#
# headers = ActionDispatch::Http::Headers.new
# headers['HTTP_FOO_BAR'] = 'a1b2c3'
# puts headers['foo-bar'] #=> 'a1b2c3'
# puts headers.has_key? 'foo-bar' #=> false
# puts headers.has_key? 'HTTP_FOO_BAR' #=> true
#
# I found this pseudo hash syntax, where the array [] lookup returned a value,
"This actually did happen to a real person, and the real person is me. I had gone to catch a train, This was April 1976, in Cambridge, U.K.
I was about twenty minutes early.
I'd got the time of the train wrong. I suppose it is at least equally possible,"
he added after a moment's reflection,
"that British Rail had got the time of the train wrong. Hadn't occurred to me before."
"Get on with it." Fenchurch laughed.
"So I bought a newspaper, to do the crossword, and went to the buffet to get a cup of coffee."
"You do the crossword?"
"Yes."
"Which one?"