This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var redis = require('redis'); | |
| var pubcli = redis.createClient(6380, '127.0.0.1'); | |
| var subcli = redis.createClient(6380, '127.0.0.1'); | |
| var datacli = redis.createClient(6380, '127.0.0.1', {return_buffers:true}); | |
| var have = 0; | |
| datacli.lrange('data.theresource', 0, -1, function(err,chunks) { | |
| console.log("initial data!",chunks); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var N = process.argv[2] || 1000000; | |
| function log () { | |
| console.log.apply(console,arguments); | |
| } | |
| for (var i=0; i<N; i++) { | |
| log("this is message"+i); | |
| } | |
| // didn't run to completion, stopped at ~5m18s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*** tough-cookie/lib/cookie.js ***/ | |
| /* I added the following to the end of the file for testing purposes */ | |
| memstore = require('./memstore'); | |
| module.exports.MemoryCookieStore = memstore.MemoryCookieStore; // ok to keep the original label ~stash | |
| /*** jsonstore.js ***/ | |
| var tough = require('tough-cookie'); | |
| // ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| process.env['NODE_ENV'] = 'production'; | |
| var app = require('http').createServer(handler) | |
| , io = require('socket.io').listen(app) | |
| , fs = require('fs') | |
| app.listen(80); | |
| function handler (req, res) { | |
| fs.readFile(__dirname + '/index.html', | |
| function (err, data) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var vows = require('vows'); | |
| var assert = require('assert'); | |
| var https = require('https'); | |
| vows.describe("dies?").addBatch({ | |
| "pretend this is doing several https requests": { | |
| topic: function() { | |
| var cb = this.callback; | |
| // https is important; http doesn't produce an error | |
| var req = https.request({host:'encrypted.google.com',path:'/',method:'GET'}, function(res) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fs = require('fs'); | |
| var path = require('path'); | |
| var https = require('https'); | |
| var http = require('http'); | |
| var pem = fs.readFileSync(path.resolve(__dirname,'./test.pem')); | |
| var util = require('util'); | |
| var protocol = process.argv[2] == 'http' ? http : https; | |
| var agent = new protocol.Agent(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var net = require('net'); | |
| var async = require('async'); | |
| var spew = new Buffer('<policy-file-request/>\0'); | |
| var NUM = process.argv[2] || 10; | |
| var CONCURRENCY = process.argv[3] || 10; | |
| var got = 0; | |
| function worker(task, next) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var http = require('http'); | |
| var server = http.createServer(function(req,res) { | |
| var opts = { | |
| method: 'GET', host: 'news.ycombinator.com', port: 80, path: req.url | |
| }; | |
| var proxyReq = http.request(opts, function(proxyRes) { | |
| var chunks = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * optify.js - refactor long function parameters into "pass an opts object" style | |
| * | |
| * vim instructions: | |
| * 1) Using shift-v, select `function (a,b,c,d,e,cb) {` | |
| * 2) Type ":!node ~/optify" | |
| * 3) Selection is replaced with: | |
| * function (opts,cb) { | |
| * var a = opts.a; | |
| * var b = opts.b; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- tmux-1.6/Makefile 2012-06-07 15:23:20.835144809 +0000 | |
| +++ tmux-1.6-modified/Makefile 2012-06-07 15:22:47.803578987 +0000 | |
| @@ -211,7 +211,7 @@ | |
| CPP = gcc -E | |
| # Preprocessor flags. | |
| -CPPFLAGS = -I/opt/local/include -I/opt/local/include/ncurses -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED $(am__append_4) $(am__append_5) \ | |
| +CPPFLAGS = -I/opt/local/include -I/opt/local/include/ncurses $(am__append_4) $(am__append_5) \ | |
| $(am__append_7) $(am__append_8) | |
| CYGPATH_W = echo |