Wake up with a warm cup of Coffeescript. I am constantly amazed at how simple it is to write one-off scripts and small utilities with node.js & coffeescript.
I wanted an easy way to set reminders for myself throughout the day. For example, if I put the kettle on the stove, come back to my office and crank Gungor, I’m not going to hear the kettle whistling when the water is boiled. Instead, when I get back to my office I want to open a new tab in Terminal and type:
1
| |
Ideally, this will show me a Growl notification and play a sound to remind me to go check on the kettle.
Using node-growl, datejs and play.js the final script is as simple as this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
Now I can leverage the power of datejs on the console, which gives me a lot of flexibility when setting alarms. Again, I’m impressed at the number of quality libs available for node.js and the speed of which an idea can go from concept to working script.
I plan to package this script up as an npm module and make the source available on Github soon.