app.http.before.push(function(req, res){
app.log.info(req.url);
res.emit('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 fork = require('child_process').fork, | |
| spawn = require('child_process').spawn; | |
| // | |
| // This works! | |
| // | |
| // spawn('node', ['server.js']); | |
| // | |
| // This doesn't work |
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'), | |
| httpProxy = require('http-proxy'); | |
| var proxy = new httpProxy.HttpProxy({ | |
| host: 'somewhere.on.theinternet.com' | |
| port: 80 | |
| }); | |
| http.createServer(function (req, res) { | |
| req.start = +new Date(); |
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') | |
| , request = require('request') | |
| , assert = require('assert') | |
| , httpMocks = require('node-mocks-http') | |
| static = require('../../lib/node-static'); | |
| var fileServer = new(static.Server)(__dirname + '/../fixtures', {}); | |
| var suite = vows.describe('file-server.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
| #!/usr/bin/env node | |
| /* | |
| * This module can verify that packages installed during development are | |
| * identical to those installed during deployment. The standard npm shrinkwrap | |
| * only ensures that package versions are the same, but does not verify contents. | |
| * This module checks the shasum of the package tarballs downloaded by npm during | |
| * development and deployment to ensure they are the same. | |
| * | |
| * Usage: |
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
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <title>XKCD plots in d3</title> | |
| <script src="http://d3js.org/d3.v2.min.js?2.10.0"></script> | |
| <script src="xkcd.js"></script> | |
| <style> |
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 a = []; | |
| a[Math.pow(2, 32) - 2] = "max index"; // highest non-expando indexed property | |
| console.log(a.length === Math.pow(2, 32) - 1); // true | |
| try { | |
| a.push("whoa", "EVEN MOAR WHOA"); | |
| } catch (e) { | |
| console.log(e instanceof RangeError); // true | |
| } |
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
| VERSION=$1 | |
| if [ -z $VERSION ]; then | |
| echo "usage: vbump VERSION" | |
| echo "No version found." | |
| exit 1 | |
| fi | |
| echo "git add ." | |
| git add . |