Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is wild. I figured it was going to be something about reusing password but no it’s just a treasure trove of secrets from folks formatting JSON and saving it to a public link. I can’t for the life of me understand why anyone would do this, I haven’t used a language which doesn’t have some sort of pretty print functionality built into the common/standard JSON library.

What’s crazier is everyone’s browser can do this with like a single line of code:

> JSON.stringify(data, null, 2)

I suppose it’s technically two lines if you assign the JSON to a variable (like ‘data’ above) first.

My mind has been truly blown by this one.



What's crazier is that a lot of it is not even JSON, so it's not being formatted at all.


one if you do `copy(JSON.stringify(data,{}, 2))`. A very useful tool when you need to get the auth token from here over to there!

Also if you are someone who needs JSON then install jq and do `pbpaste | jq . | pbcopy`.


Is jq not pre installed?


Yow you're right. I've got one at /usr/bin as well as the one I thought I had to install. What a world!!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: