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
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:
| ``` | |
| 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) |
| 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.
cd ~/.config/karabiner/assets/complex_modifications and put the json file below there| $ 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"} | |
| git log --since="27 SEP 2021" --until="28 SEP 2021" --pretty='%ci %h %s %cn %ce ' | grep 'Merge pull' | |
| # 2021-09-27 19:22:53 +0200 2bd0ea1b765 Merge pull request #123 from org/repo GitHub noreply@github.com |