Successfully reported this slideshow.

Building an alarm clock with node.js

10

Share

Loading in …3
×
1 of 47
1 of 47

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Related Audiobooks

Free with a 14 day trial from Scribd

See all

Building an alarm clock with node.js

  1. 1. Building an alarm clock with node.js or Hacking vs. Engineering Felix Geisendörfer 29.09.2011 (v1) Donnerstag, 29. September 2011
  2. 2. Text Welcome to the Siesta right-after-lunch Session! Donnerstag, 29. September 2011
  3. 3. Building an alarm clock with node.js or Hacking vs. Engineering Felix Geisendörfer 29.09.2011 (v1) Donnerstag, 29. September 2011
  4. 4. @felixge Twitter / GitHub / IRC Donnerstag, 29. September 2011
  5. 5. My Problem • Getting up early in the morning • That means before 12:00 (noon) Donnerstag, 29. September 2011
  6. 6. This talk • How I solved this problem • Hacking vs. Engineering the solution Donnerstag, 29. September 2011
  7. 7. Patient History • 23 years • Working from home • Can work any hours Donnerstag, 29. September 2011
  8. 8. So why get up early? • To get more stuff done ... Donnerstag, 29. September 2011
  9. 9. Previous attempts Donnerstag, 29. September 2011
  10. 10. Text Behavioral Conditioning Donnerstag, 29. September 2011
  11. 11. Text Flying alarm clock Donnerstag, 29. September 2011
  12. 12. Text Circadian rhythm app (Sleep Cycle) Donnerstag, 29. September 2011
  13. 13. Text Many alarms Donnerstag, 29. September 2011
  14. 14. Nothing was working Donnerstag, 29. September 2011
  15. 15. Text Donnerstag, 29. September 2011
  16. 16. Donnerstag, 29. September 2011
  17. 17. Donnerstag, 29. September 2011
  18. 18. Donnerstag, 29. September 2011
  19. 19. Donnerstag, 29. September 2011
  20. 20. VLC Donnerstag, 29. September 2011
  21. 21. pmset Donnerstag, 29. September 2011
  22. 22. The Script https://gist.github.com/1a40a207cf6132f77efa Donnerstag, 29. September 2011
  23. 23. sudo ./alarm.js 7 30 Donnerstag, 29. September 2011
  24. 24. Donnerstag, 29. September 2011
  25. 25. Result • Reliably waking up at any time • Get to choose different music every night Donnerstag, 29. September 2011
  26. 26. Hacking vs. Engineering Donnerstag, 29. September 2011
  27. 27. (Software) Engineering “Rigorous application of science” Donnerstag, 29. September 2011
  28. 28. Hacking “Playful cleverness” Donnerstag, 29. September 2011
  29. 29. Hacking vs. Engineering this project Donnerstag, 29. September 2011
  30. 30. Tests? Engineering: Yes Hacking: Maybe Donnerstag, 29. September 2011
  31. 31. Airtunes? Engineering: Implement protocol Hacking: Piggyback on iTunes or VLC Donnerstag, 29. September 2011
  32. 32. Code var file = '/my/music/file.mp3'; var vlcPath = '/Applications/VLC.app/Contents/MacOS/VLC'; var vlc = spawn(vlcPath, [ '-R', '--sout=#transcode {acodec = alac channels = 2, samplerate = 44100}: raop{host=10.0.1.13,volume=255}', file ]); vlc.stdout.setEncoding('utf8'); vlc.stderr.setEncoding('utf8'); vlc.stdout.on('data', process.stdout.write); vlc.stderr.on('data', process.stderr.write); vlc.on('exit', function(code, signal) { console.log('vlc exit: %i %s', code, signal); }); Donnerstag, 29. September 2011
  33. 33. Wakeup from Sleep? Engineering: pmset schedule wakeorpoweron <datetime> Hacking: pmset schedule wakeorpoweron MTWRFSU <time> Donnerstag, 29. September 2011
  34. 34. Code var powerCmd = sprintf( 'pmset repeat wakeorpoweron MTWRFSU %02d:%02d:00', powerHour, powerMinute ); exec(powerCmd, function(err) { if (err) throw err; process.setuid('felix'); }); Donnerstag, 29. September 2011
  35. 35. Turn off speakers? Engineering: Install speakers in unreachable place. Hacking: ? Donnerstag, 29. September 2011
  36. 36. Text Duct Tape Donnerstag, 29. September 2011
  37. 37. Duct Tape of Concurrent I/O Donnerstag, 29. September 2011
  38. 38. Engineering Solution for Concurrency Donnerstag, 29. September 2011
  39. 39. Why am I talking about this? Donnerstag, 29. September 2011
  40. 40. JS has a very hacker-driven culture Donnerstag, 29. September 2011
  41. 41. Text Duct tape of the web Donnerstag, 29. September 2011
  42. 42. Text Duct tape of the DOM Donnerstag, 29. September 2011
  43. 43. • Hacking is lots of fun, go do it! • Hacking can be a good solution! • But be aware that many problems call for an engineering approach. Donnerstag, 29. September 2011
  44. 44. Where we need more engineering: • Libraries • Domain logic • Performance Donnerstag, 29. September 2011
  45. 45. TL;DL • Hack when in doubt • Engineer when clear Donnerstag, 29. September 2011
  46. 46. Hacking Engineering Donnerstag, 29. September 2011
  47. 47. Questions? @felixge Donnerstag, 29. September 2011

×