Skip to content

Instantly share code, notes, and snippets.

View tommedema's full-sized avatar

Tom Medema tommedema

View GitHub Profile
View gist:2622837
test :
folders = $('find test -type d')
for folder in $folders
mocha --ignore-leaks folder
View gist:2621673

All application logic is defined using routines. Routines are loaded on runtime and are passed a global event emitter instance, called the mediator.

##Example The following describes an application example structure.

Application objective: create a http server and serve a RESTful API (serves current music stations and the current songs for each station).

###File tree

  • src/ (contains source files)
  • bootstrap.js (initializes the application and loads routines)
View gist:2603686
var EventEmitter2 = require('eventemitter2').EventEmitter2
bootutil = require('../src/boot/util');
describe('boot util', function() {
it('should load existing test routines without mediator', function() {
bootutil.loadRoutines(__dirname + '/testroutines-nomediator', function(err, routines) {
View gist:2601189
var bootutil = require('/src/boot/util'),
EventEmitter2 = require('eventemitter2').EventEmitter2;
describe('boot util', function() {
it('should load existing test routines without mediator', function() {
bootutil.loadRoutines('./testroutines-nomediator', function(err, routines) {
View boot-util-test.js
var vows = require('vows'),
assert = require('assert'),
EventEmitter2 = require('eventemitter2').EventEmitter2,
bootutil = require(__dirname + '/../src/boot/util');
vows.describe('Boot util').addBatch({
'when loading some existing test routines without mediator': {
topic: function() {
bootutil.loadRoutines(__dirname + '/testroutines-nomediator', this.callback);
View gist:2008348
//opens the stats collection
var openStats = function(err, stats) {
if (err) return console.log('error opening stats %o', err);
//when a new request occurs
stats.update({name: 'reqcount'}, {'$inc': {value: 1}}, {safe: true}, function() { });
//opens the database
var db = new Db('musictv', replSet);
View gist:1522539
"ns1:AmplifyResponse": {
"AmplifyReturn": {
"Topics": {
"Domains": [{
"Domain": {
"Name": "Business",
"Value": 10.00
"Subdomains": [{
View gist:1521693
this.bytesWritten += data.length;
TypeError: Cannot read property 'length' of undefined
at Socket.write (net.js:425:28)
at EventEmitter.<anonymous> (E:\Workspaces\Node.js\stockwiz\src\routines\boi
at EventEmitter.emit (E:\Workspaces\Node.js\stockwiz\node_modules\mediator\n
at EventEmitter.<anonymous> (E:\Workspaces\Node.js\stockwiz\src\routines\sca
import java.util.Scanner;
import de.l3s.boilerpipe.extractors.ArticleExtractor;
public class BoilerpipeCLI {
public static void main(String[] args) throws Exception {
String inputText = "";
Scanner scanner = new Scanner(;
View gist:1362160
2011-11-12 19:21:26,480 DEBUG: updating <jockey.detection.LocalKernelModulesDriverDB instance at 0x175eef0>
2011-11-12 19:21:28,845 DEBUG: reading modalias file /lib/modules/3.0.0-12-generic/modules.alias
2011-11-12 19:21:28,951 DEBUG: reading modalias file /usr/share/jockey/modaliases/b43
2011-11-12 19:21:28,965 DEBUG: reading modalias file /usr/share/jockey/modaliases/disable-upstream-nvidia
2011-11-12 19:21:29,018 WARNING: Could not open DriverDB cache /var/cache/jockey/driverdb-OpenPrintingDriverDB.cache: [Errno 2] No such file or directory: '/var/cache/jockey/driverdb-OpenPrintingDriverDB.cache'
2011-11-12 19:21:29,043 DEBUG: loading custom handler /usr/share/jockey/handlers/
2011-11-12 19:21:29,072 DEBUG: Instantiated Handler subclass __builtin__.SlModem from name SlModem
2011-11-12 19:21:29,095 DEBUG: Software modem not available
2011-11-12 19:21:29,095 DEBUG: loading custom handler /usr/share/jockey/handlers/
2011-11-12 19:21:29,161 WARNING: modinfo for module fglrx_updates failed: