Skip to content

Instantly share code, notes, and snippets.

@mccv
Created August 10, 2012 23:50
Show Gist options
  • Save mccv/3319045 to your computer and use it in GitHub Desktop.
Save mccv/3319045 to your computer and use it in GitHub Desktop.
jsonator
# stick this in .bashrc
# jsoncurl <thing that outputs json on one line so you can't read it>
function jsonator {
ruby -rubygems -r pp -e 'require "json"; ARGF.each {|l| puts JSON.pretty_generate(JSON.parse(l))}'
}
function jsoncurl {
curl -s $@ | jsonator
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment