Skip to content

Instantly share code, notes, and snippets.

@paulanthonywilson
Created May 11, 2010 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save paulanthonywilson/397193 to your computer and use it in GitHub Desktop.
Save paulanthonywilson/397193 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# Raffle script. Uses Quicksilver (http://docs.blacktree.com/quicksilver/what_is_quicksilver) and Applescript
# CSV file of attendees was downloaded from EventWax (http://www.eventwax.com/). It needs 2 returns to continue the raffle
# - one to bring focus back to the terminal.
require 'rubygems'
require 'appscript'
require 'yaml'
require 'fastercsv'
module BigType
extend Appscript
def self.show(display_me)
app("Quicksilver").show_large_type(display_me)
end
end
names = []
excludes = ["Paul Wilson", "Graeme Mathieson", "Name", "Alan Francis"]
FasterCSV.foreach('conference.csv') do |row|
name = row[0]
names << name unless excludes.include?(name)
end
while (true) do
puts names.size
name = nil
1.upto(5 + rand(5)) do
puts "*"
name = names[rand(names.size)]
BigType.show name
end
BigType.show name
puts name
names.delete name
gets
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment