Skip to content

Instantly share code, notes, and snippets.

View rrthomas's full-sized avatar

Reuben Thomas rrthomas

View GitHub Profile
'''https://en.wikipedia.org/wiki/Brainfuck#Commands'''
import sys, mit
mit.State().globalize(globals())
def ass_inc(): ass(LIT_1); ass(ADD)
def ass_dec(): ass(LIT_1); ass(NEGATE); ass(ADD)
def ass_dup(): ass(LIT_0); ass(DUP);
def ass_over(): ass(LIT_1); ass(DUP);
def ass_loadb(): ass(LIT_0); ass(LOAD);

Keybase proof

I hereby claim:

  • I am rrthomas on github.
  • I am rrt (https://keybase.io/rrt) on keybase.
  • I have a public key whose fingerprint is 2409 3F01 6FFE 8602 EF44 9BB8 4C8E F3DA 3FD3 7230

To claim this, I am signing this object:

@rrthomas
rrthomas / gist:7837e2bd90de80f2ca6b
Created September 19, 2014 12:09
PEG.js for numeric part of Metapolator's formula language
/*
* Parser for Metapolator CPS formula language
*/
{
var unaryOperators = {
'-': 'negate'
};
function $_(operator, right) {
@rrthomas
rrthomas / structure.js.diff
Created September 15, 2014 22:41
Show where things go wrong
--- structure-orig.js 2014-09-15 23:38:55.631539473 +0100
+++ structure.js 2014-09-15 23:39:18.012519232 +0100
@@ -72,241 +72,243 @@
]
}
]
- }
- },
- {
- name: "master 2",
@rrthomas
rrthomas / structure.js
Last active August 29, 2015 14:06
Fixed up to be syntactically correct
app.controller("MetapolatorController", function($scope) {
$scope.project = {
projectName: "untitled document",
display: {
mode: ["glyphview", "paragraph", "", ""],
fontsize: 40,
lineHeight: 36
},
parameters: [
{
@rrthomas
rrthomas / Userscript to add Roman numerals to Facebook
Created September 6, 2013 12:58
A userscript for Greasemonkey to add Roman numerals to Facebook, intended for Latin users
// ==UserScript==
// @name Roman numerals for Facebook
// @namespace http://userscripts.org
// @description Convert numbers on Facebook to Roman numerals (for Latin language setting)
// @include http*://*facebook.com/*
// @grant none
// @version 1
// ==/UserScript==
// Tweaked from http://stackoverflow.com/questions/9083037/convert-a-number-into-a-roman-numeral-in-javascript
@rrthomas
rrthomas / ggo-mode.el
Last active December 17, 2015 14:49 — forked from mkjunker/ggo-mode.el
;;; ggo-mode.el --- Gengetopt major mode
;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2013
;; Matthew K. Junker
;; Author: Matthew K. Junker <junker@alum.mit.edu>
;; Package-Version: 20130521
;; Keywords: extensions, convenience, local
;; This file is free software; you can redistribute it and/or modify