Skip to content

Instantly share code, notes, and snippets.

View kapetan's full-sized avatar

Mirza Kapetanovic kapetan

View GitHub Profile
@kapetan
kapetan / README.md
Last active August 16, 2017 12:31
Carysta Translations
@kapetan
kapetan / 1-pump.md
Last active August 29, 2015 14:14
Streams

Use pump instead of pipe.

a.pipe(b).pipe(c).on('error', callback);

Error not handled for stream a and b.

var pump = require('pump');
@kapetan
kapetan / npm-cache.sh
Created January 19, 2015 15:23
npm cache
function get_cache_dir() {
local cache_id=$(cat package.json | grep '"name"' | sed 's/"name"//; s/[^"]*"//; s/"[^"]*//')
if [ "$cache_id" == "" ]; then
cache_id=__misc__
fi
echo "/tmp/npm-cache/$cache_id"
}