Fast Development with Node.js
The following are some quick notes on my dev setup for node.js development, although this should be portable to any environment provided the tests run quickly. I'm using vim for editing and mocha for testing. Since mocha runs all tests async, they run very very fast.
The idea behind this is to keep running tests and launching the application in a loop. We'll use inotifywait to watch for changes to the source, and kill the app, resetting the loop. We'll do the entire thing in bash.
The first step is the loop. I use the illustrious npm for everything node, which makes things simple. Usually npm will launch the app too, but in this case it's a library and the app is just an example program. We'll throw a sleep in there so it's easy to kill.
Next, we'll create a watch loop that waits for a file to change, then kills the test app.
The careful reader will not that we've written the PID of the watcher to a file. This is because we want one simple command to run both scripts. Without further ado:
The master is a little tricky. To actually stop everything, we need to CTRL-C twice. The first CTRL-C stops the test.js app and the second kills the loop, causing the master process to exit. We don't want the watcher to continue to run, so we trap the SIG and kill watch and it's PID file on exit.
The project I'm working on is https://github.com/dokipen/express-endpoint/. The code is in the middleware branch, which is what I'm currently working on. It should make it to master soon.
An updated and cleaner version, in one file.
Creating a Google Plus App for Chrome Apps
It's nice having frequently used apps in the Apps section of the Chrome home page. Unfortunately, there is no Google Plus app as of yet. That's already, it's pretty simple to create one. This trick can be used for any site.
First create a folder for your app containing a manifest.json file for your app.
Next find a 128x128 png file on the internet to use as your logo.
Put the image in your app folder with the name 128.png.
Now load the extension by clicking Tools > Extensions in the Chrome menu, then clicking "Load unpacked extension...". Navigate to your app directory and load it. Now you should have a nice Google Plus logo under apps.









