Live data from Hacker News

Show HN: JSON Pizza – Beautify your JSON quickly

json.pizza

61–70 of 81 posts

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#61
post #19

Not to threadcrap, but I am curious what people think about this. Over the years I've seen a lot of developers take none open-source code, or private JSON data strings and paste them into random sites they find searching "json format" on google. Does that make anyone else cringe? Is there anything we can do about this? Or is this just not a big deal and I shouldn't worry.

It should be noted that this particular site works without sending any data back to the server.

Aside from that, this is one area where web-based applications excel: You can inspect and limit what data an application is sending away about you via your browsers built-in dev tools and extensions like uMatrix (or your own request-filtering extensions).

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#62
post #55
post #36

Earlier quoted context omitted.

Still too dangerous, and I don't trust new developers to make that determination. Once you get into the habit of pasting development details into random website textboxes hosted who-knows-where with who-knows-what ad networks, you're one keystroke away from leaking sensitive details that are correlated to your employer's IP range. Or maybe I'm a crank and need to lighten up. That's why I'm asking.

It's a reasonable thing to worry about. Bad actors exist. IP is valuable. Computers are insecure. People are lazy. You have to be careful out there. > I don't trust new developers to make that determination. Ignoring this issue is a sign of professional immaturity. Recommend you view it as an opportunity to educate the younger members of your team. Show them the power of a solid CLI toolbox that respects your privacy…

I agree 100%, perhaps I could have phrased that better. I try to use it as a teachable moment: "Hey, instead of using base64decode.org did you know you could use atob and btoa in a web inspector?"

Security-related scanners are a tough one though. Free XSS scanners, free TLS cert checkers: The best intentions can result in unintended disclosure. Developers have it constantly beaten into their head "Security! Security! Security!" and are often given nothing more than an OWASP cheat-sheet, so I can totally understand and empathize with the thought process that leads someone to plug a company URL into a free web-hosted XSS scanner.

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#65

Feedback: First time through I just pasted some JSON and wondered why it didn't format. I hadn't realised the page had instructions on it – I had assumed it was just sample JSON. Second time through, I read the instructions, and realised that the keyboard shortcuts are Control-based – this is less common for macOS, "Cmd+Enter" feels like a more consistent shortcut to use. I think this should probably just auto-format…

At least that guy got what he needed quickly instead of debating 5000 ways to do the same thing on HN.

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#66

OS X includes the json_pp command, so I often just do this to format JSON in my clipboard: pbpaste | json_pp | pbcopy For just viewing, I like Node's console.dir() formatting better since it's more compact and colored (but it's unquoted JS objects, not JSON), so I aliased this command in my shell: json='node -e '\''console.dir(JSON.parse(fs.readFileSync("/dev/stdin", "utf-8")), { depth: null })'\' Then I can do pbpas…

My favourite hack is that jf you have a python installation (common on most Linux/Mac environments), you likely can use `python -mjson.tool` https://www.jvt.me/posts/2017/06/05/pretty-printing-json-cli...

But I've also written about how to do it with various stacks for various things at https://www.jvt.me/tags/pretty-print/

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#67
post #26
post #19

Not to threadcrap, but I am curious what people think about this. Over the years I've seen a lot of developers take none open-source code, or private JSON data strings and paste them into random sites they find searching "json format" on google. Does that make anyone else cringe? Is there anything we can do about this? Or is this just not a big deal and I shouldn't worry.

You can do the same in the browser console. I don't really get why people need an online tool for this: copy(JSON.stringify(obj, null, 2)) obj can be parsed with JSON.parse if it is in text.

> I don't really get why people need an online tool for this:

That’s rather condescending, and probably not true. Surely you must be able to think of reasons why someone would use a website instead of writing a one-line program.

Re: Show HN: JSON Pizza – Beautify your JSON quickly

#68
post #27
post #19

Not to threadcrap, but I am curious what people think about this. Over the years I've seen a lot of developers take none open-source code, or private JSON data strings and paste them into random sites they find searching "json format" on google. Does that make anyone else cringe? Is there anything we can do about this? Or is this just not a big deal and I shouldn't worry.

I had a junior dev show me a neat site where you can paste in a Java thread dump and it performs an analysis. After explaining why it's a bad practice to send diagnostic details to an un-trusted third party I think he understood, but it seems like every week I'm finding people using ngrok, unauthorized password managers, grammarly, JWT parsers, Base64 encoders, and all manner of questionable tools. I too wonder if I'…

How are any of those questionable tools?

Sure, don't put arbitrary shit on the internet and know where your data is going. But every example you gave is incredibly useful to many people on a daily basis.

Post reply on HN