January 2008
33 posts
Jan 1st
December 2007
9 posts
Dec 28th
Ruby Gotcha: Array#uniq
I wanted to turn this: array_of_hashes = [{"a"=>"5", "b"=>"10", "c"=>"10"}, {"a"=>"5", "b"=>"10", "c"=>"10"}, {"a"=>"5", "b"=>"10", "c"=>"10"}] into: [{"a"=>"5", "b"=>"10", "c"=>"10"}] so I tried something like: array_of_hashes.uniq and it didn’t work so well. It seems that Array#uniq only works if the objects are truly the same, which is definitely a good...
Dec 28th
Dec 28th
Dec 28th
Patch for GChart API ruby lib →
Here’s a patch for John Barnette’s GChart API library which enforces the size limits and also implements all available encodings.
Dec 25th
WatchWatch
Awesome time-lapse video of one year in Bryant Park in Midtown, NYC.
Dec 18th
Being humbled
I always find out how much of a novice I really am when I see code like this:  class Reverser def reverse(list) (rec = lambda do |index, result| return result if index == -1 result rec[index - 1, result] end)[list.length-1, []] end end I would have stopped at the second step with the private accumulator. (via)
Dec 10th
Infographic-like opening credits of the Kingdom →
I haven’t seen the movie yet but the opening credits look awesome. (via)
Dec 10th