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
| # description: | |
| # implement npmjs registry failover in your shell | |
| # | |
| # setup: | |
| # npm install -g npm-delegate | |
| # | |
| # usage: | |
| # npms install through | |
| # npms i through async | |
| # |
| // 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') |
| #!/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" |
| #!/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" |
| var httpProxy = require('http-proxy'); | |
| // | |
| // Addresses to use in the round robin proxy | |
| // | |
| var addresses = [ | |
| { | |
| host: 'ws1.0.0.0', | |
| port: 80 | |
| }, |
| // 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) { |