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
module.exports = function( options ) { | |
var seneca = this | |
var plugin = 'loadbalance-transport' | |
var so = seneca.options() | |
options = seneca.util.deepextend( | |
{ | |
loadbalance: { | |
workers: [ ... ] |
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
server { | |
... | |
location /myapp/ { | |
alias /Users/richard/Projects/MyApp/www/; | |
} | |
... | |
} |
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
socket.on('error', function(err) { | |
debug('AGENT SOCKET ERROR: ' + err.message); | |
var req; | |
if (socket._httpMessage) { | |
req = socket._httpMessage; | |
} else if (self.queue.length) { | |
req = self.queue.shift(); | |
assert(req._queue === self.queue); | |
req._queue = null; | |
} else { |
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
function StreamBuffer(req) { | |
var self = this | |
var buffer = [] | |
var ended = false | |
var ondata = null | |
var onend = null | |
self.ondata = function(f) { | |
for(var i = 0; i < buffer.length; i++ ) { |
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
#main { | |
margin: 0px; | |
width: 480px; | |
height: 300px; | |
} |
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
// the stack trace you really want that tells you how you originally got to the fs.readFile call | |
var stacktrace = new Error() | |
Error.captureStackTrace(stacktrace) | |
fs.readFile( path, encoding, function(err,data) { | |
if( err ) { | |
var stackerr = new Error('Unable to read file: '+path+' (error code: '+err.code+')') | |
stackerr.errno = err.errno | |
stackerr.code = err.code |
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
/* | |
Workaround for property order inconsistency in Chrome V8. | |
Although unspecified by ECMA, most JavaScript engines return | |
properties in insertion order when you use for..in to iterate through | |
them. | |
For example: |
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
http://en.wikipedia.org/wiki/Dara_Ó_Briain | |
http://desbishop.net/ | |
http://en.wikipedia.org/wiki/Russell_Howard | |
http://en.wikipedia.org/wiki/Michael_McIntyre | |
http://en.wikipedia.org/wiki/Have_I_Got_News_For_You | |
http://en.wikipedia.org/wiki/Mock_the_Week | |
http://www.bbc.co.uk/programmes/b008cnxn | |
http://www.thecatlaughs.com/ |
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
seneca.act({role:'web',use:{ | |
name:name, | |
prefix:'/well/:event/', | |
pin:{role:name,cmd:'*'}, | |
map:{ | |
whoami:{GET:setcontext}, | |
leader:{GET:setcontext}, | |
members: { alias:'player/members/:team', GET: setcontext }, |
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 connect = require('connect') | |
var imgdata = [ | |
0x47,0x49, 0x46,0x38, 0x39,0x61, 0x01,0x00, 0x01,0x00, 0x80,0x00, 0x00,0xFF, 0xFF,0xFF, | |
0x00,0x00, 0x00,0x21, 0xf9,0x04, 0x04,0x00, 0x00,0x00, 0x00,0x2c, 0x00,0x00, 0x00,0x00, | |
0x01,0x00, 0x01,0x00, 0x00,0x02, 0x02,0x44, 0x01,0x00, 0x3b | |
] | |
var imgbuf = new Buffer(imgdata) | |
var server = connect.createServer( |
OlderNewer