This file contains 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 toBits = function (num) { return num.toString(2).split('').map(Number).reverse(); }; | |
toBits(1) // [1] | |
toBits(2) // [1, 0] | |
toBits(4) // [1, 0, 0] | |
toBits(7) // [1, 1, 1] | |
toBits(8) // [1, 0, 0, 0] |
This file contains 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 domain = require('domain'); | |
var server = new http.createServer(function (req, res) { | |
res.end('Not implemented'); | |
}); | |
server.listen(9222); |
This file contains 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
Error: error in route | |
at /Users/Andreas/Sites/Admazely/director-wrapper/test.js:15:15 | |
at Domain.bind.b (domain.js:201:18) | |
at Domain.run (domain.js:141:23) | |
at Server.<anonymous> (/Users/Andreas/Sites/Admazely/director-wrapper/test.js:10:7) | |
at Server.EventEmitter.emit (events.js:91:17) | |
at HTTPParser.parser.onIncoming (http.js:1793:12) | |
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:111:23) | |
at Socket.socket.ondata (http.js:1690:22) | |
at TCP.onread (net.js:402:27) |
This file contains 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
'use strict'; | |
const net = require('net'); | |
const server = net.createServer(function (socket) { | |
socket.write('hallo world'); | |
}); | |
server.listen('127.0.0.1', 8080); |
This file contains 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
Andreass-MacBook-Pro:node Andreas$ npm install -g vock@0.1.2 | |
npm http GET https://registry.npmjs.org/vock/0.1.2 | |
npm http 304 https://registry.npmjs.org/vock/0.1.2 | |
npm http GET https://registry.npmjs.org/node-gyp | |
npm http GET https://registry.npmjs.org/msgpack-js | |
npm http GET https://registry.npmjs.org/optimist | |
npm http GET https://registry.npmjs.org/bindings | |
npm http GET https://registry.npmjs.org/colors | |
npm http GET https://registry.npmjs.org/pripub | |
npm http GET https://registry.npmjs.org/prompt |
This file contains 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
if (process.argv[2] === 'bench') { | |
var pre = process.hrtime(); | |
if (process.argv[3] === '1') { | |
(function () { | |
var args = Array.prototype.slice.call(arguments); | |
})(1, 2.0, "string", {"foo": true}); | |
} | |
else if (process.argv[3] === '2') { |
This file contains 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 util = require('util'); | |
var Stream = require('stream'); | |
var file = fs.createReadStream('file.csv'); | |
var parser = new CSV(); | |
// values will be emitted | |
parser.on('value', function (value) { | |
console.log(value); |
This file contains 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> | |
<meta charset="utf8"> | |
<title>dprof visualizer</title> | |
<style> | |
/* general page layout */ | |
html, body { | |
margin: 0; | |
height: 100%; | |
} |
This file contains 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
'use strict'; | |
const asyncWrap = process.binding('async_wrap'); | |
const http = require('http'); | |
const fs = require('fs'); | |
// | |
// Track | |
// | |
// 1. Setup a global variable to track the context of the async_hook_init_function |
This file contains 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
make apf | |
cd node_modules/packager; node package.js projects/apf_cloud9.apr | |
10:19:43.267 Start parsing main application | |
using file: /Users/Andreas/GitHub/cloud9/node_modules/packager/projects/projects/apf_cloud9.apr | |
path.existsSync is now called `fs.existsSync`. | |
10:19:43.287 Start parsing | |
10:19:43.289 Parsing settings | |
10:19:43.290 Parsing files | |
10:19:43.398 Getting filelist done. | |
10:19:43.398 Parsing defines |