Skip to content

Instantly share code, notes, and snippets.

@hexpunk
hexpunk / delete_local_branches.sh
Created January 12, 2025 23:16 — forked from TSMMark/delete_local_branches.sh
Delete local branches that don't exist on remote/origin !USE AT YOUR OWN RISK!
git fetch --all -p; git branch -vv | grep ": gone]" | awk '{ print $1 }' | xargs -r -n 1 git branch -D
@hexpunk
hexpunk / remove_metadata.sh
Last active December 10, 2021 05:03
Remove metadata from videos using ffmpeg
#!/bin/sh
set -eu
for target in "$@"; do
original=$target.original
if mv "$target" "$original"; then
if ! ffmpeg -hide_banner \
-i "$original" \
-map_metadata -1 \
/usr/bin/time -l sh -c "find -type f -not -path '\./\.git/*' -not -path '\./node_modules/*' -exec sh -c \"git --no-pager blame --line-porcelain '{}' | sed -n 's/^author //p'\" 2>/dev/null \; | sort | uniq -c | sort -rn"