Skip to content

Instantly share code, notes, and snippets.

View tjvr's full-sized avatar

Tim Radvan tjvr

View GitHub Profile
@tjvr
tjvr / tosh.ne
Last active February 16, 2017 15:38
tosh for nearley
line -> thing {% id %}
thing -> block {% id %}
| r_parens {% id %}
| b_parens {% id %}
n -> n4 {% id %}
@tjvr
tjvr / binaryen.rb
Last active January 31, 2017 23:12
Homebrew formula for Binaryen
class Binaryen < Formula
desc "Compiler infrastructure and toolchain library for WebAssembly, in C++"
homepage "https://github.com/WebAssembly/binaryen"
url "https://github.com/WebAssembly/binaryen/archive/version_26.tar.gz"
head "https://github.com/WebAssembly/binaryen.git"
version "26"
sha256 "e78ff7ea4dbffa0d53084a0bc1ec8ed43445b674a02c17af798f3c0df13d418d"
depends_on "cmake" => :build
@tjvr
tjvr / wabt.rb
Last active January 31, 2017 23:12
Homebrew formula for WebAssembly Binary Toolkit
class Wabt < Formula
desc "The WebAssembly Binary Toolkit"
homepage "https://github.com/WebAssembly/wabt"
head "https://github.com/WebAssembly/wabt.git"
#url "https://github.com/WebAssembly/wabt/archive/binary_0xc.tar.gz"
sha256 "0ee56305b232d2a07aebd18afd0861ba39941d137ebf2ce2d57395a1bcd82940"
depends_on "cmake" => :build
def install
@tjvr
tjvr / rheapq.py
Created December 29, 2016 15:23
heap-based priority queue from Python stdlib, modified to run on RPython
# -*- coding: latin-1 -*-
"""Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usage:
@tjvr
tjvr / nginx.conf
Last active September 10, 2019 08:31
nginx cors proxy
server {
listen 80;
server_name cors.tjvr.org;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 1m;
client_body_buffer_size 64k;
@tjvr
tjvr / blocks.ipynb
Last active November 3, 2016 10:49
all the workarounds
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / 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 / chocpi.ipynb
Last active October 31, 2015 15:27
chocpi.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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