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
# See http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm | |
# written as one-liners because my REPL didn't like multiline functions this morning | |
# tested on CoffeeScript v1.0.1 | |
input = [0 .. 7] | |
swap = (input, x, y) -> [input[x], input[y]] = [input[y], input[x]] | |
rand = (x) -> Math.floor Math.random() * x | |
durst = (input) -> swap(input, i, rand i) for i in [input.length - 1 .. 1] | |
""" |
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
request ok | |
'Function without a name from /home/jann/gitty/node-assertvanish/request-test.js:5' (type 'Function') is still alive! | |
Function without a name from /home/jann/gitty/node-assertvanish/request-test.js:5 | |
object ({'readable': true, 'writable': true, 'uri': [object], 'callback': [REFERENCE], 'pool': [object], 'dests': [object], '__isRequestRequest': true, '_redirectsFollowed': 0, 'maxRedirects': 10, 'followRedirect': true, 'method': GET, 'headers': [object], 'port': 80, 'host': www.google.de, '_events': [object], 'path': /, 'httpModule': [object], 'start': [function ""], 'ntick': true, 'response': [object], 'getAgent': [function ""], 'request': [function ""], 'pipe': [function ""], 'write': [function ""], 'end': [function ""], 'pause': [function ""], 'resume': [function ""], 'setMaxListeners': [function ""], 'emit': [function ""], 'addListener': [function ""], 'on': [function ""], 'once': [function ""], 'removeListener': [function ""], 'removeAllListeners': [function ""], 'listeners': [function ""], '_ |
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
request ok | |
'Function without a name from /home/jann/gitty/node-assertvanish/request-test.js:5' (type 'Function') is still alive! | |
Function without a name from /home/jann/gitty/node-assertvanish/request-test.js:5 | |
object ({'readable': true, 'writable': true, 'uri': [object], 'callback': [REFERENCE], 'pool': [object], 'dests': [object], '__isRequestRequest': true, '_redirectsFollowed': 0, 'maxRedirects': 10, 'followRedirect': true, 'method': GET, 'headers': [object], 'port': 80, 'host': www.google.de, '_events': [object], 'path': /, 'httpModule': [object], 'start': [function ""], 'ntick': true, 'response': [object], 'getAgent': [function ""], 'request': [function ""], 'pipe': [function ""], 'write': [function ""], 'end': [function ""], 'pause': [function ""], 'resume': [function ""], 'setMaxListeners': [function ""], 'emit': [function ""], 'addListener': [function ""], 'on': [function ""], 'once': [function ""], 'removeListener': [function ""], 'removeAllListeners': [function ""], 'listeners': [function ""], '_ |
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
request ok | |
'Function without a name from /home/jann/gitty/node-assertvanish/request-test.js:5' (type 'Function') is still alive! | |
Function without a name from /home/jann/gitty/node-assertvanish/request-test.js:5 | |
object ({'readable': true, 'writable': true, 'uri': [object], 'callback': [REFERENCE], 'pool': [object], 'dests': [object], '__isRequestRequest': true, '_redirectsFollowed': 0, 'maxRedirects': 10, 'followRedirect': true, 'method': GET, 'headers': [object], 'port': 80, 'host': www.google.de, '_events': [object], 'path': /, 'httpModule': [object], 'start': [function ""], 'ntick': true, 'response': [object], 'getAgent': [function ""], 'request': [function ""], 'pipe': [function ""], 'write': [function ""], 'end': [function ""], 'pause': [function ""], 'resume': [function ""], 'setMaxListeners': [function ""], 'emit': [function ""], 'addListener': [function ""], 'on': [function ""], 'once': [function ""], 'removeListener': [function ""], 'removeAllListeners': [function ""], 'listeners': [function ""], '_ |
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
NATIVE CAUSE: ServerResponse ({'statusCode': 200, 'writeContinue': [function ""], '_implicitHeader': [function ""], 'writeHead': [function ""], 'writeHeader': [function ""], 'assignSocket': [function ""], 'detachSocket': [function ""], 'destroy': [function ""], '_send': [function ""], '_writeRaw': [function ""], '_buffer': [function ""], '_storeHeader': [function ""], 'setHeader': [function ""], 'getHeader': [function ""], 'removeHeader': [function ""], '_renderHeaders': [function ""], 'write': [function ""], 'addTrailers': [function ""], 'end': [function ""], '_finish': [function ""], '_flush': [function ""], 'pipe': [function ""], 'setMaxListeners': [function ""], 'emit': [function ""], 'addListener': [function ""], 'on': [function ""], 'once': [function ""], 'removeListener': [function ""], 'removeAllListeners': [function ""], 'listeners': [function ""]}) | |
NATIVE CAUSE: ServerResponse ({'statusCode': 200, 'writeContinue': [REFERENCE], '_implicitHeader': [function ""], 'writeHead': [function ""], 'writeHeade |
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
Function without a name from /home/jann/gitty/node-assertvanish/request-test.js:5 | |
object ({'readable': true, 'writable': true, 'uri': [object], 'callback': [REFERENCE], 'pool': [object], 'dests': [object], '__isRequestRequest': true, '_redirectsFollowed': 0, 'maxRedirects': 10, 'followRedirect': true, 'method': GET, 'headers': [object], 'port': 80, 'host': www.google.de, '_events': [object], 'path': /, 'httpModule': [object], 'start': [function ""], 'ntick': true, 'response': [object], 'getAgent': [function ""], 'request': [function ""], 'pipe': [function ""], 'write': [function ""], 'end': [function ""], 'pause': [function ""], 'resume': [function ""], 'setMaxListeners': [function ""], 'emit': [function ""], 'addListener': [function ""], 'on': [function ""], 'once': [function ""], 'removeListener': [function ""], 'removeAllListeners': [function ""], 'listeners': [function ""], '_started': true, 'agent': [object], 'req': [object]}) | |
Function 'g' from events.js:141 | |
Array ({'0': [function "g"], '1': |
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
sum =* a+b | |
foo = -> | |
a = 3 | |
b = 4 | |
sum * 10 |
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
getUser = (*) -> | |
(name) when typeof name is 'string' -> | |
User.lookup 'name', name | |
(id) when typeof id is 'number' -> | |
User.lookup 'id', id | |
-> | |
throw new Error "invalid arguments" |
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
[36minfo -[39m socket.io started | |
[90mdebug -[39m client authorized | |
[36minfo -[39m handshake authorized 2644789511415902503 | |
[90mdebug -[39m setting request GET /socket.io/1/websocket/2644789511415902503 | |
[90mdebug -[39m set heartbeat interval for client 2644789511415902503 | |
[90mdebug -[39m client authorized for | |
[90mdebug -[39m websocket writing 1:: | |
[36minfo -[39m transport end | |
[90mdebug -[39m set close timeout for client 2644789511415902503 | |
[90mdebug -[39m cleared close timeout for client 2644789511415902503 |
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 lightnode = require('lightnode'); | |
var http = require('http'); | |
var assertvanish = require('./index'); | |
var fileServer = new lightnode.FileServer('/home/jann/gitty/node-assertvanish/'); | |
var server = http.createServer(function(req, res) { | |
fileServer.receiveRequest(req, res); | |
}); |