Skip to content

Commit

Permalink
enforce single trailing newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
wyattscarpenter committed Jun 24, 2024
1 parent b1dec48 commit 33d514d
Show file tree
Hide file tree
Showing 38 changed files with 37 additions and 38 deletions.
2 changes: 1 addition & 1 deletion 2artless
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ set -euo pipefail #bash strict mode
for i in "$@" ; do
ffmpeg -i "$i" -acodec copy -fflags +bitexact -vn tmp.artless."$i"
mv tmp.artless."$i" "$i"
done
done
2 changes: 1 addition & 1 deletion aud-eq
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
ffmpeg -i "$1" -fflags +bitexact -vn -map_metadata -1 -loglevel warning tmp1.wav
ffmpeg -i "$2" -fflags +bitexact -vn -map_metadata -1 -loglevel warning tmp2.wav
cmp --silent tmp1.wav tmp2.wav && echo 'equal' || echo 'not equal'
rm tmp1.wav tmp2.wav
rm tmp1.wav tmp2.wav
2 changes: 1 addition & 1 deletion cl.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ REM This script named cl is hidden by the actual cl after a single invocation,
REM so subsequent invocations of cl simply refer to the real cl.
REM This script is super path-dependent.
REM You can get the VS build tools from https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" & cl %*
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" & cl %*
2 changes: 1 addition & 1 deletion diff-bin
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -euo pipefail #bash strict mode
[ "$#" -ne 2 ] && echo USAGE: "$0 file_1 file_2" && echo && echo "IMPLEMENTATION:" && cat "$0" && echo && exit 22 #usage message for invalid number of arguments
diff <(xxd -p "$1") <(xxd -p "$2")
diff <(xxd -p "$1") <(xxd -p "$2")
2 changes: 1 addition & 1 deletion docx-change-comments
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ rm -r "$tmpdir"
5. Zip up again. (Do NOT commit the common mistake of making a zip file that contains a single folder with all the contents inside that. The contents must be directly under root, like in the original docx.)
And that's it!
HEREDOC
HEREDOC
2 changes: 1 addition & 1 deletion download-website
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#download the specified website
wget --mirror --restrict-file-names=windows --convert-links --adjust-extension --page-requisites --no-parent "$1"
wget --mirror --restrict-file-names=windows --convert-links --adjust-extension --page-requisites --no-parent "$1"
2 changes: 1 addition & 1 deletion dubious math/+
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ acc=0
for i in "$@"; do
((acc+=i))
done
echo $acc
echo $acc
2 changes: 1 addition & 1 deletion dubious math/div
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ shift
for i in "$@"; do
((acc/=i))
done
echo $acc
echo $acc
2 changes: 1 addition & 1 deletion dubious math/minus
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ shift
for i in "$@"; do
((acc-=i))
done
echo $acc
echo $acc
2 changes: 1 addition & 1 deletion dubious math/mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ shift
for i in "$@"; do
((acc%=i))
done
echo $acc
echo $acc
2 changes: 1 addition & 1 deletion dubious math/mul
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ acc=1
for i in "$@"; do
((acc*=i))
done
echo $acc
echo $acc
2 changes: 1 addition & 1 deletion dubious math/pow
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ shift
for i in "$@"; do
((acc=acc**i))
done
echo $acc
echo $acc
2 changes: 1 addition & 1 deletion extract-hrefs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ for i in "$@"; do
else
wget -q -O- "$1" | grep -Po '(?<=href=")[^"]*(?=")'
fi
done
done
2 changes: 1 addition & 1 deletion find-malformed-pngs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ else
for i in "$@"; do
pngcheck -q "$i" || { head -c 10 -z "$i" && echo && echo ; };
done
fi
fi
2 changes: 1 addition & 1 deletion git-be
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ git config $folder_config_or_nothing user.name "$name"
git config $folder_config_or_nothing user.email "$email"

echo Now, the current git identity is:
git whoami
git whoami
2 changes: 1 addition & 1 deletion git-exe-alias.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ int main(int argc, char **argv){ //remember: arg0 is the name of the program! eg
i++;
}
return execvp("wsl", newarray); //search path for wsl and then execute it with the arguments.
}
}
2 changes: 1 addition & 1 deletion git-remove-from-history
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ if [ "$#" -ne 1 ]; then
exit 1
fi

git filter-branch --force --index-filter "git rm -r --cached --ignore-unmatch \"$1\"" --prune-empty --tag-name-filter cat -- --all
git filter-branch --force --index-filter "git rm -r --cached --ignore-unmatch \"$1\"" --prune-empty --tag-name-filter cat -- --all
2 changes: 1 addition & 1 deletion git-replace-all-in-history
Original file line number Diff line number Diff line change
@@ -1 +1 @@
git filter-branch --tree-filter "git ls-files -z | xargs -0 sed -i \"s/$1/$2/gi\"" --prune-empty #note that this is quite possibly operating system dependent and thus not foolproof for redacting files in all cases. sed i regex flag (here after g) is a GNU extension, for example. #Note also that the weird double quoting is required.
git filter-branch --tree-filter "git ls-files -z | xargs -0 sed -i \"s/$1/$2/gi\"" --prune-empty #note that this is quite possibly operating system dependent and thus not foolproof for redacting files in all cases. sed i regex flag (here after g) is a GNU extension, for example. #Note also that the weird double quoting is required.
2 changes: 1 addition & 1 deletion git-whoami
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
git config user.name
git config user.email
git config user.email
2 changes: 1 addition & 1 deletion go-to-where
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[ "$#" -ne 1 ] && echo USAGE: "$0 command" && echo && echo "IMPLEMENTATION:" && cat "$0" && echo && exit #usage message for invalid number of arguments
cd `dirname "$(whereis "$1" | cut -d ' ' -f2- -s)"`
explorer.exe . #turns out I always want to do this. If you aren't on WSL and explorer isn't a command on your system, I'm sorry.
explorer.exe . #turns out I always want to do this. If you aren't on WSL and explorer isn't a command on your system, I'm sorry.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
var css = document.createElement('style');
css.appendChild(document.createTextNode(""));
css.innerText += 'div#main.mainWithAdd{width:100% !important;min-width:1198px}'+'div.mapContainer{width:auto !important;height:auto !important}'+'div.mapContainer>div:nth-child(1){width:auto !important;height:auto !important}';
document.head.appendChild(css);
document.head.appendChild(css);
Original file line number Diff line number Diff line change
@@ -1 +1 @@
window.resizeTo(3000,700);//horizontal, vertical
window.resizeTo(3000,700);//horizontal, vertical
Original file line number Diff line number Diff line change
@@ -1 +1 @@
:screenshot --dpr 4 --fullpage
:screenshot --dpr 4 --fullpage
2 changes: 1 addition & 1 deletion img-eq
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
[ -f "$1" ] && [ -f "$2" ] || ( echo "$0" must have two arguments, both must be image files that exist. Aborting. ; exit )

command -v compare >/dev/null 2>&1 || { echo >&2 "img-eq requires imagemagick's compare but it's not installed. Aborting."; exit 1; }
[ "$(compare -metric rmse "$1" "$2" null: 2>&1)" = "0 (0)" ] && echo "equal" || echo "not equal"
[ "$(compare -metric rmse "$1" "$2" null: 2>&1)" = "0 (0)" ] && echo "equal" || echo "not equal"
2 changes: 1 addition & 1 deletion letterbox
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#the second argument is width so you can letterbox DVDs to 720p for youtube.
#I used to use truly lossless crf 0 for this but it's just not worth the space. All the things I use this on are already rips.
ffmpeg -i "$1" -c:a copy -vf "pad=height=$2:y=(oh-ih)/2" -c:v libx264 -crf 10 letterboxed."$1".mkv
ffmpeg -i "$1" -c:a copy -vf "pad=height=$2:y=(oh-ih)/2" -c:v libx264 -crf 10 letterboxed."$1".mkv
2 changes: 1 addition & 1 deletion rust
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#this is so you can run `rust script.rs` and/or shebang `#!/usr/bin/env rust`. I'm not sure how useful this is since it isn't standard, but thanks http://blog.joncairns.com/2015/10/a-single-command-to-compile-and-run-rust-programs/ for pointing out you can do this, anyway.
name=$(basename $1 .rs)
rustc $@ && ./$name && rm $name
rustc $@ && ./$name && rm $name
2 changes: 1 addition & 1 deletion sdiff-bin
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -euo pipefail #bash strict mode
[ "$#" -ne 2 ] && echo USAGE: "$0 file_1 file_2" && echo && echo "IMPLEMENTATION:" && cat "$0" && echo && exit 22 #usage message for invalid number of arguments
sdiff <(xxd -p "$1") <(xxd -p "$2")
sdiff <(xxd -p "$1") <(xxd -p "$2")
2 changes: 1 addition & 1 deletion strip-music-metadata
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ done
for i in *.wav ; do
ffmpeg -i "$i" -acodec copy -fflags +bitexact -vn -map_metadata -1 "$(basename "${i/.wav}")..wav"
done
rename -f "s/\.\././" *
rename -f "s/\.\././" *
2 changes: 1 addition & 1 deletion trash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mkdir -p ~/trash; mv --backup=numbered "$@" ~/trash
mkdir -p ~/trash; mv --backup=numbered "$@" ~/trash
2 changes: 1 addition & 1 deletion tts-file
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ for file in "$@"; do
vid-cat ../"$file.tts.wav" #uses the vid-cat command from wyattscarpenter's util. It just concatenates the audio using ffmpeg
cd ..
rm -r "tmp.tts.$file"
done
done
2 changes: 1 addition & 1 deletion unmark-exe
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ for i in "$@"; do
mkdir -p ~/user/bin #you must add this to PATH. This script doesn't do it.
cp -p "$file" ~/user/bin/"$(basename "$file" .exe)"
fi
done
done
1 change: 0 additions & 1 deletion vid-length
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ if [ "$#" -eq 0 ]; then
echo IMPLEMENTATION:
cat "$0"
fi

2 changes: 1 addition & 1 deletion where
Original file line number Diff line number Diff line change
@@ -1 +1 @@
whereis "$@"
whereis "$@"
2 changes: 1 addition & 1 deletion wiscut
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#cuts the last approximately 10 minutes off the input file
# sudo apt install ffmpeg
echo $(($(ffprobe -i "$1" -show_format -v quiet | sed -n 's/duration=//p'| xargs printf %.0f)-600))
ffmpeg -i "$1" -c copy -to $(($(ffprobe -i "$1" -show_format -v quiet | sed -n 's/duration=//p'| xargs printf %.0f)-600)) "wiscut.$1"
ffmpeg -i "$1" -c copy -to $(($(ffprobe -i "$1" -show_format -v quiet | sed -n 's/duration=//p'| xargs printf %.0f)-600)) "wiscut.$1"
2 changes: 1 addition & 1 deletion wp
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#handles windows file paths in bash in lxss
#from https://gist.github.com/aseering/a06219e74c7f96ccea5ec65d5b2483b5
# call like "$(wp C:\Program Files\Windows NT)" (quotes necessary because bash lol)
echo "$@" | sed -e 's|\\|/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/mnt/\L\1\E/\2|'
echo "$@" | sed -e 's|\\|/|g' -e 's|^\([A-Za-z]\)\:/\(.*\)|/mnt/\L\1\E/\2|'
2 changes: 1 addition & 1 deletion youtube-dl-music
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# takes one url as an argument, you have to quote it (bash eats ampersands)
# but if you like you can also insert your own modifcations on the end since the arguments are unquoted

youtube-dl -f m4a -o "%(autonumber)s %(title)s %(display_id)s (youtube rip).%(ext)s" $@
youtube-dl -f m4a -o "%(autonumber)s %(title)s %(display_id)s (youtube rip).%(ext)s" $@
2 changes: 1 addition & 1 deletion youtube-dl-part
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ if [ $# -eq 3 ]; then
ffmpeg -ss "$2" -i "`cat url.tmp.txt`" -to "$3" -c copy -copyts "${b##*=}.youtube-dl-part.mp4"
else
ffmpeg -ss "$2" -i $(youtube-dl --verbose -g "$1") -c copy -copyts "${b##*=}.youtube-dl-part.mp4"
fi
fi
2 changes: 1 addition & 1 deletion youtube-format-munge-720
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ vid-cat output.mp4 "$@"
#IDK what I would do if I needed to avoid FFMPEG (libx264) "height not divisible by 2" AND I didn't know which slot should have the -2 in it...

# -f mp4 pipe:1 | youtubeuploader -filename -
# -f concat -i vidlist.tmp.txt
# -f concat -i vidlist.tmp.txt

0 comments on commit 33d514d

Please sign in to comment.