This file contains hidden or 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
http = require 'http' | |
flow = require('../lib/conductor').conductor() | |
#nodes | |
flow.build('port', () -> 8000) | |
('listener', (port, request, response) -> | |
server= http.createServer (req, res) -> | |
request(req) if request | |
response(res) if response | |
server.listen port) |
This file contains hidden or 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
http = require 'http' | |
flow = require('../lib/conductor').conductor() | |
#nodes | |
port= flow.node('port', () -> 8000) | |
.node('listener', (port, request, response) -> | |
server= http.createServer (req, res) -> | |
request(req) if request | |
response(res) if response | |
server.listen port) |
This file contains hidden or 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
http = require 'http' | |
flow = require('../lib/conductor').conductor() | |
#nodes | |
port= flow.node 'port', () -> 8000 | |
listener= flow.node 'listener', (port, request, response) -> | |
server= http.createServer (req, res) -> | |
request(req) if request | |
response(res) if response |
This file contains hidden or 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
//Attach me to Node.prototype as well | |
var DOCUMENT_POSITION_DISCONNECTED = Node.prototype.DOCUMENT_POSITION_DISCONNECTED = 0x01 | |
var DOCUMENT_POSITION_PRECEDING = Node.prototype.DOCUMENT_POSITION_PRECEDING = 0x02 | |
var DOCUMENT_POSITION_FOLLOWING = Node.prototype.DOCUMENT_POSITION_FOLLOWING = 0x04 | |
var DOCUMENT_POSITION_CONTAINS = Node.prototype.DOCUMENT_POSITION_CONTAINS = 0x08 | |
var DOCUMENT_POSITION_CONTAINED_BY = Node.prototype.DOCUMENT_POSITION_CONTAINED_BY = 0x10 | |
Node.prototype.compareDocumentPosition = function compareDocumentPosition( otherNode ) { | |
if( !(otherNode instanceof Node) ) { | |
throw Error("Comparing position against non-Node values is not allowed") |
This file contains hidden or 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 controllers = {}; | |
fs.readdir(__dirname + '/controllers', function(err, files){ | |
if (err) throw err; | |
files.forEach(function(file){ | |
var controller = file.replace('.js',''); | |
controllers[controller] = require('./controllers/' + controller); | |
}); | |
}); |
This file contains hidden or 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
" File: commonjs-package-json | |
" Author: Ash Berlin <[email protected]> | |
" Last Change: 23-Feb-2010. | |
" Version: 1.1 | |
" Usage: | |
" | |
" Use by placing something like the following in your .vimrc: | |
" | |
" let g:maintainer='{ "name": "Ash Berlin", "web": "http://ashberlin.com" }' | |
" |
This file contains hidden or 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
DEST_OS: linux | |
DEST_CPU: x86_64 | |
Parallel Jobs: 1 | |
/usr/lib64/ccache/gcc -rdynamic -D_GNU_SOURCE -DHAVE_CONFIG_H=1 -DEV_MULTIPLICITY=0 -pthread -DX_STACKSIZE=65536 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPLATFORM=linux -DNDEBUG -g -O3 -Idefault/deps/libeio -I../deps/libeio -Idefault -I.. ../deps/libeio/eio.c -c -o default/deps/libeio/eio_1.o | |
/usr/lib64/ccache/gcc -rdynamic -D_GNU_SOURCE -DHAVE_CONFIG_H=1 -DEV_MULTIPLICITY=0 -pthread -DX_STACKSIZE=65536 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPLATFORM=linux -DNDEBUG -g -O3 -Idefault/deps/libev -I../deps/libev -Idefault -I.. ../deps/libev/ev.c -c -o default/deps/libev/ev_1.o | |
/usr/lib64/ccache/gcc -rdynamic -D_GNU_SOURCE -DHAVE_CONFIG_H=1 -DEV_MULTIPLICITY=0 -pthread -DX_STACKSIZE=65536 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPLATFORM=linux -DNDEBUG -g -O3 -Idefault/deps/c-ares -I../deps/c-ares -Idefault/deps/c-ares/linux-x86_64 -I../deps/c-ares/linux-x86_64 ../deps/c-ares/ares_strcasecmp.c -c -o default/deps/c-ares/ares_strcasecmp_1.o | |
/usr/lib64/cc |
This file contains hidden or 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 sys = require("sys"), | |
dom = require("jsdom/lib/level1/core").dom.level1.core, | |
fs = require("fs"), | |
sax = require("jsdom/example/sizzle/sax"), | |
document = require("jsdom/lib/browser").windowAugmentation(dom, {parser: sax.parser()}).document, | |
div = document.createElement('div'); | |
document.body.appendChild(div); | |
div.innerHTML = "<span><img src='test' />foo<br /> bar<br /> </span><p><script>alert('test');\n\nconsole.log();</script>ting</p>"; |
This file contains hidden or 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
/******************************* | |
JSONloops is a javascript audio sequencer that runs on JSON arrays of sounds | |
JSONloops are nested arrays that contain: a nested array, a sound, or null | |
the arrays are nested in the following hierarchy | |
* SONG | |
* TRACKS | |
* MEASURES |
This file contains hidden or 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 text = '<div><div class="container" >asd<div fuck="cakes" class="left column"><div id="date"></div><div id="address"></div></div><div class="right column"><div id="email"></div></div></div></div>'; | |
var intag = false, tmpbuf = "", endtag = false, abspos = 0; | |
function parse(html, pos, lvl) { | |
var level = lvl || 0, current = level, ret = [], i=abspos, origpos = abspos; | |
for (i; i<html.length; i+=1) { | |
abspos = i; | |
var char = html[i]; | |
if (char === '<') { |