Skip to content

Instantly share code, notes, and snippets.

View timsavery's full-sized avatar

Tim Savery timsavery

View GitHub Profile
#!/usr/bin/env node
/*
* This module can verify that packages installed during development are
* identical to those installed during deployment. The standard npm shrinkwrap
* only ensures that package versions are the same, but does not verify contents.
* This module checks the shasum of the package tarballs downloaded by npm during
* development and deployment to ensure they are the same.
*
* Usage:
@csanz
csanz / links.md
Created June 5, 2012 01:06
How to add links inside Geeklist as a gist
@domenic
domenic / portable-node.md
Created May 25, 2012 21:03
Tips for Writing Portable Node.js Code

Node.js core does its best to treat every platform equally. Even if most Node developers use OS X day to day, some use Windows, and most everyone deploys to Linux or Solaris. So it's important to keep your code portable between platforms, whether you're writing a library or an application.

Predictably, most cross-platform issues come from Windows. Things just work differently there! But if you're careful, and follow some simple best practices, your code can run just as well on Windows systems.

Paths and URLs

On Windows, paths are constructed with backslashes instead of forward slashes. So if you do your directory manipulation

@sinemetu1
sinemetu1 / mergeDeep.js
Created February 3, 2012 21:49
javaScript function that merges two JSON objects with the second object taking precedence in the event of a collision.
function mergeDeep (o1, o2) {
var tempNewObj = o1;
//if o1 is an object - {}
if (o1.length === undefined && typeof o1 !== "number") {
$.each(o2, function(key, value) {
if (o1[key] === undefined) {
tempNewObj[key] = value;
} else {
tempNewObj[key] = mergeDeep(o1[key], o2[key]);