Skip to content

Instantly share code, notes, and snippets.

a Stream spec


##UPDATE

I've now moved this stuff into it's own repo and added an executable checker, and some nifty diagrams of the stream state transitions state diagrams

This gist is no longer being maintained. goto dominictarr/stream-spec


@bfncs
bfncs / mouse.js
Created March 12, 2012 09:41
Read Linux mouse(s) in node.js
/**
* Read Linux mouse(s) in node.js
* Author: Marc Loehe (marcloehe@gmail.com)
*
* Adapted from Tim Caswell's nice solution to read a linux joystick
* http://nodebits.org/linux-joystick
* https://github.com/nodebits/linux-joystick
*/
var fs = require('fs'),
@rauchg
rauchg / ms.md
Created December 21, 2011 00:25
Milliseconds conversion utility.
@jamescasbon
jamescasbon / template.py
Created December 11, 2011 16:37
Pure python templates using with statement
"""
A really stupid python template language inspired by coffeekup, markaby.
Do not use this code, it will ruin your day. A byproduct of insomnia.
TL;DR
-----
This module defines a template language that allows us to do:
d = Doc()
@mjackson
mjackson / mockstream.js
Created September 7, 2011 17:31
A mock stream wrapper for node.js
var util = require("util"),
Stream = require("stream").Stream;
module.exports = MockStream;
/**
* A constructor that inherits from Stream and emits data from the given
* `source`. If it's a Stream it will be piped through to this stream.
* Otherwise, it should be a string or a Buffer which will be emitted by this
* stream as soon as possible.
⨀_⨀
⨂_⨂
(/◔ ◡ ◔)/
°ﺑ°
(¬_¬)
(´・ω・`)
(ʘ_ʘ)
(ʘ‿ʘ)
(๏̯͡๏ )
(◕_◕)
var abs = Math.abs;
var sqrt = Math.sqrt;
var floor = Math.floor;
var min = Math.min;
var V3 = function(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
}