Compare commits

..

No commits in common. "da0351e6402d7c3c2754c9e11d76b373c0e27602" and "9aa9009b830e755c99adc9bc0a5df60d4d48db07" have entirely different histories.

3 changed files with 0 additions and 85 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
git-mirror-machine/
.idea/
*.swp
*.zip

View File

@ -1,7 +1,6 @@
#!/bin/bash
RUN_FIREFOX="MOZ_ENABLE_WAYLAND=1 setsid $HOME/.bin/firefox-developer-edition/firefox-bin"
echo "$RUN_FIREFOX"
kill $(pgrep firefox)
current_date="$(date '+%D')"

View File

@ -10,81 +10,6 @@ fi
alias _slides="$(which slides 2> /dev/null || echo "echo 'slides not installed'")"
CASCH_DIR="$HOME/.casch"
CASCH_MAP="$CASCH_DIR/.base-map.json"
function git-worked {
author="$1"
since="$2"
if [[ "$author" == "" ]]; then
author="Sage"
fi
if [[ "$since" == "" ]]; then
since="1 year ago"
fi
cd "$HOME/git"
local first=true
for l in $(find -maxdepth 1 -mindepth 1 -type d | grep -v ' '); do
cd ~/git
cd $l
if ! test -d .git; then
continue
fi
local LIST="$(git rev-list --oneline --author="$author" --since="$since" HEAD)"
if [[ "$(echo -E "$LIST" | wc -l)" > 1 ]]; then
if ! $first; then
echo
fi
first=false
echo -E $l
echo -E "$LIST"
fi
done
cd ~/git
}
function touch-cache {
local lastUpdate="$(date '+%s')"
mkdir -p "$CASCH_DIR"
test -f "$CASCH_MAP" || echo '{}' > "$CASCH_MAP"
jq --arg cachedCommand "$1" --arg filename "$2" --arg lastUpdate "$lastUpdate" '.+={($cachedCommand): {$filename, $lastUpdate}}' "$CASCH_MAP" > "$CASCH_DIR/.tempbase.json"
mv "$CASCH_DIR/.tempbase.json" "$CASCH_MAP"
}
function timer {
for i in {0..$(($1-1))}; do
echo $(($1-$i))
sleep 1
clear
done
cvlc --play-and-exit "$HOME/Downloads/bonk.ogg" &> /dev/null
}
function cache-is-older-than {
local currentTime="$(date '+%s')"
local lastUpdate="$(jq -r --arg cachedCommand "$1" '.[$cachedCommand].lastUpdate' "$CASCH_MAP")"
local olderThanSec="$2"
if [[ "$lastUpdate" == "null" ]]; then
return 0
fi
(($currentTime-$olderThanSec>$lastUpdate))
}
function cache-run {
local cacheFile="$CASCH_DIR/$@"
if cache-is-older-than "$@" 300; then
$@ | tee "$cacheFile"
touch-cache "$@" "$cacheFile"
else
cat "$cacheFile"
fi
}
alias cr='cache-run'
function roll {
local count=1
if [[ "$2" != "" ]]; then
@ -266,14 +191,6 @@ alias tmux="tmux attach || tmux"
alias caddyfile="sudo vim /etc/caddy/Caddyfile"
alias cf="sudo vim /etc/caddy/Caddyfile"
function v {
if test -f "$1"; then
vim "$1"
else
vim $1*
fi
}
function download-channel {
yt-dlp "$1" --format 'bestvideo[height=1080]+bestaudio/best' --download-archive archive.txt --output '%(uploader)s/%(upload_date)s.%(title)s.%(id)s.%(ext)s' --restrict-filenames --merge-output-format mkv --ignore-errors
}