Skip to content

Instantly share code, notes, and snippets.

meisterluk / rpi_sensehat_fireworks.lua
Last active Jan 3, 2021
Creating a firework with the Raspberry Pi 3 Model B Sense HAT 8×8 LED matrix and Lua 5.3
View rpi_sensehat_fireworks.lua
-- load pixels.lua (attached as part of this gist)
package.path = package.path .. ';?.lua'
local hat = require('rpi_sensehat_pixels')
-- a generic color table
local colortable = {
[0] = '0000FF',
[1] = '00FF00',
[2] = 'FF0000',
[3] = '1354AA',
meisterluk / rpi_sensehat_pixels.lua
Last active Aug 16, 2020
Controlling the Raspberry Pi 3 Model B Sense HAT 8×8 LED matrix from Lua 5.3
View rpi_sensehat_pixels.lua
local M = {_TYPE='module', _NAME='sensehat_pixels', _VERSION='0.0.1'}
-- Sleep this thread
function sleep(n)
io.popen("sleep " .. tostring(n)):read()
-- Split a string into lines
function lines(str)
local t = {}
meisterluk / tex-loop.tex
Created Feb 24, 2020
A looping device in plain Teχ
View tex-loop.tex
% Input: we define \loop to print some text the number of given times
\long\def\loop#1 for #2 times{
\ifnum\c>0 %
\advance\c by -1%
meisterluk / gsub-tests.lua
Created Sep 9, 2019
lua string.gsub test extracted from the official lua testsuite
View gsub-tests.lua
local tests = {
["gsub"] = string.gsub,
["testID"] = 0
function tests.assert(self, cond, identifier)
self.testID = self.testID + 1
assert(cond, "test #" .. tostring(self.testID) .. " (" .. tostring(identifier) .. " test) failed")
meisterluk /
Created Sep 4, 2019
Implement pattern matching based function dispatching (as in Erlang) in Python using decorators
import logging
Erlang equivalent:
fact(N) when N>0 -> % first clause head
N * fact(N-1); % first clause body
meisterluk / Dockerfile
Last active Jul 26, 2019
Get pretalx 1.0.3 run in one development docker container
View Dockerfile
FROM debian:buster-20190708
RUN apt-get update && apt-get upgrade
RUN apt install -y python3-pip nginx postgresql redis sudo
RUN adduser root sudo
# corresponds to “Step 0: Prerequisites”
RUN adduser pretalx --disabled-password --home /var/pretalx --system --gecos 'pretalx user account'
# corresponds to “adduser pretalx --disabled-password --home /var/pretalx” of “Step 1: Unix user“
meisterluk / mandelbrot.go
Created Nov 18, 2018
Mandelbrot in Golang (as PNG) based on @benhoyt's mandel.awk
View mandelbrot.go
package main
import (
meisterluk /
Created Mar 18, 2018
Inkscape layer name to SVG object ID
#!/usr/bin/env python3
Inkscape Layer to Object-ID
Inkscape represents layers as SVG `g` elements annotated with metadata like layer name.
This script takes an SVG file and returns a JSON map of layer names to object IDs.
If you supply CLI option `-l`, you can retrieve the object ID of an individual layer.
meisterluk /
Created Sep 30, 2017
Keybase verification

Keybase proof

I hereby claim:

  • I am meisterluk on github.
  • I am meisterluk ( on keybase.
  • I have a public key whose fingerprint is BD7A B386 4B41 6535 AE94 4A99 2385 2865 9B54 D95F

To claim this, I am signing this object:

#!/usr/bin/perl -w
=encoding utf8
=head1 NAME
partner - partner pages for GDI course at TUGraz.