Format JSON documents on the command line

August 31st, 2012 by exhuma.twn

I tend to test my REST services using curl. Most of the time the JSON responses are not pretty-printed, which makes testing larger documents a pain. Copy pasting the results in online JSON formatters was really getting annoying. So I wrote a few lines of python to do that job for me. Note that this is a two-minute-hack and by no means very generic. It works for me, and with curl. The handling for Headers is especially eerie 😛 But maybe you will still find it useful.

Without further ado, here it is:


pip install jsonf


easy_install jsonf


Posted in Uncategorized | No Comments »

Update to bash completion for fabric tasks.

August 20th, 2012 by exhuma.twn
cURL error 28: Connection timed out after 5001 milliseconds
Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /var/www/ Stack trace: #0 /var/www/ embed_github_gist('2136677', NULL, '1', NULL) #1 /var/www/ handle_embed_github_gist_shortcode(Array, '', 'gist') #2 [internal function]: do_shortcode_tag(Array) #3 /var/www/ preg_replace_callback('/\\[(\\[?)(gist)(...', 'do_shortcode_ta...', '<p>In a <a href...') #4 /var/www/ do_shortcode('<p>In a <a href...') #5 /var/www/ WP_Hook->apply_filters('<p>In a <a href...', Array) #6 /var/www/ apply_filters('the_content', 'In a <a href="h...') #7 /var/www/ in /var/www/ on line 86