Skip to content

Instantly share code, notes, and snippets.

View tjvr's full-sized avatar

Tim Radvan tjvr

View GitHub Profile
@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")
@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 / 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));;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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": [
@tjvr
tjvr / details.txt
Last active August 29, 2015 14:21
No comment
?|..| imports standard library
---------------------------------------------------------
% zero
?… import library named …
…$… define export named string … with value …
can't export digit as logical value
@tjvr
tjvr / chocpi.ipynb
Last active October 31, 2015 15:27
chocpi.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tjvr
tjvr / reasons.md
Last active February 17, 2016 22:00
National Rail Enquiries Data

Late Running Reasons

  • 100: This train has been cancelled because of a broken down train
  • 101: This train has been cancelled because of a delay on a previous journey
  • 102: This train has been cancelled because of a derailed train
  • 104: This train has been cancelled because of a fire at a station
  • 105: This train has been cancelled because of a fire at a station earlier
  • 106: This train has been cancelled because of a landslip
  • 107: This train has been cancelled because of a line-side fire
@tjvr
tjvr / redirect.py
Created June 21, 2016 13:57
s2forums mitmproxy
import os
from mitmproxy.models import HTTPResponse, decoded
from mitmproxy.script import concurrent
from netlib.http import Headers
target = 'scratch.mit.edu'
target_cdn = 'cdn.scratch.mit.edu'
@tjvr
tjvr / blocks.ipynb
Last active November 3, 2016 10:49
all the workarounds
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.