Jesse sent me an e-mail this morning. Check it out:
I had to get up at around 5:00 this morning due to car swapping logistics. I didn’t get to bed until after midnight last night, so needless to say, I’m tired as heck. Got to work at about 7:45, and the rest of my team doesn’t usually show up until around 9:00, so what was I to do? I decided to take a nap at my desk. I left my cell phone in the car, and I didn’t want to go get it just to be able to set an alarm, but I also didn’t want to be found passed out. So then what did I do?
I wrote this (even has a Snooze!):
Sub AlarmClock()
Dim hourOffset, minOffset, secOffset, snoozeTime As Integer
hourOffset = 0
minOffset = 45
secOffset = 0
snoozeTime = 5Do
newHour = Hour(Now()) + hourOffset
newMinute = Minute(Now()) + minOffset
newSecond = Second(Now()) + secOffset
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTimeFor i = 1 To 5
Beep
Application.Wait (Now + TimeValue(“0:00:02”))
Next isnoozeOn = MsgBox(“Snooze?”, 4)
If snoozeOn = 6 Then
hourOffset = 0
minOffset = snoozeTime
secOffset = 0
End If
Loop Until snoozeOn = 7End Sub
crontab -e 45 8 * * * afplay
~/Music/iTunes\ Music/B52s/Rock\ Lobster.mp3What’s this in? Looks like Basic, but god I hope you’re not so unlucky.
Note – you can get nice easy timer programs online, such as:
http://www.elegantpie.com/eggtimer.html
Just make sure your computer doesn’t go to sleep…
Hey, I was only firing on about 3 neurons, so I give myself credit. And yes, VB.