Skip to content

Instantly share code, notes, and snippets.

View naneau's full-sized avatar

Maurice Fonk naneau

View GitHub Profile
http = require 'http'
host = '127.0.0.1'
port = 10000
server = http.createServer (request, response) ->
# We expect unicode
request.setEncoding 'utf8'
# Parse body
@naneau
naneau / playing with coffeescript
Created December 26, 2010 14:52
A simple message router for an irc bot I am writing, mainly for playing with coffeescript
# MessageRouter.js
#
# *Very* basic IRC callback router for incoming messages
# An instance is created and passed the IRC client
# Message callbacks can be added through addHandler()
# Will use `String.match()` to match and call a callback
# Utilities Underscore.js
_ = require('underscore')
if (!extension_loaded('mbstring')) {
throw new Exception('"mbstring" extension not loaded, ABC5 requires mbstring to work correctly');
}
setlocale(LC_ALL, 'nl_NL.UTF-8');
mb_internal_encoding('UTF-8');
mb_http_output('UTF-8');
mb_http_input('UTF-8');
//error during dispatch (this might be salvageable)
// $request = Abc_Bootstrap::getRequest();
//
// $request->setModuleName('html')
// ->setControllerName('error')
// ->setActionName('error')
// ->setDispatched(false);
//
// $frontController->setRequest($request);
// $frontController->dispatch();

#Design choices for Springbok

##Problem

We have been struggling for a while with ways to deal with objects and child objects in MongoDB. Basically the problem boils down to the following:

When an object in our domain - say a project - has a number of child objects - say milestones - in what way do we store them?

There are basically two ways of doing it.

<?php
/**
* Smarty Internal Plugin Template
*
* This file contains the Smarty template engine
*
* @package Smarty
* @subpackage Templates
* @author Uwe Tews