I have an array of hashes:
a=[{ \'foo\'=>0,\'bar\'=>1 }, { \'foo\'=>0,\'bar\'=>2 }, ... ]
I want to sort the array first
a.sort { |a, b| [a['foo'], a['bar']] <=> [b['foo'], b['bar']] }