Digital Tools and Utilities
- Text editor of choice:
Neovim,Helix, Neovim - Visual Studio Code for any more advanced search and replace regex-fu.
- some favorite command line tools:
Digital Tools I’m Trying Out ¶
- Tig - Text-mode interface for Git
- csvkit a suite of command-line tools for converting to and working with CSV
- AltTab - Windows alt-tab on macOS
- dua-cli: view disk space usage and delete unwanted data
Awk ¶
pattern { actions; }
- each line is matched against every pattern, the pattern is optional though
- patterns: regex, boolean expressions, special patterns
- regex has no capture groups
&&
,||
,!
,==
,!=
, and~
and!~
for string comparisonBEGIN
,END
,fields:$0
(the whole line),$1
,$2
. . .$NF
is the last column (NF
is a literal number)NR
the number of records seen so far
awk '/^3/ { ACTION }' file.tsv
awk '$1 ~ "Wes" { ACTION }' file.tsv
awk 'BEGIN { a = 0; }; $1 == $2 { a = a + 1; }; END { print a; };' file.tsv
{ print; }
{ printf("%s %s\n", $1, $2); }
{ exit; } # ends the program
{ next; } # skips to the next line of input
{ a=$1; b=$0 } # variable assignment
{ c[$1] = $2 } # variable assignment (array)
{ if (BOOLEAN) { ACTION }
else if (BOOLEAN) { ACTION }
else { ACTION }
}
{ for (i=1; i<x; i++) { ACTION } }
{ for (item in c) { ACTION } }
- https://c2.com/doc/expense/ - awk expense calculator example
Jujutsu ¶
Jujutsu is a version control system—works on top of git.
jj git init
to create new repositoryjj new
to start on a new changejj describe
to add a comment to the changejj st
to look at the statusjj new
to start another changejj log
to view the repository’s contentsjj split -i
split the change down
Squash Workflow ¶
jj new
an empty changejj desc
to describe what this change will bejj new
another new empty change on top of that- we now make our changes
jj squash
to move the changes from the@
to the empty parent we made when we started the changejj squash -i
for interactive
Edit Workflow ¶
jj new
an empty changejj desc
to describe what this change will be- we now make our changes
- repeat from start with
jj new
if we’re happy with the change - or perhaps we want another change before the current one
jj new -B @ -m "the change before the current one"
- make the change here which will be before the
@
jj next --edit
See also: Tools