Skip to content

Instantly share code, notes, and snippets.

View chrisma's full-sized avatar

Christoph Matthies chrisma

View GitHub Profile
chrisma /
Created February 22, 2022 18:17
Show manpage in Preview
man -t bash | open -f -a Preview
chrisma /
Last active January 28, 2022 19:34
sum and count columns from stdin, because I'm no good at awk
import sys
d = {}
for line in sys.stdin:
adds, dels, path = line.rstrip().split('\t')
if path in d:
d[path]['adds'] += int(adds)
d[path]['dels'] += int(dels)
d[path]['count'] += 1
chrisma /
Created June 4, 2021 09:44 — forked from drozzy/
FMC ( compositional and dynamic elements libraries


This is just some stencils I created for myself to draw FMC ( diagrams with

Here is how they look:



chrisma / GetNameAndTitleOfActiveWindow.scpt
Created May 20, 2021 08:21 — forked from timpulver/GetNameAndTitleOfActiveWindow.scpt
[AppleScript] Get Name of active window | Returns the name / title of the active (frontmost) window
# taken from user Albert's answer on StackOverflow
# tested on Mac OS X 10.7.5
global frontApp, frontAppName, windowTitle
set windowTitle to ""
tell application "System Events"
set frontApp to first application process whose frontmost is true
set frontAppName to name of frontApp
chrisma /
Last active April 20, 2020 15:29
Get BibTeX entry from
wget -qO- --header="Accept: application/x-bibtex" ""
chrisma /
Last active March 10, 2020 12:16
Coding exercise
#!/usr/bin/env python3
# In this bonus challenge, you'll need to check the winner of the battle but this time, a sorcerer wins if he succeeds in winning 3 spell clashes in a row.
# 1. Create variables POWER, gandalf and saruman as seen above.
# spells have names, dictionary that associates that name to a power.
'Fireball': 50,
chrisma /
Created March 6, 2019 15:05
Minify .bib files to contain only references cited in a paper. Remove abstracts.
bibexport -o extracted.bib main.aux
echo "delete.field = { abstract }" > remove-abs.rsc && bibtool -r remove-abs.rsc extracted.bib -o minified.bib
chrisma / gist:437820ce15db30770975e47750c7dd0e
Last active December 11, 2018 15:12 — forked from barentsen/gist:bacd4360fb31e7456d659d07b014e834
How to get clickshare working on Ubuntu
sudo apt install libresample1
sudo gdebi libavutil52_9.18-0ubuntu0.14.04.1_amd64.deb
sudo gdebi libswscale2_9.18-0ubuntu0.14.04.1_amd64.deb
# Download clickshare deb
sudo gdebi clickshare_01.07.01-79_amd64.deb
chrisma /
Created June 6, 2018 12:33
postactivate script to show current Python version in virtualenv
# This hook is sourced after this virtualenv is activated.
echo $fg_bold[green] $(python --version)
echo $fg_bold[green] $(which python)
chrisma /
Created January 22, 2018 15:52
Python GUI for reMarkable sync script
#!/usr/bin/env python3
import os
import tkinter as tk
from tkinter import filedialog
from tkinter import ttk
from tkinter import scrolledtext
import time
import threading