This file contains hidden or 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
Animal - this {} | |
Animal - debug: [ muppet , bert ] | |
Hello, my name is bert and I am a muppet | |
returned: { species: 'muppet', name: 'bert' } | |
**************************************** | |
Muppet - this {} | |
Muppet - debug: [ ernie ] | |
Animal - this {} | |
Animal - debug: [ muppet , ernie ] | |
Hello, my name is ernie and I am a muppet |
This file contains hidden or 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
db = new Storage # external implementation | |
Store = (entity) -> | |
find: db.find.bind db, entity | |
get: db.get.bind db, entity | |
save: db.save.bind db, entity | |
add: db.insert.bind db, entity | |
remove: db.remove.bind db, entity | |
update: db.update.bind db, entity | |
patch: db.patch.bind db, entity |
This file contains hidden or 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 pinturaNodeApp = require("jsgi-node").Listener(pinturaApp); | |
run: () -> | |
http: require 'http' | |
server: http.createServer (request, response) -> | |
#sys.debug sys.inspect request | |
# separate handlers for high-load paths | |
if request.url is '/hello' | |
hello.call response | |
else if request.url is '/test' | |
redirector.call response, rnd() |
This file contains hidden or 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
// simple repl test | |
var test = require("model").Model("test", require("store/js-file").JSFile(), | |
{ | |
properties: { | |
foo: {type: "string"}, | |
bar: {type: "integer", optional: true} | |
}, | |
prototype: {} | |
} |
This file contains hidden or 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 sys = require("sys"); | |
var promise = require('/home/benjamin/programming/tools/bomberjs/bundled/promise/promise'); | |
var p = new promise.Promise(); | |
var p2 = p.then( | |
function () { | |
return '1'; | |
}) | |
.then( |