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
<?php | |
/** | |
* | |
* CI / MySQL Closure Table Model | |
* | |
* @link http://www.slideshare.net/billkarwin/models-for-hierarchical-data | |
* @TODO improve | |
* | |
* sql schema: |
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
/* | |
* jsTree 1.0-rc3 | |
* http://jstree.com/ | |
* | |
* Copyright (c) 2010 Ivan Bozhanov (vakata.com) | |
* | |
* Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License | |
* http://www.opensource.org/licenses/mit-license.php | |
* http://www.gnu.org/licenses/gpl.html | |
* |
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
body { | |
width: 580px; | |
margin: 0 auto; | |
font-family: sans-serif; | |
font-size: 12px; | |
color: #666; | |
} | |
.fan { | |
position: relative; | |
width: 120px; |
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
body { | |
width: 580px; | |
margin: 0 auto; | |
font-family: sans-serif; | |
font-size: 12px; | |
color: #666; | |
} | |
.fan { | |
position: relative; | |
width: 120px; |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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
// In this example we'd like to have a factory that works per request and allows to keep track of created Models | |
// The singleton will however apply to all requests and thus keep growing | |
// For that reason we supply it with a reset function. | |
// This works fine until between receiving a request and sending a response there is no asynchronous code execution | |
// Once multiple requests come in in very short intervals, the asynchronous execution will lead to requests cross-polluting | |
// the singleton class | |
// factory.js | |
// | |
// Should be per-request so we can keep track |
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
// In this example we'd like to have a factory that works per request and allows to keep track of created Models | |
// We create a factory per request and pass it around to the parts of the code that need access | |
// This can quickly lead to hard to messy code | |
// factory.js | |
// | |
// Basically a factory for factories | |
// For every request we create a new one | |
var Model = require('backbone').Model; |
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 local = require('./namespace-module'); | |
var http = require('http'); | |
var uuid = require('uuid').v4; | |
http.createServer(function(req, res) { | |
req._id = uuid(); | |
local.run(function() { | |
local.set('id', req._id); | |
next(req, res); |
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
'use strict'; | |
var assert = require('assert'), | |
director = require('director'), | |
EventEmitter = require('events').EventEmitter, | |
ns = require('continuation-local-storage').createNamespace('testing'), | |
express = require('express'), | |
app = express(); | |
OlderNewer