Skip to content

Instantly share code, notes, and snippets.

(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){
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;
function ScoreNetwork(score)
{
this.ws = null;
this.data = null;
this.score = score;
this.initialize = function()
{
this.ws = new WebSocket('ws://localhost:7000');
var bar = function() {
this._baz = function() {
return this.value;
};
};
bar.prototype = (function() {
var i_am_private = 2;
@tmpvar
tmpvar / client.js
Created March 17, 2010 19:17 — forked from felixge/client.js
no segfault, 64510 connections
var
PARALLEL_CONNECTS = 10,
http = require('http'),
sys = require('sys'),
connectionCount = 0,
messageCount = 0;
lastMessages = 0;
function addClient() {
@tmpvar
tmpvar / promise.js
Created February 21, 2010 21:42 — forked from ry/promise.js
promises!
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);
(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.