Skip to content

Instantly share code, notes, and snippets.

@webmat
Last active December 29, 2015 23:39
Show Gist options
  • Select an option

  • Save webmat/7743980 to your computer and use it in GitHub Desktop.

Select an option

Save webmat/7743980 to your computer and use it in GitHub Desktop.
Pick a winner out of EventBrite attendees (in CSV format)
#!/usr/bin/env ruby
require 'csv'
attendees = CSV.read(ARGV.first, :headers => true) # load attendees
winner = attendees[ rand(attendees.size) ] # pick a winner
puts "Winner: #{winner['First Name']} #{winner['Last Name']} " +
"(Attendee # #{winner['Attendee #']})"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment