This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Armv "Archive Move" | |
# A command to write a "moved.txt" file in the source directory with a | |
# list of files moved and the destination. | |
# The command also moves all the files to the destination. | |
# Usage: armv source/path dest/path | |
FROM_PATH="$1" | |
TO_PATH="$2" | |
MOVED_FILE_HEADER="TO: $(realpath "$TO_PATH")" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
pulsate_once () { | |
export delay="$1" | |
echo -n O | |
sleep "$delay" | |
} | |
pulsate_word () { | |
word="$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
def create_data(amount=50): | |
return [ | |
{"content": "abcdefghijkl"} for __ in range(amount) | |
] | |
def create_data_empty_list(amount=50): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import product | |
dumplings = (352, 175) # Kartoffel Knödel 4000400130570 | |
a5 = (210, 148) | |
def min_mod(x1, x2, n1_max): | |
def mod_for_n1(n1): | |
return (x1*n1) % x2 | |
return min((mod_for_n1(n1), n1) for n1 in range(1, n1_max)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import datetime | |
current_balance = 450 | |
desired_buffer_days = 30 | |
planned_charge_period_days = 365.25/6 | |
past_charges = [ | |
(datetime.date(2019, 6, 30), 525), | |
(datetime.date(2019, 7, 22), 1250), | |
(datetime.date(2019, 12, 1), 500), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def Tool(name): | |
data = { | |
'name': name, | |
'size': 0, | |
'color': 0xffee88, | |
} | |
def get_color(): | |
return data['color'] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
expect_at = 2**22 | |
plants = expect_at * ['wind'] + ['solar'] + expect_at * ['biogas'] | |
repetitions = 100 | |
def where_is_eafp(target): | |
try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# see https://askubuntu.com/questions/276234/need-application-script-alerting-when-system-memory-is-running-out/346779#346779 | |
# add crontab -e the following: | |
# * * * * * DISPLAY=:0.0 /path/to/memwarn.bash | |
#Minimum available memory limit, MB | |
if [[ -n "$1" ]]; then | |
THRESHOLD="$1" | |
else | |
THRESHOLD=400 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
[[ "$#" == 2 ]] || { | |
echo Please specify the two input PDF files. | |
exit 1 | |
} | |
PDF1="$1" | |
PDF2="$2" | |
PDFALL="all-$(date -I).pdf" | |
OUTPUTPDF="topcombine-${PDF1%.pdf}-$PDF2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
[[ -n "$GOPATH" ]] || GOPATH="$HOME/gocode/bin" | |
PUP="$GOPATH/pup" | |
if ! [[ -e "$PUP" ]]; then | |
echo 'please install pup with' | |
echo 'GOPATH="$HOME/gocode" go get github.com/ericchiang/pup' | |
exit 1 | |
fi | |
# Aldi-Sued |
NewerOlder