Skip to content

Instantly share code, notes, and snippets.

View vrld's full-sized avatar

Matthias Richter vrld

View GitHub Profile
def covar_2d(e, s):
"""Returns a 2D covariance matrix with main diagonal in direction e and second diagonal perpendicular to e with proportional length s.
Params:
-------
e: array-like
Direction of the main diagonal.
s: float
Proportional scale of the second diagonal.
@vrld
vrld / marknote
Created July 9, 2019 08:00
Live Markdown Preview powered by pandoc and entr
#!/bin/sh
usage() {
echo "Usage: marknote path"
exit -1
}
FILE=$1
[ -z "${FILE}" ] && usage
@vrld
vrld / refresh-firefox
Created July 9, 2019 08:02
Refresh firefox window with xdotool
#!/bin/sh
ACTIVE_WINDOW=$(xdotool getactivewindow)
if [ -z "${1}" ]; then
xdotool search --classname Navigator windowactivate --sync key --clearmodifiers "ctrl+F5"
else
xdotool search --classname Navigator search --name $1 windowactivate --sync key --clearmodifiers "ctrl+F5"
fi