Skip to content

Instantly share code, notes, and snippets.

View pete-otaqui's full-sized avatar

Pete Otaqui pete-otaqui

View GitHub Profile
@pete-otaqui
pete-otaqui / app.js
Created September 9, 2010 04:32
Example node event emitter setup from neveraw.us
var pb = new PhoneBook('asdf.txt');
pb.on('error', function(error) {
console.log(error);
});
pb.on('data', function(data) {
console.log(data);
});
{
"namespaces" : {
"glow" : {
"namespaces" : {
"dom" : {
"classes" : {
"NodeList" : {
"constructor" : {
"methods" : {
"aStaticMethod" : {
#!/usr/bin/node
var fs = require('fs');
var sys = require('sys');
var schema = fs.readFileSync(process.argv[2], 'utf8');
var json = fs.readFileSync(process.argv[3], 'utf8');
schema = JSON.parse(schema);
{
"description" : "A schema describing API docs. Top-level object is the top level anonymous namespace",
"extends" : [ { "$ref" : "#.defs.namespace" } ],
"properties" : {
"typedefs" : {
"type" : "object",
"optional" : true,
"additionalProperties" : { "$ref" : "#.defs.typedef" }
}
},
@pete-otaqui
pete-otaqui / StandardSpider.rb
Created February 16, 2010 09:09
Prototype spider which uses 'bbc_standards' to test a whole website
# Prototype spider which uses 'bbc_standards' to test a whole website
require 'rubygems'
require 'anemone'
require 'bbc_standards'
require 'term/ansicolor'
class String
include Term::ANSIColor
end