Skip to content

Instantly share code, notes, and snippets.

@ldanz
ldanz / keybase.md
Created January 27, 2015 07:28
keybase.md

Keybase proof

I hereby claim:

  • I am ldanz on github.
  • I am lisadanz (https://keybase.io/lisadanz) on keybase.
  • I have a public key whose fingerprint is DCAD 6622 2201 C774 ED52 05E2 FB5B C6C6 668C 0DE8

To claim this, I am signing this object:

module FakeEnumerable
def map
res = []
each do |item|
res << yield(item)
end
res
end
def select
@ldanz
ldanz / unary_ampersand.rb
Created September 23, 2014 04:54
Unary ampersand demo
#!/usr/bin/env ruby
###### Symbol#to_proc
# Putting & in front of a symbol calls the symbol's to_proc method (Symbol#to_proc) and then converts the proc into a block.
#
# &:foomethod converts :foomethod into a block that takes the first yieldparam as the receiver and any later yieldparams as
# argumentds and calls :foomethod