ORG=...
REPO=...
DEST_FOLDER=...
# just clone main branch, without tags, and don't fetch blobs over 1MB
FETCH_OPTIONS='--no-tags --single-branch --filter=blob:limit=1m'
caffeinate -d unbuffer \
export PATH=$(zsh -l -c 'echo $PATH')
or shell agnostic
# 1. Detect the parent process name
parent_shell=$(ps -p $PPID -o comm= | tr -d '-') # tr removes the leading dash if it's a login shell
# 2. Map the process name to a valid binary path
$ git branch -d foobar
> cannot lock ref ..> foobar.lock: File exists.
$ git update-ref -d foobar
✅
git depth 2 is substantially different than git depth 1 when trying to git push:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ``` | |
| git rebase | |
| ``` | |
| ``` | |
| remote: Enumerating objects: 31850, done. | |
| remote: Counting objects: 100% (10345/10345), done. | |
| remote: Compressing objects: 100% (10334/10334), done. | |
| remote: Total 31850 (delta 34), reused 11 (delta 11), pack-reused 21505 (from 1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let md5 = str => require('crypto').createHash('md5').update(str).digest("hex") |
On MacOS, cmd-tab only toggles between different apps. To toggle between different windows of the same app, you need to use cmd-` . However this is cumbersome for regular usage, as it requires stretching your fingers unnaturally. This rule allows to use cmd-CapsLock instead, which is much easier.
- Install Karabiner Elements and give it all permissions it asks for
cd ~/.config/karabiner/assets/complex_modificationsand put the json file below there- Restart Karabiner Elements
- Go to "Complex Modifications > Add rule"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ jq --version | |
| jq-1.6 | |
| --- | |
| bash-3.2$ jq --null-input --compact-output --raw-output --monochrome-output --arg test 'A\nB' '{test: $test}' | |
| {"test":"A\\nB"} | |
| bash-3.2$ OUT=$(jq --null-input --compact-output --raw-output --monochrome-output --arg test 'A\nB' '{test: $test}'); echo $OUT | |
| {"test":"A\\nB"} | |
NewerOlder