nodejs

Strava KML Generator

I’ve released a Google Earth KML file generator for Strava data. The application is written in javascript for nodejs and requires that you install nodejs on your local machine.

This is useful for visualizations as well as archiving your route information. Have a look at the README file on github for more information.

Read More

Express 3 Migration Issues

Today I migrated a web site from Express 2.5 to Express 3.0.0rc3. This is a non backward compatible version change. Express has a Migrating from 2.x to 3.x wiki page, but it doesn’t quite leave you prepared for the more time consuming incompatibilities that you’ll need to fix. I’ll enumerate some of these differences here. Note that some of these issues may be ironed out in later releases of Express.

Read More

curl, JSON and pretty print

Curl is a wonderful thing. The output can be a bit messy, however.

This python pipe pretty prints your otherwise messy JSON output.

1
$ curl -H 'Accept: application/json' http://localhost:3001/myserver/cmd | python -mjson.tool

Or, using Ruby, if necessary run

1
sudo gem install json

then pipe your output.

1
cat myfile.json | prettify_json.rb

An even nicer solution is this node script, written specifically to handle curl output. You’ll need to make sure you’ve installed Node.js before you can use it.