1
0

initial commit

This commit is contained in:
2021-03-21 18:25:10 +03:00
parent 9d169e5321
commit 28231f278c
59 changed files with 1653 additions and 0 deletions

14
.config/zsh/lib/curl.zsh Normal file
View File

@@ -0,0 +1,14 @@
#!/bin/zsh
__z_curl_headers() {
command curl -qsI "$@" 2>/dev/null
}
__z_curl_location() {
__z_curl_headers "$1" \
| sed -En '/^[Ll]ocation: (.+)$/{s//\1/;p}'
}
__z_curl_response() {
__z_curl_headers -L "$1" \
| sed -En '/^HTTP\/[0-9.]+ ([1-5][0-9]{2})( .+)?$/{s//\1/;p}' \
| tail -n 1
}