nilmethod, to til

python -m json.tool my_json.json to prettify json at the cli. i've done such shenanigans in the interpreter but never considered executing it with -m like one might for a temporary HTTP server or other niceties.

mjgardner,
@mjgardner@social.sdf.org avatar

@postmodern It’s literally the first example in the manual: https://jqlang.github.io/jq/manual/v1.7/#invoking-jq

anderseknert, to devops
@anderseknert@hachyderm.io avatar

Tonight I’m playing with , a tool originally intended as a replacement using as its query language, but which eventually grew to be useful for format transformations, and now a full-blown environment. All powered by . Madness, obviously, but just the right kind of madness.

https://sr.ht/~charles/rq/

bagder, to random
@bagder@mastodon.social avatar

did its first release in 5 years yesterday, now under a brand new github org and everything:
https://jqlang.github.io/jq/

KevinGimbel, to random
@KevinGimbel@fosstodon.org avatar
mate, to random French
@mate@3615.computer avatar

compare two JSONs with jq

"jq diff json"

https://gist.github.com
/ipan/e5e86d5495f16216e31fe12ebc9532a4

wader,
@wader@fosstodon.org avatar

@mate i use this diff function from time to time https://gist.github.com/wader/4163da796082c3ddaf32e4602547c604 might be interesting

(link seems to have new line btw)

geekland, to linux Spanish
@geekland@mastodon.social avatar
manu, to opensource
@manu@hachyderm.io avatar

There’s a new jq release out. The first one in 5 years! Lots of big and little improvements thanks to a whole new maintainer team! So good to see that this great tool lives on! https://github.com/jqlang/jq/releases/tag/jq-1.7rc1

wader, to random
@wader@fosstodon.org avatar

Not so known fact: Last stable release was in 2018 😬

Since then there has been lost of bug fixes and improvements but the maintainers ran out of interest and stream. There has been a few attempts at creating a new org that have stalled. But last week the original author stedolan show up and blessed the new org and transfer the repo to https://github.com/jqlang. We're currently working on cleaning up and fixing broken CI, etc and hopefully there will be a new release! 🥳

starbreaker, to random

I wanted to create a "jukebox" page for my where I list albums in my collection.

I could just write in but if the page gets big enough it'll be a pain.

Besides, I'm a techie by trade, I can automate this. I figure I'll use a and a that looks for two files:

"${BAND}.tsv": tab separated, 2 fields: band name, band description
"${BAND}.psv" pipe separated, 4 fields: year, album, label, MusicBrainz link

Then I can update my .

testing my "jukebox.sh" shell script in a terminal window. It prints Markdown text to standard output and appears to work.

starbreaker,

@beekir I could dump my library to and then process that with to generate my jukebox page, but I'd have to update each album to get accurate label/release information from MusicBrainz.

ctietze, to random
@ctietze@mastodon.social avatar

Is it at all possible to use jq to replace JSON values with the output of a custom command?

Example: parse the value as a date, then add 3 days, then make this a string; replace the old value with this one.

The replacing itself with is simple, but I can't figure out how to "pipe" values

ctietze,
@ctietze@mastodon.social avatar

Maybe this is a case for to pretty-print the , then / to replace values?

wader,
@wader@fosstodon.org avatar

@ctietze Sadly there is no shell function but your in luck for this case as I already have some duration helpers laying around that I tweaked a bit

https://gist.github.com/wader/5f8965a4db73db0d79496d6fcfbdca7a

Use like this:
$ jq -L . 'include "duration"; map(.duration |= (from_duration | to_fancy_duration)) ' <<< '[{ "duration" : "1:25:00" }, { "duration" : "10:00" }]'
[
{
"duration": "1h 25mins"
},
{
"duration": "10mins"
}
]

qmacro, to random
@qmacro@hachyderm.io avatar

New post: Improving my interactive workflow with ijq, and .

I'm a big fan of ijq and how it allows me to explore data interactively with jq expressions. With a small script I have improved my workflow by being able to capture the jq expression from ijq and use it easily on the command line.

https://qmacro.org/blog/posts/2023/04/27/improving-my-interactive-jq-workflow-with-ijq-bash-and-tmux/

Share & enjoy!

m0bi13, to mastodon Polish
@m0bi13@mastodon.social avatar

Po ostatnim poście o grupach Guppe Groups odbyłem kilka bardzo ciekawych rozmów.

Pojawiał się m. in. stale wracający temat: "nie widać poprzednich postów". Czyli problem braku -a w

Napisałem mały artykuł na moim blogasku o tym, z czego to wynika i jak sobie poradzić.

Zapraszam do lektury:

https://zb3.org/m0bi13/jak-pobrac-liste-ostatnich-postow-dla-grupy-guppe-groups

P.S. Będziemy używać linii poleceń, , i API, więc materiał raczej dla power-users.
Do porannej kawusi ☕ :)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • kavyap
  • thenastyranch
  • ethstaker
  • osvaldo12
  • mdbf
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • Youngstown
  • ngwrru68w68
  • slotface
  • GTA5RPClips
  • rosin
  • megavids
  • cubers
  • everett
  • cisconetworking
  • tacticalgear
  • anitta
  • khanakhh
  • normalnudes
  • Durango
  • modclub
  • tester
  • provamag3
  • Leos
  • lostlight
  • All magazines