Skip to content

Instantly share code, notes, and snippets.

View theRealSuperMario's full-sized avatar

Sandro Braun theRealSuperMario

View GitHub Profile
theRealSuperMario /
Created April 4, 2021 13:47
Run a command in a new iTerm tab
#!/usr/bin/env python3
import iterm2
import AppKit
import click
import os
"cwd", type=click.Path(exists=True, file_okay=False, dir_okay=True)
theRealSuperMario / iterm.bash
Created April 4, 2021 10:44 — forked from geyang/iterm.bash
bash function for opening up iterm form current directory
#!/usr/bin/env bash
# Open new iTerm window from the command line using v3 syntax for applescript as needed in iTerm2 Version 3+
# This script blocks until the cmd is executed in the new iTerm2 window. It then leaves the window open.
# TODO Add option to close iTerm2 after cmd execs
# See also
# Usage:
theRealSuperMario /
Created July 30, 2020 15:43 — forked from bgshih/
A simple example of Thin Plate Spline (TPS) transformation in Numpy.
import ipdb
import numpy as np
import numpy.linalg as nl
import matplotlib.pyplot as plt
from scipy.spatial.distance import pdist, cdist, squareform
def makeT(cp):
# cp: [K x 2] control points
# T: [(K+3) x (K+3)]
K = cp.shape[0]

Firing up LaTex on macOS 🔥

As I'm writing this small tutorial, I assume you've read my previous one about setting up macOS, so if for any tool I'll use without explanation, look to that other article.


The full version IS NOT MANDATORY, as in the tutorial that follows I installed the smaller version of MacTeX and proceded installing every needed dependency. Installing the complete package is about ~3.5GB of download and ~5GB on disk, the smaller one is just about 80MBs.

Click here to download the complete version or here to download the smaller version.


theRealSuperMario / style.conf
Created June 29, 2020 17:45
zim style.conf
## /home/sandro/.config/zim
font=Lato 13
[Tag strong]
def torch_gather_nd(params, indices, params_shape, indices_shape):
"""dirty wrapper for tf.gather_nd to use with pytorch.
You will need for this.
warnings.warn("Implemted using tfpyth, thus tensorflow is called in the back")
def func(params, indices):
return tf.gather_nd(params, indices)
out = tfpyth.wrap_torch_from_tensorflow(
theRealSuperMario /
Created February 21, 2020 14:16
Download unaligned celeba (in the wild) in .tgz archive which is significantly faster to extract than .7z
theRealSuperMario /
Created July 10, 2019 08:36 — forked from turicas/
Layer on top of Python Imaging Library (PIL) to write text in images easily
#!/usr/bin/env python
# coding: utf-8
# You need PIL <> to run this script
# Download unifont.ttf from <> (or use
# any TTF you have)
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <>
from image_utils import ImageText
theRealSuperMario / canidates_03.02.ipynb
Last active February 3, 2018 19:43
red-green friendly linestyles
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
theRealSuperMario /
Last active August 29, 2015 14:07
für abrechnungen
__author__ = 'sandro'
from tkinter import *
import functools
import sqlite3
from AusgabenBenutzer import *
import datetime
import time
class AbrechnungsKlasse: