Skip to content

Instantly share code, notes, and snippets.

@Husterknupp
Husterknupp / .zshrc
Last active April 20, 2017 21:06
git checkout to develop branch and remove branch that just became obsolete. aanand/git-up required
git_checkout_and_forget() {
git_status=$(git status)
if [[ $? -eq 0 ]]; then
current_branch=$(git status | awk '/On branch/ {print $3}')
if [[ -z "$1" ]] ; then
checkout="develop"
else
checkout=$1
fi
git checkout $checkout
@Husterknupp
Husterknupp / speedtest-monitoring.sh
Last active May 20, 2017 09:35
run speedtest script repeatedly and log results
#!/bin/bash
for i in `seq 1 1400`; do
echo "Start tryal $i"
result=$(speedtest)
echo 'done with the test.. writing results'
awkres=$(echo "$result" | awk -v date="$(date +"%Y-%m-%d %R")" -v sep="\," '/Download/ {print $2, sep, $3, sep, date}')
echo $awkres >> speedtest-results-Download
upres=$(echo "$result" | awk -v date="$(date +"%Y-%m-%d %R")" -v sep="\," '/Upload/ {print $2, sep, $3, sep, date}')
echo $upres >> speedtest-results-Upload
@Husterknupp
Husterknupp / Brewfile
Last active February 26, 2020 13:51
conveniently install all sorts of stuff after a fresh & clean MacOS setup
# brew bundle
# for more information, see https://github.com/Homebrew/homebrew-bundle
# took 2-3h on my 16M wire
tap 'homebrew/core'
tap 'homebrew/formula-analytics'
tap 'homebrew/dev-tools'
tap 'homebrew/bundle'
tap 'homebrew/dupes'
tap 'homebrew/services'
@Husterknupp
Husterknupp / black-bean-burgers-de.md
Last active May 24, 2021 16:17
Translation from NutritionFacts.org recipe