Skip to content

Instantly share code, notes, and snippets.

LotteryTicket =
get_picks: -> @picks
set_picks: (@picks) ->
get_purchased: -> @purchase
set_purchased: (@purchased) ->
@manveru
manveru / sc.rb
Created June 24, 2010 17:04 — forked from rklemme/sc.rb
iota % rvm ruby sc.rb
info: jruby-1.5.1: jruby 1.5.1 (ruby 1.9.2dev trunk 24787) (2010-06-06 f3a3480) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [amd64-java]
Rehearsal ----------------------------------------------
scan 5.973000 0.000000 5.973000 ( 5.928000)
scan ++ 10.103000 0.000000 10.103000 ( 10.104000)
scan re 5.443000 0.000000 5.443000 ( 5.443000)
scan re ++ 10.329000 0.000000 10.329000 ( 10.329000)
while 8.482000 0.000000 8.482000 ( 8.482000)
layout do |path, wish|
if path !~ /feed|show/
mobile_rendering? ? :mobile : :main
end
end
def self.mobile_rendering?
(request.host =~ /m\.learnivore/) ? true : false
end
@manveru
manveru / README
Created February 12, 2009 12:44 — forked from Pistos/README
With this code, CPU usage shoots to 100% when serving the index page.
% gem19 list -l
*** LOCAL GEMS ***
daemons (1.0.10)
diakonos (0.8.7)
def by_loop
loop do
break if yield
end
end
def by_while
while true
break if yield
end
@manveru
manveru / gist:54476
Created January 29, 2009 09:10 — forked from Syd/gist:53721
@manveru
manveru / twicl
Created November 10, 2008 02:52 — forked from leahneukirchen/twicl
#!/usr/bin/env ruby
# -*- ruby -*-
# twitter command line client
# That's What I Call Lame
# 09nov2008 +chris+
require 'json'
require 'open-uri'