Skip to content

Instantly share code, notes, and snippets.

View niallo's full-sized avatar

Niall O'Higgins niallo

View GitHub Profile
> strider@1.4.0-pre start /Users/niallo/projects/strider-14/strider
> bin/strider
30 Sep 11:02:16 - info: Using MongoDB URL: mongodb://localhost/strider-foss
30 Sep 11:02:17 - info: RUNNER INIT
/Users/niallo/projects/strider-14/strider/node_modules/express/lib/router/index.js:290
throw new Error(msg);
^
Error: .get() requires callback functions but got a [object Undefined]
30 Sep 10:02:18 - info: initalized static directories
/Users/niallo/projects/strider-14/strider/node_modules/mongoose/lib/utils.js:419
throw err;
^
TypeError: Object.keys called on non-object
at Function.keys (native)
at /Users/niallo/projects/strider-14/strider/main.js:95:16
at /Users/niallo/projects/strider-14/strider/node_modules/mongoose/lib/utils.js:414:16
at /Users/niallo/projects/strider-14/strider/node_modules/mongoose/node_modules/mongodb/lib/mongodb/collection.js:497:9
diff --git a/index.js b/index.js
index d750ce4..9c89fc4 100644
--- a/index.js
+++ b/index.js
@@ -1,8 +1,9 @@
var Runner = require('./lib/worker')
var create = function(emitter, opts, cb){
+ console.dir(opts)
var runner = new Runner(emitter, opts)
@niallo
niallo / reconnect-mongoose.js
Last active December 17, 2015 03:29
Simple Mongoose program to facilitate testing MongoDB auto-reconnect in client
//
// Program to query a local mongodb every second. This should auto-reconnect.
//
// Instructions:
//
// 1) start mongod
// 2) npm i mongoose@3.6.9 && node reconnect-mongoose.js
// 3) kill mongod
// 4) after a short interval, restart mongod
//
@niallo
niallo / gist:5288738
Last active December 15, 2015 16:19
docker shell interaction oddity
Hangs:
$ cat > builder.sh
apt-get update
apt-get install -y wget
wget --help
$ docker run -i -t base /bin/bash < builder.sh
Doesn't hang:
@niallo
niallo / strider-custom.json
Created March 21, 2013 17:49
Example of a strider-custom.json for a Go project
{
"prepare":"GOROOT=/opt/node/go GOBIN=/opt/node/bin/go make",
"test":"GOROOT=/opt/node/go GOBIN=/opt/node/bin/go make test",
"deploy":"echo a custom deploy command executed on test success"
}
//
// Node Child Process Spawn() race bug
//
// Triggerable on:
// Node 0.8.11 / OS X 10.8.2 / MBP 13" 2011 (4 cores)
// Doesn't seem to happen on:
// Node 0.8.11 / Ubuntu 10.04 LTS / EC2 Medium (1 core)
var assert = require('assert')
@niallo
niallo / gist:3863486
Created October 10, 2012 06:27
node 0.8.11 stdout/stderr setEncoding('utf8') strangeness
var assert = require('assert')
var spawn = require('child_process').spawn
function runTest(cb) {
var proc = spawn("/usr/bin/env", [], {env:{foo:"bar"}})
proc.stdoutBuf = ""
proc.stderrBuf = ""
proc.stdmergedBuf = ""
@niallo
niallo / gist:3484450
Created August 26, 2012 23:50
project type detection heuristic predicate
// Detection predicate for Python language & known frameworks
{
// "exists" property can be a glob as supported by node-glob
// https://github.com/isaacs/node-glob
//
// "grep" property is a JavaScript regular expression as described at
// https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/RegExp
// grep looks for the regular expression inside of the
// Array predicates have an implicit OR
@niallo
niallo / cal.c
Created July 10, 2012 16:30
"cal" program from V6 AT&T UNIX (release May 1975)
char dayw[]
{
" S M Tu W Th F S"
};
char *smon[]
{
"Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec",
};