Skip to content

Instantly share code, notes, and snippets.

@marekjelen
Created August 24, 2012 10:17
Show Gist options
  • Save marekjelen/3448810 to your computer and use it in GitHub Desktop.
Save marekjelen/3448810 to your computer and use it in GitHub Desktop.
#!/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