Skip to content

Instantly share code, notes, and snippets.

@levinalex
Created February 23, 2009 21:23
Show Gist options
  • Save levinalex/69184 to your computer and use it in GitHub Desktop.
Save levinalex/69184 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
#
# say a random word from the dictionary at least every ~n seconds
#
# uses "say" (comes with OSX) and growlnotify (comes with growl)
$f = File.open("/usr/share/dict/words")
$interval = ARGV[0].to_f || 0
$f.sort_by{rand}.each do |l|
word = l.strip
`growlnotify -a Dictionary -m #{word}`
`say #{word}`
sleep rand($interval)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment