Skip to content

Instantly share code, notes, and snippets.

Erik Terpstra eterps

Block or report user

Report or block eterps

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
eterps / app.js
Created Jul 19, 2019 — forked from dergachev/app.js
Manual JS prettification of See
View app.js
function toId(t) {
return t.toLowerCase().replace(/[^a-z]/gi, "-").replace(/-+/gi, "-")
function toc() {
var t = $("#sidebar").html("");
$("h1,h2,h3").each(function() {
var e = $(this).clone(), n = $(this).offset().top;
"#" != e.html() && ("h3") && e.html("‐ " + e.html()), t.append(e), e.on("click", function() {
$("body").animate({scrollTop: n}, 200)
View do_sequentially.nim
# Currently doesn't work
import macros
macro do_sequentially(idx: int, statements: varargs[untyped]): untyped =
result = nnkStmtList.newTree()
do: echo "Foo"
do: echo "Bar"
View oberon0_fragment.ohm
Oberon0 {
Module = "MODULE" ident ";" "BEGIN" StatSeq "END" ident "."
StatSeq = statement (";" statement)*
statement = procedureCall?
procedureCall = ident (actualParameters | "*")?
actualParameters = "(" integer ("," integer)* ")"
integer = digit+
ident = letter alnum*
View io.mod
MODULE IO; (*for Oberon0 NW 29.4.2017*)
IMPORT Texts,Oberon;
VAR S: Texts.Scanner; W: Texts.Writer;
BEGIN Texts.OpenScanner(S, Oberon.Par.text, Oberon.Par.pos); Texts.Scan(S)
END OpenInput;
BEGIN x := S.i; Texts.Scan(S)
eterps /
Created Apr 19, 2019
ReasonML equality
type customerId =
| CustomerId(int);
type orderId =
| OrderId(int);
let cid = CustomerId(42);
let oid = OrderId(42);
cid == oid;
View Samsung Smart-TV Blocklist Adlist (for PiHole)
# This is a blocklist to block samsung smart tv's sending meta data at home.
# Please help to collect domains!
# It could be that the TV does not receive any more updates or other services no longer work. Please report such an incident.
eterps / setup_sway
Created Dec 7, 2018
Install Sway (a tiling Wayland compositor) on Ubuntu
View setup_sway
set -e
# Based on:
mkdir /tmp/setup_sway
cd /tmp/setup_sway
# === Helpers ===
fn main() {
let add1 = |x| x + 1; // signature is: fn(T) -> T
let add = |x, y| x + y; // signature is: fn(T, T) -> T
println!("{}", add1(2));
println!("{}", add(2, 3));
View typescript_equality.ts
type CustomerId = number
type OrderId = number
let customerId: CustomerId
let orderId: OrderId
customerId = 42
orderId = 42
if (customerId == orderId) {
set -e
cat >fpstest.obn <<EOS
MODULE fpstest;
(*draw dots and print the number of displayed frames per second*)
IMPORT Input, Out, XYplane;
You can’t perform that action at this time.