Skip to content

Instantly share code, notes, and snippets.

@Kirill89
Last active March 19, 2019 11:41
Show Gist options
  • Save Kirill89/df74638b80ac25ac23ea997b89fd7b59 to your computer and use it in GitHub Desktop.
Save Kirill89/df74638b80ac25ac23ea997b89fd7b59 to your computer and use it in GitHub Desktop.
edit64 - base64 editor. Usage: copy base64 encoded text -> run edit64 in your terminal -> paste updated base64 string
# put it into your ~/.zshrc
edit64()
{
DECODED=$(pbpaste | base64 --decode)
TMP=$(mktemp)
echo "Temporary file: $TMP"
echo "$DECODED" > "$TMP"
vi "$TMP"
UPDATED=$(cat ${TMP})
echo "$UPDATED" | base64 | pbcopy
rm "$TMP"
echo "Deleted: $TMP"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment