Clone and build Node for analysis:
$ git clone https://github.com/joyent/node.git
$ cd node
$ export GYP_DEFINES="v8_enable_disassembler=1 v8_object_print=1"
$ ./configure
$ make -j4
// curl -k https://localhost:8000/ | |
var https = require('https'); | |
var fs = require('fs'); | |
var options = { | |
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'), | |
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem') | |
}; | |
https.createServer(options, function (req, res) { |
var httpProxy = require('http-proxy'); | |
// | |
// Addresses to use in the round robin proxy | |
// | |
var addresses = [ | |
{ | |
host: 'ws1.0.0.0', | |
port: 80 | |
}, |
#!/bin/sh | |
VERSION=0.8.6 | |
PLATFORM=darwin | |
ARCH=x64 | |
PREFIX="$HOME/node-v$VERSION-$PLATFORM-$ARCH" | |
mkdir -p "$PREFIX" && \ | |
curl http://nodejs.org/dist/v$VERSION/node-v$VERSION-$PLATFORM-$ARCH.tar.gz \ | |
| tar xzvf - --strip-components=1 -C "$PREFIX" |
#!/bin/sh | |
username=$1 | |
git remote -v | grep "$username" | |
if [ $? -ne 0 ]; then | |
project=`git ls-remote --get-url | sed 's/.*\/\([a-z]*\).git/\1/g'` | |
git remote add "$username" "https://github.com/$username/$project.git" | |
fi | |
git fetch "$username" |
// data comes from here http://stat-computing.org/dataexpo/2009/the-data.html | |
// download 1994.csv.bz2 and unpack by running: cat 1994.csv.bz2 | bzip2 -d > 1994.csv | |
// 1994.csv should be ~5.2 million lines and 500MB | |
// importing all rows into leveldb took ~50 seconds on my machine | |
// there are two main techniques at work here: | |
// 1: never create JS objects, leave the data as binary the entire time (binary-split does this) | |
// 2: group lines into 16 MB batches, to take advantage of leveldbs batch API (byte-stream does this) | |
var level = require('level') |
# description: | |
# implement npmjs registry failover in your shell | |
# | |
# setup: | |
# npm install -g npm-delegate | |
# | |
# usage: | |
# npms install through | |
# npms i through async | |
# |