Skip to content

Instantly share code, notes, and snippets.

@solson
Created September 26, 2016 08:24
Show Gist options
  • Save solson/5f6872e8e9b6315d76fe85c68b210894 to your computer and use it in GitHub Desktop.
Save solson/5f6872e8e9b6315d76fe85c68b210894 to your computer and use it in GitHub Desktop.
> my @sample = [{:directors($["Andrew Stanton", "Angus MacLane"])}, {:directors($["Greg Tiernan", "Conrad Vernon"])}, {:directors($["Byron Howard", "Rich Moore", "Jared Bush"])}]
[{directors => [Andrew Stanton Angus MacLane]} {directors => [Greg Tiernan Conrad Vernon]} {directors => [Byron Howard Rich Moore Jared Bush]}]
> printf "%-20s %s\n", .key, .value for Bag.new(@sample.map(|*<directors>)).sort({ -.value, .key })
Andrew Stanton 1
Angus MacLane 1
Byron Howard 1
Conrad Vernon 1
Greg Tiernan 1
Jared Bush 1
Rich Moore 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment