Skip to content

Instantly share code, notes, and snippets.

View aredridel's full-sized avatar
💭
See my social media for status.

Aria Stewart aredridel

💭
See my social media for status.
View GitHub Profile
@tj
tj / struct.js
Created June 23, 2011 17:43
idea for someone who wants to play with node-ctype
// construct an object
// that will work with
// node-ctype from a c struct string:
var struct = new Struct('struct { int8_t r, g, b; }');
var rgb = struct.parse(buf);
console.log(rgb.r, rgb.b, rgb.b);
require.extensions[".json"] = function (module, filename) {
module.exports = JSON.parse(require("fs").readFileSync(filename, "utf8"))
}