Skip to content

Instantly share code, notes, and snippets.

View miallo's full-sized avatar

Michael Lohmann miallo

View GitHub Profile
@miallo
miallo / secure-git.sh
Last active October 7, 2025 12:14
git only in trusted paths
: "${GIT_SECRET_PATH:="$HOME/.gitsecret"}"
RESET='\033[0m'
RED="\e[0;31m"
# equivalent of /usr/bin/env git rev-parse --show-toplevel but without possible code execution
git_safe_show_toplevel() {
local DIR
if [[ -z "$GIT_DIR" ]]; then
DIR="$(pwd)"
@miallo
miallo / init.vim
Created March 24, 2021 08:37
My neovim-config. Plugins are handled separately. I know that I didn't guard it adequately to run on all vim/nvim versions - that is still on my todo list. Quite some things copied from @wincent
let g:mapleader = "\<Space>"
let g:maplocalleader = ','
set encoding=utf-8
set title " show current buffername in title of terminal
"############################## Finding Stuff ##############################"
@miallo
miallo / SphericalRandomWalk.py
Created January 30, 2021 19:53
Simulation of a random walk on a sphere, according to the rules of https://twitter.com/Frau_Sturmflut/status/1355476802823725058
import random
import numpy as np
import matplotlib.pyplot as plt
r = 6_370_000 # m Earth radius
step = 5 * np.pi / r # angular step in radians
position = [50.908365, 7.058048] # bevuta
direction = np.pi # southwards