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 sys = require('sys'), | |
hash = require('./lib/hash'); | |
// a user's password, hash this please | |
var user_password = "password"; | |
// don't expose your salt | |
var salt = "sUp3rS3CRiT$@lt"; | |
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
// | |
// PascalCase for ConstructorFunctions | |
// Found in: (constructor-function.js) | |
// | |
var ConstructorFunction = exports.ConstructorFunction = function () { | |
// Do Stuff here | |
}; | |
// | |
// camelCase for methodNames and variableNames |
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
// | |
// Simple download using 'request' | |
// | |
function download (localFile, remotePath, callback) { | |
var localStream = fs.createWriteStream(localFile); | |
request({ uri: remotePath, responseBodyStream: localStream }, function (err, response, stream) { | |
if (err) return callback(err); | |
else if (response.statusCode < 200 || response.statusCode >= 300) { |
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
From 5c5748d3f99f3590b4c149f5758eac970d51682f Mon Sep 17 00:00:00 2001 | |
From: indexzero <[email protected]> | |
Date: Wed, 9 Feb 2011 23:27:25 -0500 | |
Subject: [PATCH] Add mutable, implicit headers for easy middleware | |
--- | |
lib/http.js | 41 ++++++++++++- | |
test/simple/test-http-mutable-headers.js | 96 ++++++++++++++++++++++++++++++ | |
2 files changed, 136 insertions(+), 1 deletions(-) | |
create mode 100644 test/simple/test-http-mutable-headers.js |
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
$ sudo npm install npm | |
npm info it worked if it ends with ok | |
npm info using [email protected] | |
npm info using [email protected] | |
npm ERR! tar "-vxpf" "-" "-C" "/usr/local/lib/node/.npm/npm/0.3.0" x package/: Can't update time for package: Operation not permitted | |
npm ERR! tar "-vxpf" "-" "-C" "/usr/local/lib/node/.npm/npm/0.3.0" x package/.gitignore | |
npm ERR! tar "-vxpf" "-" "-C" "/usr/local/lib/node/.npm/npm/0.3.0" x package/.gitmodules | |
npm ERR! tar "-vxpf" "-" "-C" "/usr/local/lib/node/.npm/npm/0.3.0" x package/.npmignore | |
npm ERR! tar "-vxpf" "-" "-C" "/usr/local/lib/node/.npm/npm/0.3.0" x package/bin/: Can't update time for package/bin: Operation not permitted | |
npm ERR! tar "-vxpf" "-" "-C" "/usr/local/lib/node/.npm/npm/0.3.0" x package/cli.js |
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
$ cd /Nodejitsu/node-http-proxy | |
$ node --version | |
v0.4.1 | |
$ vows test/*-test.js --spec | |
♢ node-http-proxy/forward-proxy | |
When using server created by httpProxy.createServer() with forwarding enabled with no latency and a valid target server | |
✓ should receive 'hello localhost' | |
When using server created by httpProxy.createServer() with forwarding enabled with no latency and without a valid forward server |
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 async = require('async'); | |
exports.start = function (options, callback) { | |
// | |
// Create an array of all your setup functions | |
// | |
var setupFns = [ | |
fn1, | |
fn2, | |
fn3, |
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
- Etsy | |
Buy and sell handmade or vintage items, art and supplies on Etsy. The EBAY of Do it yourself. | |
- HP-Palm | |
Everyone knows who this is. Node.js is at the core of WebOS. | |
- Yammer | |
Yammer is a inter-company twitter-like tool. This is fast making corporate IM feel very antiquated. | |
- Joyent |
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 httpProxy = require('http-proxy'); | |
// | |
// Addresses to use in the round robin proxy | |
// | |
var addresses = [ | |
{ | |
host: 'ws1.0.0.0', | |
port: 80 | |
}, |
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
// | |
// Create our type | |
// | |
function PreLoader() { | |
this._queue = []; | |
this._mime = {}; | |
this._handlers = {}; | |
this._loaded = []; | |
}; | |
PreLoader.prototype.addFileType = function addFileType(extension,mime) { |