Skip to content

Instantly share code, notes, and snippets.

@dcluna
dcluna / raskell.rb
Created August 21, 2012 18:16 — forked from andkerosine/raskell.rb
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@dcluna
dcluna / Gemfile
Created June 19, 2012 20:01 — forked from BrianTheCoder/Gemfile
an example of full text search in postgres using datamapper
source "http://gems.github.com"
source "http://gemcutter.org"
bundle_path "gems"
gem "dm-core"
gem "dm-migrations"
gem "dm-sweatshop"
gem "data_objects"
gem "do_postgres"
@dcluna
dcluna / gist:2147164
Created March 21, 2012 14:10 — forked from fogus/gist:2124742
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#