Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View fznsakib's full-sized avatar
:electron:
add, commit, push, repeat

Faizaan Sakib fznsakib

:electron:
add, commit, push, repeat
View GitHub Profile
@fznsakib
fznsakib / lint-all-xml.bash
Last active February 4, 2020 12:19
Lint/prettify all XML files in current directory (including subdirectories)
function lintall() {
for d in $(find . -maxdepth 1 -type d)
do
find . -name '*.xml' -type f | xargs -I'{}' xmllint --output '{}' --format '{}'
done
}
@fznsakib
fznsakib / addframes.bash
Created February 4, 2020 12:16
Add current frame number overlay to all videos in current directory
# $1 = target directory
function addframes() {
for filename in *.mp4; do
ffmpeg -i "$filename" -vf "drawtext=fontfile=Arial.ttf: text=%{n}: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000099: fontsize=32" -y "$1/"$filename"
done
}