This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e = Event.new | |
=> #<Event _id: 4d545395223e17aeca000004> | |
"ZOMG!!!" if e.creator | |
=> nil | |
e.creator.object_id | |
=> 4 | |
e.creator = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
OlderNewer