Skip to content

Instantly share code, notes, and snippets.

@rolandoam
Created May 27, 2010 13:27
Show Gist options
  • Save rolandoam/415792 to your computer and use it in GitHub Desktop.
Save rolandoam/415792 to your computer and use it in GitHub Desktop.
timer
#!/usr/bin/ruby
GROWLNOTIFY = "/Users/rolando/Applications/growlnotify"
ALERT_SOUND = "/Users/rolando/Documents/GFF/SFX/alert_35.wav"
class Fixnum
def minutes
self * 60
end
end
ok_to_go = true
Signal.trap("INT") do
puts "terminating..."
exit(0)
end
5.times do
system "/usr/bin/afplay '#{ALERT_SOUND}'"
system "'#{GROWLNOTIFY}' -m 'start working, biatch!' 2> /dev/null"
sleep 12.minutes
system "/usr/bin/afplay '#{ALERT_SOUND}'"
system "'#{GROWLNOTIFY}' -m 'ok, now some rest' 2> /dev/null"
sleep 3.minutes
end
system "/usr/bin/afplay '#{ALERT_SOUND}'"
system "'#{GROWLNOTIFY}' -m 'good job!' 2> /dev/null"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment