Compare commits

...

10 commits

Author SHA1 Message Date
661114e69f
fix 2024-09-12 13:27:57 +02:00
6f496d07b9
add route regex 2024-09-12 13:04:07 +02:00
b22f2c040e
add ripgrep_code_words 2024-07-14 22:43:37 +02:00
04d7c99dc1
update jj 2024-03-30 15:08:14 +01:00
e1c6d9fc64
add jj 2024-03-30 08:14:34 +01:00
03fd6d51f3
add echolc 2024-03-24 20:34:29 +01:00
b03d2641c3
update + yt-dlp 2024-03-13 22:12:02 +01:00
564e956ba4
add info_json fn 2024-03-11 09:43:41 +01:00
816b023e71
fix 2024-03-07 02:49:33 +01:00
6a44cfc35f
fix 2024-03-07 02:39:25 +01:00
5 changed files with 68 additions and 7 deletions

View file

@ -17,7 +17,7 @@ alias cat="bat -p"
alias gfold="gfold -d classic" alias gfold="gfold -d classic"
function hs() { function hs() {
$(cat ~/.zsh_history|sk) rg "$1" ~/.zsh_history
} }
alias notes="codium ~/Notes" alias notes="codium ~/Notes"

3
zsh/jj.zsh Normal file
View file

@ -0,0 +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"

View file

@ -1,6 +1,9 @@
#RG="rg" # Parameters
RG="rga" # You can on the fly reassign the values and update all the aliases with `zshrefresh`
RIPGREP_ARGS="-i --no-ignore-vcs"
#RG="${RG:-rg}"
RG="${RG:-rga}"
RIPGREP_ARGS="${RIPGREP_ARGS:--i}"
# Common Data # Common Data
alias ripgrep_data_urls="$RG $RIPGREP_ARGS 'data:(.*?)(;base64)?,(.*)'" alias ripgrep_data_urls="$RG $RIPGREP_ARGS 'data:(.*?)(;base64)?,(.*)'"
@ -19,5 +22,10 @@ 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}'" alias ripgrep_copyright="$RG $RIPGREP_ARGS '(copyright|\u0026copy;|\\(c\\)|©) *[12][0-9]{3}'"
# Development # 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_fix="$RG $RIPGREP_ARGS 'fix|fixme'" 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'"

View file

@ -29,4 +29,12 @@ data_url() {
echo "\$ data_url [FILE_PATH]" echo "\$ data_url [FILE_PATH]"
echo "Turn data into a data URL" echo "Turn data into a data URL"
fi fi
} }
# 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
}

View file

@ -15,4 +15,46 @@ alias downloadYT="yt-dlp --write-thumbnail \
function downloadList() { function downloadList() {
cat $1 |xargs -I _ yt-dlp --downloader aria2c _ cat $1 |xargs -I _ yt-dlp --downloader aria2c _
}
# info_json VIDEO_FILE
# Extract info.json from video file
function info_json() {
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
} }