Created
June 18, 2009 07:20
-
-
Save ecin/131766 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# Hi! Welcome to your new weight-loss program, tenplustwo. | |
# First thing's first. We need a way to communicate. | |
def shout( msg ); `growlnotify -s -m "#{msg}"`; end | |
# Put on your running shoes. | |
running = true | |
# Are you sure you know when enough is enough? | |
def stop | |
puts "All right, Joe. Good run. Come back for more!" | |
exit | |
end | |
# Now you do! Now where's my whistle... | |
trap "INT", "stop" | |
# Found it. Now remember, this program is called tenplustwo. | |
# That's a ten... | |
def ten | |
sleep 60*10 | |
shout "Ten minutes of work are up. Leisure time!" | |
def +( nxt ); end | |
end | |
# ... and a two. | |
def two | |
sleep 60*2 | |
shout "Break's over. Get busy! *whips*" | |
end | |
# You can also spell it as 10+2 if you're low on characters for a tweet. | |
# We're all set. Ready? Set. Run! | |
ten + two while running # Hope you brought a water bottle. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment