Skip to content

Instantly share code, notes, and snippets.

@nxn
nxn / queue.js
Last active December 17, 2015 15:29
var exports = exports || { };
(function(ns) {
ns.createQueue = function(opts) {
var maxSize;
if (opts && typeof opts.maxSize === 'number') {
maxSize = opts.maxSize;
}
var A = function(name) {
this.name = name;
};
A.prototype.print = function() {
console.log(this.name);
}
/*
var init = function(c) {
/* Found in one of router's HTML files */
function encrypt(str)
{
var result = "";
var escaped;
escaped = escape(str);
for(i = 0; i < escaped.length; i++)
result += escaped.charCodeAt(i) - 23;
@nxn
nxn / SimpleRL.fs
Created October 24, 2011 02:22
SimpleRL
module SimpleRL
open System
let world =
[|
"#### ####"
"# #### #"
"# #"
"## ##"
" # # "
@nxn
nxn / promise.js
Created September 16, 2011 15:26
promise.js
var Async = {};
(function() {
// Constructor
this.makePromise = function(config) {
var Promise = { operation: config.operation
, args: config.args
, context: config.context
, then: then
};
@nxn
nxn / closureInheritTest.js
Created March 19, 2011 05:47
Test of whether this actually shares the methods.
var closureObj = {};
(function() {
var one = function() {
console.log("One");
};
var two = function() {
console.log("Two");
};
var three = function() {
console.log("Three");