Created
August 24, 2012 10:17
-
-
Save marekjelen/3448810 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'sequel' | |
DB = Sequel.sqlite('signups.db') | |
signups = [] | |
DB[:signups].all.each do |signup| | |
if ['rubyslava', '@rubyslava', ' rubyslava'].include?(signup[:code].downcase) | |
signups << signup[:email] | |
end | |
end | |
winner = nil | |
Random.rand(10000).times do | |
winner = signups.sample | |
end | |
puts winner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment