Skip to content

Instantly share code, notes, and snippets.

View frerich's full-sized avatar
💭
I may be slow to respond.

Frerich Raabe frerich

💭
I may be slow to respond.
View GitHub Profile
IO.stream(:line)
|> Stream.map(&String.trim_trailing/1)
|> Enum.reduce(%{}, fn
"list", todo -> IO.inspect(todo)
"add " <> item, todo -> Map.put(todo, item, false)
"complete " <> item, todo -> Map.put(todo, item, true)
"delete " <> item, todo -> Map.delete(todo, item)
end)
@frerich
frerich / Output.txt
Created November 16, 2012 16:21 — forked from mperham/Output.txt
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.6.0]
~> ruby foo.rb
hello!
~> rvm use jruby
Using /Users/mperham/.rvm/gems/jruby-1.6.0
~> jruby -v
jruby 1.6.0 (ruby 1.8.7 patchlevel 330) (2011-03-15 f3b6154) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_24) [darwin-x86_64-java]
~> jruby foo.rb
NoMethodError: undefined method `synchronize' for nil:NilClass
timed_pop at foo.rb:5