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
import pika | |
import sys | |
import logging | |
logging.basicConfig(level=logging.CRITICAL) | |
params = pika.URLParameters('amqp://guest:guest@localhost:25671/%2F') | |
conn = pika.BlockingConnection(params) | |
ch = conn.channel() |
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
NODE=rabbit$1 | |
shift 1 | |
rabbitmqctl -n "$NODE@$(hostname -s)" $* |
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
import pika | |
import sys | |
import logging | |
logging.basicConfig(level=logging.CRITICAL) | |
params = pika.URLParameters('amqp://guest:guest@localhost:5672/%2F') | |
conn = pika.BlockingConnection(params) | |
ch = conn.channel() |
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 Octet = rangeInt('octet', 0, 255); | |
var ShortStr = label('shortstr', | |
transform(function(s) { | |
return s.substr(0, 255); | |
}, arb.Str)); | |
var LongStr = label('longstr', | |
transform( | |
function(bytes) { return new Buffer(bytes); }, |
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 PassThrough = require('stream').PassThrough || | |
require('readable-stream/passthrough'); | |
var HWM = 100; | |
var tasks = new PassThrough({objectMode: true, highWaterMark: HWM}); | |
var conn, ch; | |
var i = 0; |
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
// Convert a promise-oriented API into a callback-oriented API | |
function identity(x) { return x; } | |
function slice(arrayish, arg1, arg2) { | |
return Array.prototype.slice.call(arrayish, arg1, arg2); | |
} | |
// Makes a transformer from promise-returning functions to | |
// callback-accepting functions. |
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
widgetize.method(Error, Object, function(err) { | |
return err; | |
}); | |
render.method(Error, Function, function(err, append) { | |
append($('<span/>').addClass('error').text(err)); | |
}); | |
// A special value to represent values we're waiting for | |
function Waiting() {} | |
widgetize.method(Waiting, Object, function(wait) { |
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
function Bloop() { } | |
var bloop = new Bloop(); | |
bloop.constructor === Bloop; // and indeed, | |
bloop.constructor === Bloop.prototype.constructor; |
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
// Actually you can hook #1 up as an event handler too, using the | |
// promise implementation: | |
function eventsS() { | |
var step = function(sync) { | |
return function(cons, nil) { | |
sync.then(function(cell) { | |
cons(cell.value, cell.tail); | |
}); | |
} |
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
{ | |
"org": { | |
"login": "rabbitmq", | |
"gravatar_id": "d67216c2433a2f9e836e4491ff72a3ad", | |
"avatar_url": "https://secure.gravatar.com/avatar/d67216c2433a2f9e836e4491ff72a3ad?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png", | |
"id": 96669, | |
"url": "https://api.github.com/orgs/rabbitmq" | |
}, | |
"type": "PushEvent", | |
"created_at": "2012-07-16T12:20:20Z", |