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
require('bluebird'); | |
module['exports'] = function echoHttp (hook) { | |
hook.debug("Debug messages are sent to the debug console"); | |
hook.debug(hook.params); | |
hook.debug(hook.req.path); |
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 http = require('http'); | |
module['exports'] = function recieveHttp (hook) { | |
var hook2 = hook.open('http://hook.io/Marak/echo?foo=bar'); | |
var hook3 = hook.open('http://hook.io/Marak/echo'); | |
var hooks = 2; | |
function complete() { |
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
macro $do { | |
case ($($x = $y) (,) ...) $body => { | |
(function ($x (,) ...) $body)($y (,) ...) | |
} | |
case $name ($($x = $y) (,) ...) $body => { | |
(function $name ($x (,) ...) $body)($y (,) ...) | |
} | |
} | |
macro $var { |
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
/** | |
* A quick proof-of-concept of observable objects using JS accessors | |
* | |
* Base observable objects are created with * `new Observable(names)`, where | |
* `names` is an array of property names that should be observable. | |
* | |
* Instances are created by calling .create(initial_data) on the resulting | |
* base object, and observed with their .observe(handler) method. See the bottom | |
* of this file for an example. | |
*/ |
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
// block-lambda proponents: what does this program do? | |
function in_canadian (speak_cb) { | |
add_eh = {|y| | |
return y + ", eh?" | |
} | |
// now here comes a bunch of code. | |
// imagine there are 50 lines here |