View bridge-client.js
var socket = io.connect(server),
reSock = /^sock\:.*$/i;
socket.on('connect', function() {
eve.on('*', function() {
// get the last argument
var lastArg = arguments.length ? arguments[arguments.length - 1] : null;
// if the last arg is a socket connection, then don't send it to the serve
// because we got it from the server...

This is a simple shell script that is designed to provision both nginx and node on your machine. I primarily wrote it for use with Vagrant and an example Vagrantfile is included in the Gist as well.


The following is an "oh noes, where's my Internet" guide to surviving as a coder with no or limited Internet. Primarily the guide is focused on those who will be doing JS development (and using npm as a package manager) but some of the advice is useful for other environments also.

Step 1. Clone all things

Tooling in this steps require that you have git installed, and use github for your repositories.

One thing I really like to do when I get a bit of time offline, is clean up an old repository that I once thought was useful. I rarely know about what project this might be in advance. As a result, I like to clone all the things from my personal github account.

To do this I recommend using multirepo, which is best installed (at the moment) like so:


NOTE: This guide is currently incomplete.

Install general dependencies:

sudo apt-get install git build-essential cmake pkg-config libboost-dev libboost-test-dev \
     libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config \
     libssl-dev libsoup2.4-dev libboost-system-dev libboost-filesystem-dev \
     libogg-dev libtheora-dev libasound2-dev libvorbis-dev libpango1.0-dev \
     libvisual-0.4-dev libffi-dev libgmp-dev

one liners

Getting a list of commits (in a relatively useful short form) since a branch diverged from master:

git log --format="%h %an: %s" $(git merge-base release-name master)..

All the modified files on the current branch since forking from master.


Convert a series of images into an MPEG file:

$ MAGICK_THREAD_LIMIT=2 MAGICK_MEMORY_LIMIT=2G convert -delay 5 -quality 100 *.JPG out.mpeg

I'm sure there's probably a more efficient way to do this, but before CampJS I'm pretty keen to bring down all the elm packages that are available from the elm package repository.

This seems to do the trick :)

curl -s \
  | jq -r ".[].name" \
  | xargs -L 1 -I{} bash -c "[[ ! -d {} ]] && git clone 'git://{}.git' '{}' || true"