Skip to content

Instantly share code, notes, and snippets.

View tjvr's full-sized avatar

Tim Radvan tjvr

View GitHub Profile
@tjvr
tjvr / gist:0cccd5f8d97770f784bf
Created May 10, 2015 00:52
kurt-define-block.ipynb
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tjvr
tjvr / thingsinboxes.ml
Last active August 29, 2015 14:20
Things in boxes
fun boxes = [0, 0, 0, 0];;
fun allcons x [] = []
| allcons x (l :: ll) =
(x :: l) :: (allcons x ll) ;;
fun arrange 0 l = [l]
| arrange n [] = []
| arrange n (x::l) =
(arrange (n-1) ((x+1) :: l)) @ (allcons x (arrange n l));;
@tjvr
tjvr / __init__.py
Created April 10, 2015 19:17
Lately: an Earley parser in Python 3
import itertools
import regex
# Lexer results
class Token:
def __init__(self, kind, value=None):
self.kind = kind
@tjvr
tjvr / s2.py
Last active August 29, 2015 13:56 — forked from hyperobject/s2.py
from __future__ import division
from myro import *
import blockext
from blockext import *
@command("stop both motors")