Merge remote-tracking branch 'refs/remotes/origin/master'

This commit is contained in:
2022-11-01 16:09:17 -04:00
committed by Kevin Mok
84 changed files with 4269 additions and 374 deletions

View File

@@ -0,0 +1,3 @@
function cad-to-us
qalc "$argv[1]CAD to \$"
end

View File

@@ -0,0 +1,7 @@
function clip
if test (count $argv) -eq 3
ffmpeg -ss $argv[1] -i $argv[2] -codec copy $argv[3]
else
ffmpeg -ss $argv[1] -to $argv[2] -i $argv[3] -codec copy $argv[4]
end
end

View File

@@ -0,0 +1,15 @@
function discord-burner
# echo nordvpn connect ca1$argv[1] && curl ifconfig.me
# nordvpn connect ca1$argv[1] && \
# nordvpn connect ca10$argv[1]
nordvpn connect
curl ifconfig.me
if test (count $argv) -gt 1
firefox -P discord-$argv[2] $argv[1] &
else
firefox -P discord-$argv[1] &
end
# for i in (seq $argv[1] $argv[2])
# firefox -P discord-$i $argv[3] &
# end
end

View File

@@ -0,0 +1,3 @@
function dump-rarity-check
pg_dump -U rarity_check rarity_check > $argv[1].sql
end

View File

@@ -0,0 +1,4 @@
function fzf-cd
set dir (fd -td | fzf)
cd $dir
end

View File

@@ -0,0 +1,6 @@
function fzf-ranger
set dir (fd -td | fzf)
if test ! -z "$dir"
ranger $dir
end
end

View File

@@ -1,3 +1,6 @@
function fzf-vim
fzf | xargs $EDITOR
set file (fzf)
if test ! -z "$file"
$EDITOR $file
end
end

View File

@@ -0,0 +1,3 @@
function git-log-short
git log --pretty="%C(Yellow)%h %C(reset)%ad (%C(Green)%cr%C(reset))%x09 %C(Cyan)%an: %C(reset)%s"
end

View File

@@ -0,0 +1,3 @@
function git-submodule-branch
git submodule set-branch --branch $argv[2] -- $argv[1]
end

View File

@@ -1,3 +1,3 @@
function git-clone-gitea
git clone ssh://git@ataraxy.tk:399/Kevin-Mok/$argv[1].git
git clone ssh://git@kevin-mok.com:399/Kevin-Mok/$argv[1].git
end

View File

@@ -0,0 +1,3 @@
function git-push-diff-name
git push -f origin HEAD:$argv[1]
end

View File

@@ -1,4 +1,4 @@
function git-push-new-gitea
git remote add $argv[1] ssh://git@ataraxy.tk:399/Kevin-Mok/$argv[2].git
and git push --set-upstream $argv[1] master
git remote add origin ssh://git@kevin-mok.com:399/Kevin-Mok/$argv[1].git
and git push --set-upstream origin main
end

View File

@@ -0,0 +1,6 @@
function git-replace-origin-gitea
git remote remove origin
and git remote add origin ssh://git@kevin-mok.com:399/Kevin-Mok/$argv[1].git
and git branch --set-upstream-to=origin/master master
and git push
end

View File

@@ -0,0 +1,3 @@
function libreoffice-silent
libreoffice $argv[1] &
end

View File

@@ -0,0 +1,4 @@
function maven-test-method
mvn "-Dtest=$argv[1]#*$argv[2]*" clean test
# mvn "-Dtest=$argv[1]#*$argv[2]*" test
end

View File

@@ -0,0 +1,3 @@
function mkdir-cd
mkdir -p $argv[1] && cd $argv[1]
end

View File

@@ -0,0 +1,3 @@
function mute-video
ffmpeg -i $argv[1] -c copy -an $argv[2]
end

View File

@@ -1,5 +1,6 @@
function pastebin
# cat $argv[1] | curl -F 'sprunge=<-' http://sprunge.us
# set -x HASTE_SERVER https://pste.gq
cat $argv[1] | haste --raw
# cat $argv[1] | haste --raw
cat $argv[1] | haste
end

View File

@@ -0,0 +1,3 @@
function qalc-history
qalc $argv[1] | tee -a /home/kevin/Documents/journal/personal/calc-history.md
end

View File

@@ -0,0 +1,3 @@
function qalc-update
qalc -e "$argv[1]USD to CAD"
end

View File

@@ -0,0 +1,3 @@
function readlink-cp
readlink -f $argv[1] | xclip -selection clipboard
end

View File

@@ -0,0 +1,13 @@
function refresh-config
chezmoi apply
and echo 'Applied chezmoi.'
# and tmux source-file ~/.tmux.conf
# and echo 'Sourced tmux config.'
sync-shortcuts
echo 'Synced shortcuts.'
source ~/.config/fish/key_abbr.fish > /dev/null
and echo 'Sourced shortcuts.'
and echo 'Reloading fish.'
and exec fish
end

View File

@@ -0,0 +1,3 @@
function reminder
termdown $argv[2] && notify-send $argv[1]
end

View File

@@ -2,6 +2,7 @@ function scan-history
sudo systemctl start postgresql.service
# and systemctl status postgresql.service
and source $spv_dir/src/scripts/api-keys.sh
# and $spv_dir/src/scripts/update-history-2.sh
and $spv_dir/src/scripts/update-history.sh
and cat $spv_dir/src/api/management/commands/update-history.log | tail -n 1
end

View File

@@ -0,0 +1,7 @@
function scp-vid
set dest_dir "/mnt/linux-files/Videos/personal-fortnite-games/review"
if test $argv[1] = 'pogo'
set dest_dir "/mnt/linux-files/Videos/pokemon-go"
end
scp -P 8022 192.168.0.18:/data/data/com.termux/files/home/storage/dcim/\'Screen\ recordings\'/$argv[2] $dest_dir
end

View File

@@ -1,8 +1,8 @@
function server-pages
set sites git.ataraxy.tk khkm.tk cal.khkm.tk mnpd.gq/k-bg pste.gq smol.gq twem.tk
set titles "Kevin Mok's Gitea" "Kevin Mok" "Baïkal server" "k-bg" "hastebin" "Kevin's URL Shortener" "Index of /"
# set sites mnpd.gq/k-bg
# set titles "k-bg"
set sites kevin-mok.com git.kevin-mok.com cal.khkm.tk mnpd.gq/kbg pste.gq smol.gq twem.tk
set titles "Kevin Mok" "Kevin Mok's Gitea" "Baïkal server" "kbg" "hastebin" "Kevin's URL Shortener" "Twitch Emote Links"
# set sites twem.tk
# set titles "Twitch Emote Links"
for i in (seq (count $sites))
set title (wget -qO- "$sites[$i]" | perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)\s*<\/title/si' | recode html)

View File

@@ -0,0 +1,3 @@
function sxiv-silent
sxiv $argv[1] &
end

View File

@@ -1,4 +1,4 @@
function task-anno
task $argv[1] annotate $argv[2]
task $argv[2] annotate $argv[1]
and task
end

View File

@@ -1,5 +1,4 @@
function task-delete
task $argv[1] delete
and task sync
and task
end

View File

@@ -1,5 +1,4 @@
function task-done
task $argv[1] done
and task sync
and task
end

View File

@@ -0,0 +1,4 @@
function task-due-rm
task $argv[1] mod due:
and task
end

View File

@@ -0,0 +1,4 @@
function task-due
task $argv[1] mod due:+$argv[2]
and task
end

View File

@@ -1,4 +1,4 @@
function task-mod-pri
task $argv[1] modify pri:$argv[2]
task $argv[2] modify pri:$argv[1]
and task
end

View File

@@ -0,0 +1,4 @@
function task-next-rm
task $argv[1] modify -next
and task
end

View File

@@ -0,0 +1,4 @@
function task-wait
task $argv[1] mod wait:+$argv[2]
and task
end

View File

@@ -0,0 +1,4 @@
function us-to-cad
# qalc -e "$argv[1]\$ to CAD"
qalc "$argv[1]\$ to CAD"
end

View File

@@ -0,0 +1,10 @@
function vpn-red-hat
if test $argv[1] = 'up'
sudo systemctl start NetworkManager.service
and sleep 3
and nmcli con up id "1 - Red Hat Global VPN" --ask
else if test $argv[1] = 'down'
nmcli con down id "1 - Red Hat Global VPN"
and sudo systemctl stop NetworkManager.service
end
end

View File

@@ -0,0 +1,11 @@
function watson-add-fortnite
set year_month "2020-08"
set start_time "$year_month-$argv[1] $argv[2]"
set end_time "$year_month-$argv[3] $argv[4]"
if test (count $argv) -eq 4
watson add -f $start_time -t $end_time fun +fortnite
else
watson add -f $start_time -t $end_time fun +fortnite +$argv[5]
end
end

View File

@@ -0,0 +1,11 @@
function watson-add-game
set year_month (date -u +"%Y-%m")
set start_time "$year_month-$argv[2] $argv[3]"
set end_time "$year_month-$argv[4] $argv[5]"
if test (count $argv) -eq 5
watson add -f $start_time -t $end_time fun +$argv[1]
else
watson add -f $start_time -t $end_time fun +$argv[1] +$argv[6]
end
end