Skip to content

Instantly share code, notes, and snippets.

View isaacs's full-sized avatar
🔮
only way out is through

isaacs isaacs

🔮
only way out is through
View GitHub Profile
@isaacs
isaacs / throw.js
Last active August 27, 2015 16:54
var fs = require('fs')
var n = +(process.argv[2]) || 1000
var semis = new Array(n).join(';')
fs.writeFileSync('so-safe.js', semis + 'throw new Error("safety");\n')
var spawn = require('child_process').spawn
spawn(process.execPath, [__dirname + '/so-safe.js'], {
stdio: 'inherit'
}).on('close', function (code, signal) {
fs.unlinkSync('so-safe.js')
if (code)
{
"_id": "_design/_auth",
"language": "javascript",
"lists": {
"index": "function (head,req) {\n var row\n , out = {}\n , id, data\n while (row = getRow()) {\n id = row.id.replace(/^org\\.couchdb\\.user:/, '')\n data = row.value\n delete data._id\n delete data._rev\n delete data.salt\n delete data.password_sha\n delete data.type\n delete data.roles\n delete data._deleted_conflicts\n out[id] = data\n }\n send(toJSON(out))\n }",
"email": "function (head, req) {\n var row\n , data\n , id\n , email = req.query.email || undefined\n , out = []\n while (row = getRow()) {\n id = row.id.replace(/^org\\.couchdb\\.user:/, '')\n data = row.value\n var dm = data.email || undefined\n if (data.email !== email) continue\n out.push(row.value.name)\n }\n send(toJSON(out))\n }"
},
"validate_doc_update": "function (newDoc, oldDoc, userCtx, secObj) {\n if (newDoc._deleted === true)
https://registry.npmjs.org/http-browserify
{"_id":"http-browserify","_rev":"56-7851fa9373cc18c00b2029de68d9d373","name":"http-browserify","description":"http module compatability for browserify","dist-tags":{"latest":"1.2.0"},"versions":{"0.0.0":{"name":"http-browserify","version":"0.0.0","description":"http module compatability for browserify","main":"index.js","browserify":"browser.js","directories":{"lib":".","example":"example","test":"test"},"devDependencies":{"express":"2.4.x","browserify":"1.4.x"},"repository":{"type":"git","url":"git://github.com/substack/http-browserify.git"},"keywords":["http","browserify","compatible","meatless","browser"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT/X11","engine":{"node":">=0.4"},"_id":"http-browserify@0.0.0","dependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.10","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"10876a100209f94a6f72044df4337a6cca7b31b7","tarball":"http://registry.npmjs.org/http-
isaacs@urdva:~ v0.10.23-pre
$ npm cache clean grunt-exec ; npm view grunt-exec _rev
npm http GET https://registry.npmjs.org/grunt-exec
npm http 200 https://registry.npmjs.org/grunt-exec
46-37e75043a3804acce26c2ac6d0bbf7ef
isaacs@urdva:~ v0.10.23-pre
$ curl https://registry.npmjs.org/grunt-exec/ | json _rev
% Total % Received % Xferd Average Speed Time Time Time Current
$ npm cache clean grunt-exec; npm view grunt-exec _rev -ddd
npm info it worked if it ends with ok
npm verb cli [ 'node',
npm verb cli '/usr/local/bin/npm',
npm verb cli 'view',
npm verb cli 'grunt-exec',
npm verb cli '_rev',
npm verb cli '-ddd' ]
npm info using npm@1.4.2
npm info using node@v0.10.23-pre
$ bash -x f.sh
+ ips=(165.225.157.156 skimdb.npmjs.com 165.225.157.64 72.2.119.219)
+ for i in '"${ips[@]}"'
+ curl -sk https://165.225.157.156/registry/grunt-exec
+ json _rev
47-d178e49655bec4df7916fe2e75c38bf0
+ for i in '"${ips[@]}"'
+ curl -sk https://skimdb.npmjs.com/registry/grunt-exec
+ json _rev
47-d178e49655bec4df7916fe2e75c38bf0
@isaacs
isaacs / f.sh
Last active August 29, 2015 13:56
ips=( 165.225.157.156
skimdb.npmjs.com
165.225.157.64
72.2.119.219 )
pkg=browserify
for i in "${ips[@]}"; do
echo -n host=$i" "
curl -sk https://$i/$pkg -H user-agent:'node/v0.10.23-pre darwin x64' -H accept:application/json -H host:registry.npmjs.org | json _rev
@isaacs
isaacs / f.sh
Created February 14, 2014 02:01
ips=( 165.225.157.156
skimdb.npmjs.com
165.225.157.64
72.2.119.219 )
pkg=browserify
for i in "${ips[@]}"; do
echo -n host=$i" "
curl -sk https://$i/$pkg -H user-agent:'node/v0.10.23-pre darwin x64' -H accept:application/json -H host:registry.npmjs.org | json _rev
$ find node_modules -name 'README*' | xargs wc -c | tail -1
531452 total
$ find static -type f | xargs wc -c | tail -1
820587 total