From 6a44cfc35fcac66934e6843d0eb37a09659b7152 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Thu, 7 Mar 2024 02:39:25 +0100 Subject: [PATCH 01/10] fix --- zsh/ripgrep.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zsh/ripgrep.zsh b/zsh/ripgrep.zsh index 8a3205a..b492628 100644 --- a/zsh/ripgrep.zsh +++ b/zsh/ripgrep.zsh @@ -19,5 +19,6 @@ alias ripgrep_sec="$RG $RIPGREP_ARGS '(aws_access|aws_secret|api[_-]?key|ListBuc alias ripgrep_copyright="$RG $RIPGREP_ARGS '(copyright|\u0026copy;|\\(c\\)|©) *[12][0-9]{3}'" # Development -alias ripgrep_todo="$RG $RIPGREP_ARGS 'todo|unimplemented|refactor|deprecated|wip|review'" +alias ripgrep_todo="$RG $RIPGREP_ARGS 'todo|unimplemented|refactor|wip'" +alias ripgrep_review="$RG $RIPGREP_ARGS 'review|deprecated'" alias ripgrep_fix="$RG $RIPGREP_ARGS 'fix|fixme'" \ No newline at end of file From 816b023e71ff91a773e0a6cb7c771383fdabeb3e Mon Sep 17 00:00:00 2001 From: JMARyA Date: Thu, 7 Mar 2024 02:49:33 +0100 Subject: [PATCH 02/10] fix --- zsh/ripgrep.zsh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zsh/ripgrep.zsh b/zsh/ripgrep.zsh index b492628..b4c14ba 100644 --- a/zsh/ripgrep.zsh +++ b/zsh/ripgrep.zsh @@ -1,6 +1,9 @@ -#RG="rg" -RG="rga" -RIPGREP_ARGS="-i --no-ignore-vcs" +# Parameters +# You can on the fly reassign the values and update all the aliases with `zshrefresh` + +#RG="${RG:-rg}" +RG="${RG:-rga}" +RIPGREP_ARGS="${RIPGREP_ARGS:--i}" # Common Data alias ripgrep_data_urls="$RG $RIPGREP_ARGS 'data:(.*?)(;base64)?,(.*)'" From 564e956ba4eeca662790ac4dc3def3b615bc38d9 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Mon, 11 Mar 2024 09:43:41 +0100 Subject: [PATCH 03/10] add info_json fn --- zsh/youtube-dl.zsh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zsh/youtube-dl.zsh b/zsh/youtube-dl.zsh index e753e77..c217d37 100644 --- a/zsh/youtube-dl.zsh +++ b/zsh/youtube-dl.zsh @@ -15,4 +15,10 @@ alias downloadYT="yt-dlp --write-thumbnail \ function downloadList() { cat $1 |xargs -I _ yt-dlp --downloader aria2c _ +} + +# info_json VIDEO_FILE +# View info.json from video file +function info_json() { + mkvextract -q attachments "$1" "1:/proc/self/fd/1"|jq . } \ No newline at end of file From b03d2641c3e26383df03b419b5b0108d582b1444 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Wed, 13 Mar 2024 22:12:02 +0100 Subject: [PATCH 04/10] update + yt-dlp --- zsh/fn.zsh | 2 +- zsh/youtube-dl.zsh | 40 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/zsh/fn.zsh b/zsh/fn.zsh index 60e3ad2..6a15fed 100644 --- a/zsh/fn.zsh +++ b/zsh/fn.zsh @@ -17,7 +17,7 @@ alias cat="bat -p" alias gfold="gfold -d classic" function hs() { - $(cat ~/.zsh_history|sk) + rg "$1" ~/.zsh_history } alias notes="codium ~/Notes" diff --git a/zsh/youtube-dl.zsh b/zsh/youtube-dl.zsh index c217d37..835af59 100644 --- a/zsh/youtube-dl.zsh +++ b/zsh/youtube-dl.zsh @@ -18,7 +18,43 @@ function downloadList() { } # info_json VIDEO_FILE -# View info.json from video file +# Extract info.json from video file function info_json() { - mkvextract -q attachments "$1" "1:/proc/self/fd/1"|jq . + mkvextract -q attachments "$1" "1:/proc/self/fd/1" +} + +# info_json_url VIDEO_FILE +# Get URL from info.json +function info_json_url() { + info_json "$1" | jq -r .webpage_url +} + +# info_json_title VIDEO_FILE +# Get Title from info.json +function info_json_title() { + info_json "$1" | jq -r .title +} + +# info_json_desc VIDEO_FILE +# Get description from info.json +function info_json_desc() { + info_json "$1" | jq -r .description +} + +# info_json_uploader VIDEO_FILE +# Get uploader from info.json +function info_json_uploader() { + info_json "$1" | jq -r .uploader +} + +# info_json_uploader_url VIDEO_FILE +# Get uploader URL from info.json +function info_json_uploader_url() { + info_json "$1" | jq -r .uploader_url +} + +# info_json_upload_date VIDEO_FILE +# Get upload date from info.json +function info_json_upload_date() { + info_json "$1" | jq -r .upload_date } \ No newline at end of file From 03fd6d51f3317edc5bc6b5d54db2ba951a9f1e2c Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sun, 24 Mar 2024 20:34:29 +0100 Subject: [PATCH 05/10] add echolc --- zsh/std.zsh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/zsh/std.zsh b/zsh/std.zsh index b7ce90a..f25b162 100644 --- a/zsh/std.zsh +++ b/zsh/std.zsh @@ -29,4 +29,12 @@ data_url() { echo "\$ data_url [FILE_PATH]" echo "Turn data into a data URL" fi -} \ No newline at end of file +} + +# usage: echolc FILE ECHO +# output `ECHO` for every line in `FILE`. Useful for the paste command. +function echolc() { + for i in $(seq $(cat "$1" | wc -l)); do + echo "$2" + done +} From e1c6d9fc64376774f3824773f9d1f4b11de92361 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sat, 30 Mar 2024 08:13:43 +0100 Subject: [PATCH 06/10] add jj --- zsh/jj.zsh | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 zsh/jj.zsh diff --git a/zsh/jj.zsh b/zsh/jj.zsh new file mode 100644 index 0000000..26fbea6 --- /dev/null +++ b/zsh/jj.zsh @@ -0,0 +1,2 @@ +alias jpush="jj git push -b main" +alias jpull="jj git fetch && jj rebase -d main" From 04d7c99dc17743f62eb300505acaa6418a4d119b Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sat, 30 Mar 2024 15:08:06 +0100 Subject: [PATCH 07/10] update jj --- zsh/jj.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/zsh/jj.zsh b/zsh/jj.zsh index 26fbea6..79dd7cb 100644 --- a/zsh/jj.zsh +++ b/zsh/jj.zsh @@ -1,2 +1,3 @@ alias jpush="jj git push -b main" alias jpull="jj git fetch && jj rebase -d main" +alias jmain="jj branch set -r @- main" From b22f2c040e328069ffe3d48ad095956999350acd Mon Sep 17 00:00:00 2001 From: JMARyA Date: Sun, 14 Jul 2024 22:43:37 +0200 Subject: [PATCH 08/10] add ripgrep_code_words --- zsh/ripgrep.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zsh/ripgrep.zsh b/zsh/ripgrep.zsh index b4c14ba..92b6c54 100644 --- a/zsh/ripgrep.zsh +++ b/zsh/ripgrep.zsh @@ -24,4 +24,7 @@ alias ripgrep_copyright="$RG $RIPGREP_ARGS '(copyright|\u0026copy;|\\(c\\)|©) * # Development alias ripgrep_todo="$RG $RIPGREP_ARGS 'todo|unimplemented|refactor|wip'" alias ripgrep_review="$RG $RIPGREP_ARGS 'review|deprecated'" -alias ripgrep_fix="$RG $RIPGREP_ARGS 'fix|fixme'" \ No newline at end of file +alias ripgrep_fix="$RG $RIPGREP_ARGS 'fix|fixme'" + +code_words='`([^`]+)`' +alias ripgrep_code_words="$RG $RIPGREP_ARGS ''$code_words'" From 6f496d07b9740db5385a5bd2244f75e8e3f27d69 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Thu, 12 Sep 2024 13:04:07 +0200 Subject: [PATCH 09/10] add route regex --- zsh/ripgrep.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/zsh/ripgrep.zsh b/zsh/ripgrep.zsh index 92b6c54..6267894 100644 --- a/zsh/ripgrep.zsh +++ b/zsh/ripgrep.zsh @@ -25,6 +25,7 @@ alias ripgrep_copyright="$RG $RIPGREP_ARGS '(copyright|\u0026copy;|\\(c\\)|©) * alias ripgrep_todo="$RG $RIPGREP_ARGS 'todo|unimplemented|refactor|wip'" alias ripgrep_review="$RG $RIPGREP_ARGS 'review|deprecated'" alias ripgrep_fix="$RG $RIPGREP_ARGS 'fix|fixme'" +alias ripgrep_rocket_routes="$RG $RIPGREP_ARGS '#\\[(\\w+)\\(\"([^\"]*)\"\\)\\]'" code_words='`([^`]+)`' alias ripgrep_code_words="$RG $RIPGREP_ARGS ''$code_words'" From 661114e69fe55a0e86d4b9d9dfc28fb629eb1bca Mon Sep 17 00:00:00 2001 From: JMARyA Date: Thu, 12 Sep 2024 13:27:57 +0200 Subject: [PATCH 10/10] fix --- zsh/ripgrep.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zsh/ripgrep.zsh b/zsh/ripgrep.zsh index 6267894..e8267b0 100644 --- a/zsh/ripgrep.zsh +++ b/zsh/ripgrep.zsh @@ -25,7 +25,7 @@ alias ripgrep_copyright="$RG $RIPGREP_ARGS '(copyright|\u0026copy;|\\(c\\)|©) * alias ripgrep_todo="$RG $RIPGREP_ARGS 'todo|unimplemented|refactor|wip'" alias ripgrep_review="$RG $RIPGREP_ARGS 'review|deprecated'" alias ripgrep_fix="$RG $RIPGREP_ARGS 'fix|fixme'" -alias ripgrep_rocket_routes="$RG $RIPGREP_ARGS '#\\[(\\w+)\\(\"([^\"]*)\"\\)\\]'" +alias ripgrep_rocket_routes="$RG $RIPGREP_ARGS '#\\[(\\w+)\\(\"[^\"]*\"'" code_words='`([^`]+)`' alias ripgrep_code_words="$RG $RIPGREP_ARGS ''$code_words'"