Skip to content

Instantly share code, notes, and snippets.

@afbroman
Created August 20, 2012 21:55
Show Gist options
  • Save afbroman/3408252 to your computer and use it in GitHub Desktop.
Save afbroman/3408252 to your computer and use it in GitHub Desktop.
Ruby: drop first three array elements and sort by two elements
genomes.drop(3).sort do |a, b|
comp = a[1].downcase <=> b[1].downcase
comp.zero? ? (a[2].downcase <=> b[2].downcase) : comp
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment