Skip to content

Instantly share code, notes, and snippets.

@mrfabbri
mrfabbri / evilevalworker.html
Created September 19, 2010 19:07
A web worker used to offload evaluation (by means of an "evil eval") of some JavaScript code written inside the browser. A very quick and dirty hack.
<html>
<head>
<title>
</title>
<style>
#input-area{
width: 400px;
height: 400px;
margin: 10px;
}
@mrfabbri
mrfabbri / greet-xmas.sh
Created December 25, 2010 15:58
A nerdy Christmas greeting script [original post: http://questionmark.blogsome.com/2008/12/24/nerdy-christmas-take-2/ ]
#!/bin/bash
#lights_off
#
# *==<
# /\
# / \
# / @ \
# / \
# / @ @ \
@mrfabbri
mrfabbri / app.js
Created February 4, 2015 23:19
App wide shortcuts in NW.js in "userland" [PoC]
"use strict";
var gui = require("nw.gui");
var AppShortcut = require("./appshortcut")(gui).AppShortcut;
var keycode = require('keycode');
var win = gui.Window.get();
if (process.platform === "darwin") {
var nativeMenuBar = new gui.Menu({type: "menubar"});
Verifying that +mrfabbri is my blockchain ID. https://onename.com/mrfabbri
@mrfabbri
mrfabbri / hashmap.sml
Created November 3, 2014 00:05
A minimal HashMap implementation in SML
signature HASH_MAP =
sig
type 'a hashVector
type ('a, 'b) hashMap
val makeEmpty : (('a -> int) * ('a * 'a -> bool) * int) -> ('a, 'b) hashMap
val lookup : ('a, 'b) hashMap -> 'a -> 'b option
val insert : ('a, 'b) hashMap -> 'a * 'b -> unit
val remove : ('a, 'b) hashMap -> 'a -> unit
val load : ('a, 'b) hashMap -> int
end