Skip to content

Instantly share code, notes, and snippets.

@mattroseman
mattroseman / radix.js
Created February 6, 2020 02:05
Radix Tree implementation in JavaScript
const util = require('util');
const setImmediatePromise = util.promisify(setImmediate);
class RadixNode {
constructor(edgeLabel, isWord=false) {
this.edgeLabel = edgeLabel;
this.children = {};
this.isWord = isWord;
}
@rain-1
rain-1 / dcs.rkt
Last active September 22, 2023 21:13
Dotted Canonical S-expressions - DCSexps
#lang racket
;; printing s-exps as DCS and TDCS, plus examples of what DCS and TDCS look like
(define (dcs l)
(cond ((pair? l)
(begin
(display ".")
(dcs (car l))
(dcs (cdr l))))
@tylorr
tylorr / bubblebabble.js
Last active March 26, 2016 20:52
Toying with BubbleBabble
var map_index = function(memo, letter, index) {
memo[letter] = index;
return memo;
};
var vowels = 'aeiouy';
var vowel_map = vowels.split('').reduce(map_index, {});
var consonants = 'bcdfghklmnprstvzx';
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@Deco
Deco / coroutine_scheduler.lua
Created February 13, 2012 16:38
Lua Coroutine Scheduler
pcall(require,"socket")
local coroutine_scheduler = {
_NAME = "coroutine_scheduler.lua"
_VERSION = "1.0.0",
}
local Scheduler
do Scheduler = setmetatable({}, {
__call = function(class)