Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -u
BASE_DIR="$HOME/git"
if [[ ! -d "$BASE_DIR" ]]; then
echo "ERROR: Directory does not exist: $BASE_DIR"
exit 1
fi
# depends on sudo apt install ghostscript
gs -o clean.pdf -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dQUIET \
-dDetectDuplicateImages=true -dCompressFonts=true \
-dPDFSETTINGS=/prepress -sColorConversionStrategy=Gray \
-dProcessColorModel=/DeviceGray \
-dCompatibilityLevel=1.4 \
input.pdf
// Simple javascript code for undoing retweets on twitter.com user profile.
setInterval(
function() {
document.querySelector('[data-testid="unretweet"]').click()
document.querySelector('[data-testid="unretweetConfirm"]').click()
},
500
)