Skip to content

Instantly share code, notes, and snippets.

@Zash
Zash / .gitconfig
Last active June 26, 2023 11:20
git config, aliases etc
[pull]
ff = only
[commit]
verbose = true
[alias]
amend = commit --amend --no-edit
ci = commit
co = checkout
each = submodule foreach git
fa = fetch --all -p
@Zash
Zash / xkb-symbols-zdvorak
Created September 16, 2023 12:35
My custom keyboard layout
// Zashs Swedish Dvorak
// setxkbmap -I$HOME/.xkb prog -print | xkbcomp -I$HOME/.xkb - $DISPLAY
partial alphanumeric_keys
xkb_symbols "zdvorak" {
include "se"
include "se(dvorak)"
name[Group1]="Sweden - Zashs Dvorak";
@Zash
Zash / git-grondiff.bash
Last active March 1, 2024 12:44
git-diff json
#!/bin/bash
set -euo pipefail
case $# in
1)
diff -u --color --label="$1 @ HEAD" --label="$1" <(git show "HEAD:$1" | yq4 -oj | gron) <(yq4 -oj "$1" | gron)
;;
2)
diff -u --color --label="$1 @ $2^" --label="$1 @ $2" <(git show "$2^:$1" | yq4 -oj | gron) <(git show "$2:$1" | yq4 -oj | gron)
;;
@Zash
Zash / yedit.sh
Last active May 7, 2024 16:03
In-place editing of json/yaml
#!/bin/bash
# Yaml EDIT
# Uses https://github.com/mikefarah/yq/
set -euo pipefail
declare file=""
declare editformat="yaml"
declare origformat="yaml"
declare editsuffix=""
declare path="." # path to what to edit