Skip to content

Instantly share code, notes, and snippets.

@Freaky
Created March 8, 2020 20:40
Show Gist options
  • Save Freaky/36c36633c9a6c5fa32999e69fa9ed488 to your computer and use it in GitHub Desktop.
Save Freaky/36c36633c9a6c5fa32999e69fa9ed488 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
times = ARGF
.each_line
.map { |line| /^.*\+([0-9]{10})\.([0-9]{6})[0-9]* (.{1,77})/.match(line) }
.select(&:itself)
.map { |md| [Integer(md[1] + md[2]), md[3]] }
.each_cons(2)
.map { |a, b| [b[0] - a[0], a[1]]}
.sort_by(&:first)
puts times.map { |t| t.join(" ") }.reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment