Skip to content

Instantly share code, notes, and snippets.

@Jun-Dai
Last active August 26, 2020 10:14
Show Gist options
  • Save Jun-Dai/b802132f71bacfe492dc2ba55ccc610b to your computer and use it in GitHub Desktop.
Save Jun-Dai/b802132f71bacfe492dc2ba55ccc610b to your computer and use it in GitHub Desktop.
Random functions handy to have in my .zshrc
source ~/Dropbox\ \(Personal\)/gists/open-note/open-note.sh
xargy () {
tr \\n \\0 | xargs -0 $@
}
jqchars () {
for i in $(jq "$1 | keys" $2 | grep '"' | cut -d '"' -f 2); do
echo "$i: `jq ${1%.}.$i $2 | wc -c | xargs echo`"
done
}
mkcdir ()
{
mkdir -p -- "$1" &&
cd -P -- "$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment