-
clone this repository
git clone https://gist.github.com/wookietreiber/290e909a39cf7a02c8e89290e6fc4fed git-extract
-
make
git-extract
script available to your shell
mkdir -p ~/bin
#!/bin/bash | |
function usage { cat << EOF | |
usage: git ignore [--global|--local|--repo] PATTERN | |
ignores PATTERN in git | |
PATTERN may include wildcard. you may want to quote it: | |
# ignores all pdf files that are in the current directory |
#!/bin/bash | |
input=$1 | |
while read -r file | |
do | |
orig="$file" | |
neu="${file}.sonich42xxx" | |
echo "orig: $orig" |
#!/bin/bash | |
set \ | |
-o errexit \ | |
-o pipefail \ | |
-o noglob \ | |
-o nounset \ | |
app=$(basename "$0" .sh) |
--- | |
groups: | |
- name: datetime | |
interval: 60s | |
rules: | |
- record: daylight_saving_time | |
expr: | |
[Unit] | |
Description=battery notification | |
[Service] | |
Environment="DISPLAY=:0" | |
ExecStart=/bin/bash /path/to/battery-notification.sh 20 10 | |
Type=oneshot | |
[Install] | |
WantedBy=default.target |
# this gist has been superseded by | |
# https://github.com/wookietreiber/scala-cli-tools |
import java.util.{ Random => JRandom } | |
import java.util.concurrent.atomic.AtomicLong | |
import scala.util.Random | |
val rng = new Random | |
val seedField = classOf[JRandom].getDeclaredField("seed") | |
seedField.setAccessible(true) | |
val seed = seedField.get(rng.self).asInstanceOf[AtomicLong].get |
#!/bin/bash | |
export SPLIT_header_n=$1 | |
target_size=$2 | |
export SPLIT_input_file=$3 | |
target_wo_header=$(( "$target_size" - "$SPLIT_header_n" )) | |
[[ -n $SPLIT_input_file ]] || { | |
echo "usage: $(basename "$0") SPLIT_header_n target_n SPLIT_input_file" >&2 |
#!/bin/bash | |
if git rev-parse --verify HEAD &> /dev/null ; then | |
against=HEAD | |
else | |
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
fi | |
files=$( | |
git diff-index --cached --name-only $against | |