Skip to content

Instantly share code, notes, and snippets.

@alecbw
Created May 16, 2021 01:56
Show Gist options
  • Select an option

  • Save alecbw/dd1351be0c7fe906ec6ef6dacffcf42f to your computer and use it in GitHub Desktop.

Select an option

Save alecbw/dd1351be0c7fe906ec6ef6dacffcf42f to your computer and use it in GitHub Desktop.
A quick oneliner you can add to your .bash_profile to pretty print the contents of your clipboard.
# Takes the contents of the clipboard, replaces apostrophes (') with quotation marks (") and replaces titlecased bools (True/False) with JSON acceptable lowercase, then pretty prints
function pjson() {
pbpaste | sed "s/'/\"/g" | sed "s/True/true/g" | sed "s/False/false/g" | json_pp
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment