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
(function (exports) { | |
// because the anonymous function is being called without a scope being set, | |
// "this" will refer to the global scope. In a browser, that's the window, but | |
// will be "undefined" in strict mode. In other JS platforms, it may be some | |
// other thing. | |
// my code here. | |
// don't make accidental globals. | |
// hang a small number of things on the "exports" object. |
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 events = require('events'); | |
exports.Promise = function () { | |
exports.EventEmitter.call(this); | |
this._blocking = false; | |
this.hasFired = false; | |
this._values = undefined; | |
}; | |
process.inherits(exports.Promise, events.EventEmitter); |
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 | |
PARALLEL_CONNECTS = 10, | |
http = require('http'), | |
sys = require('sys'), | |
connectionCount = 0, | |
messageCount = 0; | |
lastMessages = 0; | |
function addClient() { |
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 bar = function() { | |
this._baz = function() { | |
return this.value; | |
}; | |
}; | |
bar.prototype = (function() { | |
var i_am_private = 2; |
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
function ScoreNetwork(score) | |
{ | |
this.ws = null; | |
this.data = null; | |
this.score = score; | |
this.initialize = function() | |
{ | |
this.ws = new WebSocket('ws://localhost:7000'); |
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('./lib/jsdom/lib/level1/core').dom.level1.core, | |
fs = require("fs"), | |
haml = require('./lib/haml-js/lib/haml') | |
windower = require("./lib/jsdom/lib/browser"); | |
exports.toJUP = function(template) { | |
template = haml.render(template); | |
var window = windower.windowAugmentation(dom); | |
var document = window.document; |
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
(function( window, undefined ) { | |
var JUP = {}; | |
// Define a local copy of parseDOM JUP | |
JUP.parseDOM = function(items, ARR){ | |
if(typeof ARR == 'undefined'){ | |
var ARR = []; | |
} | |
window.jQuery(items).each(function(i,e){ |
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 === '<') { |
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 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>"; |
OlderNewer