Skip to content

Instantly share code, notes, and snippets.

@danshearmur
danshearmur / README.md
Last active April 25, 2016 07:08
Hack Assembler

Hack Assembler

To run:

npm install
node index.js ./path/to/File.asm ./path/to/Output.hack
node_modules
(function () {
if (window.navigator.sendBeacon || !window.localStorage) return;
var TO_S = Object.prototype.toString;
var TYPE_RE = /\[object ([a-zA-Z0-9]*)\]/;
var LS_PFX = 'beaconfill-';
var LIMIT = 64 * 1024;
var WAIT = 1500;
var MAX_RETRIES = 3;
<!doctype html>
<script>
var cache = {};
function define(thing, fn) {
cache[thing] = fn;
}
// super naive get xhr/promise implementation only tested in chrome
function req(url) {
var x = new XMLHttpRequest();
var success;
var done;
x.onreadystatechange = function () {
if (x.readyState === 4) {
done = JSON.parse(x.responseText);
if (typeof success === 'function') success(done);
package main
import (
"io"
"io/ioutil"
"net/http"
"os"
"strings"
)
  • wcd
  • karma-android-launcher
  • blog
  • links
  • music
git-sed () {
git grep -l "$1" | xargs sed -i "" "s/$1/$2/g"
}
@danshearmur
danshearmur / dependency-injection.js
Last active December 30, 2015 03:29
Simple dependency injection (requires ES5 support)
'use strict';
var inject;
var specify;
(function (root) {
var depList = {};
var things = {};
@danshearmur
danshearmur / .gitignore
Last active December 30, 2015 03:19
Test domain length with gzip
*html*