Skip to content

Instantly share code, notes, and snippets.

@atnan
Created January 16, 2009 05:38
Show Gist options
  • Save atnan/47833 to your computer and use it in GitHub Desktop.
Save atnan/47833 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
begin
puts JSON::pretty_generate(JSON::parse(STDIN.read)).strip
rescue
STDERR.write('Failed to parse JSON')
exit 1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment