Skip to content

Instantly share code, notes, and snippets.

@Maxdamantus
Maxdamantus / gist:1393215
Created November 25, 2011 10:27
Non-leaky implementation of Crockford's make_sealer
function make_sealer(){
var cur = null, ret;
return {
sealer: function write(value){
return function f(){
if(f === cur)
ret = value;
};
},
@Maxdamantus
Maxdamantus / AltTest.b
Created July 23, 2011 05:49
jsdis; Dis Virtual Machine implemented in JavaScript .. moved to https://github.com/Maxdamantus/jsdis
implement AltTest;
include "sys.m";
include "draw.m";
AltTest: module {
init: fn(c: ref Draw->Context, a: list of string);
};
sys: Sys;
@Maxdamantus
Maxdamantus / README
Created May 11, 2011 03:09
XJS thing from a while ago
XJS - JavaScript (SpiderMonkey) plugin for XChat, by Maxdamantus
http://ntus.uni.cc/xjs
http://ntus.uni.cc/xjs/xjs-8.c
== Description ==
This is a fairly simple extension, which allows for JavaScript scripts and code
to be used in XChat. The /js command usage:
@Maxdamantus
Maxdamantus / d2q.c
Created May 6, 2011 23:04
Type in Dvorak on a QWERTY-configured Windows.
/*
* cc d2q.c -o d2q.exe -Wl,-subsystem,windows
*/
#include <windows.h>
int mapping;
int remap(int o){
return
function extend(from, to){
var x, r = Object.create(from);
for(x in to)
r[x] = to[x];
return r;
}
function Mage(name) {
this.name = name;