Skip to content

Instantly share code, notes, and snippets.

Avatar
💯
100% busy shooting lecture videos...

Torsten Grust Teggy

💯
100% busy shooting lecture videos...
View GitHub Profile
View type-wildcard.sql
-- A custom base type 'wildcard' that returns true on < comparisons,
-- no matter what. Otherwise acts like a 4-byte integer.
DROP TYPE IF EXISTS wildcard CASCADE;
CREATE TYPE wildcard;
CREATE FUNCTION wildcard_in(s cstring) RETURNS wildcard
LANGUAGE internal IMMUTABLE AS 'int4in';
CREATE FUNCTION wildcard_out(d wildcard) RETURNS cstring
LANGUAGE internal IMMUTABLE AS 'int4out';
@Teggy
Teggy / bricks.alg
Last active Jan 17, 2020
U Tübingen LEGO database in RelaX format
View bricks.alg
group: LEGO database
description[[The U Tübingen LEGO database]]
bricks = { piece:string, type:string, name:string, cat:number, weight:number, img:string, x:number, y:number, z:number
"87749","B","Lower Body with Tentacles","20","4.07","http://www.bricklink.com/PL/87749",NULL,NULL,NULL
"wampa","B","Wampa, Complete Assembly","147","31.33","http://www.bricklink.com/PL/wampa",NULL,NULL,NULL
"90981","B","Spider Web, Hanging","86","1.51","http://www.bricklink.com/PL/90981",NULL,NULL,NULL
}
@Teggy
Teggy / NaSchl.sql
Last active Feb 18, 2019
Traffic flow simulation based on a simple cellular automaton
View NaSchl.sql
-- Traffic flow simulation based on a simple cellular automaton
--
-- Based on a 1992 model by Kai Nagel and Michael Schreckenberg (NaSch),
-- also see:
-- http://www.christophschuette.com/blog/?p=50
-- http://www.thp.uni-koeln.de/~as/Mypage/traffic.html
-- Car model:
-- - ID: c
-- - position: x
View tuppers-formula.sql
-- Tupper's self-referential formula
--
-- Plot points x ∈ [0,106), y ∈ [k, k+17) for which
-- ½ < ⌊mod(⌊y/17⌋ × 2^(-17 × ⌊x⌋ - mod(⌊y⌋, 17), 2)⌋
-- holds.
--
-- The plotted image contains a representation of the formula itself:
--
-- █ █ █ ██ █ █ █ █ █ █ █ ██ █ █ █
-- █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █
@Teggy
Teggy / diagram-vs-Unicode.md.html
Created May 23, 2017
Unicode characters beyond the BMP confuse Markdeep's diagrams
View diagram-vs-Unicode.md.html
The bold capital Sigma (U+1D6BA) in the diagram below will not
be rendered. Since it occupies two indices in the extracted
diagram string, grid width computation is off by one (see the
spurious `*` rendered in the resulting document):
*******
* x𝚺x *
* xxx *
*******
@Teggy
Teggy / regression.md.html
Created May 12, 2017
SVG regression in Markdeep v0.19?
View regression.md.html
************
* o *
* / *
* / *
* o *
************
@Teggy
Teggy / four-solutions-to-a-trivial-problem.hs
Last active Dec 1, 2019
A Haskell "transcript" of Guy Steele's talk "Four Solutions to a Trivial Problem" (https://www.youtube.com/watch?v=ftcIcn8AmSY)
View four-solutions-to-a-trivial-problem.hs
{-# LANGUAGE TypeSynonymInstances #-}
import Data.Monoid
import Data.Maybe
-- How much water does a "histogram" hold?
--
-- Inspired by Guy Steele's talk "Four Solutions to a Trivial Problem"
-- https://www.youtube.com/watch?v=ftcIcn8AmSY
View keybase.md

Keybase proof

I hereby claim:

  • I am Teggy on github.
  • I am teggy (https://keybase.io/teggy) on keybase.
  • I have a public key whose fingerprint is A3B0 BC48 CA26 C3C1 0666 2837 E60A A49E 46AF 1FDF

To claim this, I am signing this object:

@Teggy
Teggy / init.js
Created Oct 9, 2012
Live LaTeX previewing with Chocolat and Skim.app
View init.js
/*!
* Experimental Chocolat mixins
* Copyright(c) 2012 Torsten Grust <torsten.grust@gmail.com>
*/
var fs = require('fs');
var path = require('path');
var spawn = require('child_process').spawn;
var flashLaTeX = require('./tex.js').flashLaTeX;
@Teggy
Teggy / Chocolat-1.3.2-crash-report
Created Oct 9, 2012
Chocolat 1.3.2 Crash Report. These happen frequently (a dozen times) a day and turn out to be a real show-stopper.
View Chocolat-1.3.2-crash-report
Process: Chocolat [21406]
Path: /Applications/Chocolat.app/Contents/MacOS/Chocolat
Identifier: com.chocolatapp.Chocolat
Version: 1.3.2 (1.3.2)
Code Type: X86-64 (Native)
Parent Process: launchd [154]
User ID: 501
Date/Time: 2012-10-09 11:42:33.565 +0200
OS Version: Mac OS X 10.8.2 (12C60)