Skip to content

Instantly share code, notes, and snippets.

View hannestyden's full-sized avatar

Hannes Tydén hannestyden

  • Stockholm, Sweden
View GitHub Profile
@avdi
avdi / nullenum.rb
Created January 9, 2015 20:32
Behold, the null enumerator.
e = loop
e # => #<Enumerator: main:loop>
e.next # => nil
e.next # => nil
e.peek # => nil
e.size # => Infinity
e.rewind
e.next # => nil
@txus
txus / wtf.rb
Created October 31, 2014 10:56
Haskell-like function composition in Ruby - let the mad horses unleash
require 'blankslate'
class Proc
def self.comp(f, g)
lambda { |*args| f[g[*args]] }
end
def *(g)
Proc.comp(self, g)
end
anonymous
anonymous / grimkim-bandcamp-links.sh
Created February 21, 2013 17:46
@Grimkim's bandcamp links