Skip to content

Instantly share code, notes, and snippets.

View alexindigo's full-sized avatar
💭
I may be slow to respond.

Alex Indigo alexindigo

💭
I may be slow to respond.
  • Palo Alto, CA
View GitHub Profile
@alexindigo
alexindigo / server
Created July 2, 2016 22:12
wrk2 vs wrk, trying to make sense of the results and reasons
$ cat base/index.js
var http = require('http');
http.createServer(function(req, res)
{
res.end('ok');
}).listen(80);
var common = require('../common');
var assert = common.assert;
var http = require('http');
var FormData = require(common.dir.lib + '/form_data');
var CRLF = '\r\n';
var testHeader = 'X-Test-Fake: 123';
// nodeCompatId: true
// baseUrl: /js/
// ------------------------------
// When I require local resource, like
require(['app/bla/870411124'], function(){});
// requirejs.load gets following arguments:
// url: /js/app/bla/870411124.js
@alexindigo
alexindigo / index.js
Created February 2, 2016 16:49
Issue with bundling nodejs modules with and without `nodeIdCompat` flag
// Filepath: node-modules/my_module/index.js
var mutable = require('./mutable.js')
, defaults = require('./defaults.json')
;
@alexindigo
alexindigo / echoHttpRequest.js
Last active August 27, 2015 16:51 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
console.log("Console messages are sent to /logs");
console.log(hook.params);
console.log(hook.req.path);
console.log(hook.req.method);
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
make: *** [Release/obj.target/ffi_bindings/src/ffi.o] Error 1
make: Leaving directory `/home/travis/build/alexindigo/buster-functional/node_modules/buster/node_modules/buster-ci/node_modules/buster-ci-agent/node_modules/ffi/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/travis/.nvm/versions/node/v0.12.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Linux 2.6.32-042stab090.5
gyp ERR! command "node" "/home/travis/.nvm/versions/node/v0.12.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/travis/build/alexindigo/buster-functional/node_modules/buster/node_modules/buster-ci/node_modules/buster-ci-agent/node_modules/ffi
configure: function(conf)
{
conf.on('load:framework', function(rs)
{
rs.addResource({
path: '/buster/functional_mixin.js',
content: injection
});
rs.loadPath.append('/buster/functional_mixin.js');
});
respond: function (req, res) {
if (!handle(req.url)) { return; }
var resource;
var parsedUrl = parseUrl(req.url);
var path = parsedUrl.pathname;
var mimeType = parsedUrl.params.rampMimeType;
var mounted = getMounted(path);

Workaround a.k.a. deep-down-the-rabbit-hole hack for busterjs EMFILE problem somehow OSX decided that 256 of open files is enough for each process :) re: busterjs/buster#347

Contains of the executable buster-test-workaround.js, which could be used as drop-in replacement for buster-test.

And second file grunt_options_buster.js helps to point your grunt task to the workaround executable instead of original buster-test.