Skip to content

Instantly share code, notes, and snippets.

# Also see: http://timeless.judofyr.net/tailin-ruby
# Requires Ruby 1.9:
fib = lambda do |i, n = 1, result = 0|
if i == -1
result
else
i, n, result = i - 1, n + result, n
redo
@phorsfall
phorsfall / gist:821394
Created February 10, 2011 21:36
Hmmph, Mongoid
e = Event.new
=> #<Event _id: 4d545395223e17aeca000004>
"ZOMG!!!" if e.creator
=> nil
e.creator.object_id
=> 4
e.creator = nil
require 'drb'
# ruby-serial was crashing Shoes so run serial code in another process using DRb to
# communicate the state of the controller.
pid = Process.fork { exec('ruby', 'controller.rb') }
Shoes.app :width => 938, :height => 768, :resizable => false do
# Start the DRb client.
DRb.start_service