Skip to content

Instantly share code, notes, and snippets.


Sandro Braun theRealSuperMario

View GitHub Profile
theRealSuperMario /
Created Apr 4, 2021
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 Apr 4, 2021 — forked from geyang/iterm.bash
bash function for opening up iterm form current directory
View iterm.bash
#!/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 Jul 30, 2020 — 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]
View Firing up LaTex on

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.


View style.conf
## /home/sandro/.config/zim
font=Lato 13
[Tag strong]
View torch_gather_nd
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 Feb 21, 2020
Download unaligned celeba (in the wild) in .tgz archive which is significantly faster to extract than .7z
theRealSuperMario /
Created Jul 10, 2019 — 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 Feb 3, 2018
red-green friendly linestyles
View canidates_03.02.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
__author__ = 'sandro'
from tkinter import *
import functools
import sqlite3
from AusgabenBenutzer import *
import datetime
import time
class AbrechnungsKlasse: