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.

Revisions

  1. webmat revised this gist Dec 2, 2013. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Attendees-Example.csv
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    "Attendee #","Date","Last Name","First Name","Email","QTY","Ticket Type","Date Attending","Order #","Order Type","Total Paid (USD)","Fees Paid (USD)","Eventbrite Fees (USD)","CC Processing (USD)","Attendee Status","Home Address 1","Home Address 2","Home City","Home State/Province","Home Postcode","Home Country"
    "277877635","21 Oct 2013","Martin","Mathieu","webmat@gmail.com","1","DevOps Enthusiast (80)","4 Nov 2013","218440551","Free Order","0.00","0.00","0.0","0.00","Attending","","","","","",""
  2. webmat created this gist Dec 2, 2013.
    9 changes: 9 additions & 0 deletions eb_winner
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    #!/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 #']})"