Skip to content

Instantly share code, notes, and snippets.

This is a test
/**
* The Serializable module adds a set of handy utilities to make it easier to
* work with JSON-serialized classes.
*
* Usage:
*
* function MyClass(serialized_data) {
* this.init({
* name: 'default name'
* }, serialized_data);
var pipe = require('pipe').pipe;
process.mixin(require('pipe/pipelets/all'));
//
// Creates a new http server running on port 8000. The server is started and
// piped immediately.
//
pipe ('http://127.0.0.1:8000') (
//
master.js
---
var spawn = require('child_process').spawn;
var child = spawn("node", ["child.js"]);
console.log("Child %PID ", child.pid);
setTimeout(function() {
console.log("Shutdown");
@jfd
jfd / pub.js
Created April 13, 2011 18:37
Publisher
zmq = require('zeromq');
s = zmq.createSocket('pub');
count = 0;
function send() {
for (var i = 0; i < 1000; i++) {
s.send("data");
require("./fibers");
var count = 0;
var fib1 = Fiber(function() {
var runme = true;
while (runme) {
Fiber.yield();
var msg = fib1.mailbox.shift();
if (msg[0] == "end") {
runme = false;
@jfd
jfd / keybase.md
Created September 19, 2017 06:51

Keybase proof

I hereby claim:

  • I am jfd on github.
  • I am jdahlberg (https://keybase.io/jdahlberg) on keybase.
  • I have a public key ASCW3gaNfPkfDmtyxgpzkqi_yHB6n5VKnrhbuiMLNHHvAAo

To claim this, I am signing this object:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.