$ 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 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 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_modifications
and put the json file below there- Restart Karabiner Elements
- Go to "Complex Modifications > Add rule"
This file contains 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"} | |
This file contains 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 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 |
This file contains 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
import * as fsp from 'fs/promises'; | |
import { dirname } from 'path'; | |
import { fileURLToPath } from 'url'; | |
// eslint-disable-next-line no-underscore-dangle | |
const __dirname = dirname(fileURLToPath(import.meta.url)); | |
const dirNameLen = __dirname.length; | |
const file = await fsp.readFile('../trace.json'); | |
const trace = JSON.parse(file); |
NewerOlder