Skip to content

Instantly share code, notes, and snippets.

@grncdr
grncdr / echoHttpRequest.js
Created November 9, 2014 15:14 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
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);
@grncdr
grncdr / mergeHooks.js
Last active August 29, 2015 14:09 — forked from Marak/mergeHooks.js
Merge multiple Hooks into a single Hook
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() {
@grncdr
grncdr / gist:4554165
Last active December 11, 2015 05:48 — forked from jlongster/gist:3881008
hygienic destructuring var assignments with sweet.js
macro $do {
case ($($x = $y) (,) ...) $body => {
(function ($x (,) ...) $body)($y (,) ...)
}
case $name ($($x = $y) (,) ...) $body => {
(function $name ($x (,) ...) $body)($y (,) ...)
}
}
macro $var {
@grncdr
grncdr / index.js
Created September 23, 2012 21:36 — forked from anonymous/index.js
Observable object properties in javascript
/**
* 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.
*/
@grncdr
grncdr / find-the-block.js
Created January 17, 2012 03:55 — forked from isaacs/find-the-block.js
just changing names
// 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