GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    clacke (clacke@libranet.de)'s status on Friday, 16-Jan-2026 17:46:37 JST clacke clacke
    • Hacker Public Radio

    I gave the team a half-hour crash course in jq, some of the key features of its data and execution model, and how to do a handful of useful everyday things.

    After, I had so many questions for myself that I spent over an hour learning more jq. I now have a greater understanding for how brilliant the language is, and I would do that crash course differently.

    I think I owe @hpr an episode, if there isn't one.

    I found many cheat sheets and liked none of them. A cheat sheet would be perfect to go in the show notes.

    #jq

    In conversation about 6 months ago from libranet.de permalink
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Friday, 16-Jan-2026 17:55:33 JST clacke clacke
      in reply to

      In Github Actions, jq comes pre-installed in the default worker. This can save you a lot of headache. Don't try to manipulate JSON with bash or Python, that's just clunky and error-prone when you can use jq instead.

      I rewrote some of my own code from half a year ago. It's now shorter, more readable (if you know jq – hence the crash course), has zero quoting issues and provides better error messages.

      #GithubActions

      In conversation about 6 months ago permalink
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Friday, 16-Jan-2026 17:58:53 JST clacke clacke
      in reply to

      A team member suggested we might want to replace some or all of our jinja use with jq. Makes sense. Would save us some Python setup too, which would simplify things.

      There is yq for yaml as well, but JSON is valid yaml, so jq is enough.

      In conversation about 6 months ago permalink
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Friday, 16-Jan-2026 19:28:35 JST clacke clacke
      in reply to

      This is data-oriented programming. And the simplest forms of it looks just like the data. The brilliance of the language is on several planes:

      - The syntax: Superficially it looks like JSON, but there is so much more going on, e.g. [1, 2, 3] is not a list ... it's three constant filters whose outputs are coalesced into a list ... but it looks just like a list in JSON!

      - The library: The language has a few primitives, and most of the functions you see are or can be implemented in the langage itself, using those primitives, including the all-important select(). It gives me LISP goosebumps.

      - The data model: How the idea of multiple values, immutability and pipes-and-filters seeps into everything and allows for some very simple yet powerful operations that would be awkward in almost any other language.

      You come for something that can extract an attribute in a datastructure for you, and it excels at that, and then as you dig deeper, you discover that underneath, it's a fusion-powered nanorobot assembly factory.

      It's wonderful to see Small Languages make a comeback.

      #jq

      In conversation about 6 months ago permalink

      Attachments


    • Embed this notice
      clacke (clacke@libranet.de)'s status on Saturday, 17-Jan-2026 22:07:14 JST clacke clacke
      in reply to
      • AN/CRM-114

      @flyingsaceur We don't; Embedding a jq call in a shell script feels like the normal way to do it.

      If we put the jq code in a file instead of inline, is there tooling that could check it, that could prove something about it?

      In conversation about 6 months ago permalink
    • Embed this notice
      AN/CRM-114 (flyingsaceur@ioc.exchange)'s status on Saturday, 17-Jan-2026 22:07:15 JST AN/CRM-114 AN/CRM-114
      in reply to

      @clacke it’s kind of amazing that forty years later we have a new tool to add to the coreutils box

      Maybe there’s something out there that fills this gap, but it bugs me that jq tends to be embedded as a string in shell scripts or YAML the way that awk is embedded in shell scripts or shell scripts get embedded in YAML and then the tooling isn’t there to check it: a hole where bugs can sneak in. How do you handle these cases?

      In conversation about 6 months ago permalink
      clacke likes this.
    • Embed this notice
      Ken Fallon (PA7KEN, G5KEN) (ken_fallon@mastodon.sdf.org)'s status on Saturday, 17-Jan-2026 22:08:10 JST Ken Fallon (PA7KEN, G5KEN) Ken Fallon (PA7KEN, G5KEN)
      in reply to
      • Dave Morriss
      • Hacker Public Radio

      @clacke i think @perloid also had shows on the topic.

      I'd love to hear this.

      @hpr

      In conversation about 6 months ago permalink
      clacke likes this.
    • Embed this notice
      Dave Morriss (perloid@mastodon.sdf.org)'s status on Saturday, 17-Jan-2026 22:08:26 JST Dave Morriss Dave Morriss
      in reply to
      • Hacker Public Radio

      @clacke

      @hpr

      I have done three jq episodes. I have the next waiting to record. I had something of a burnout in 2024 after 12 years of HPR janitorial work! It's been difficult to resume making shows. Now I'm 76 my energy is less also.

      In conversation about 6 months ago permalink
      clacke likes this.
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Saturday, 17-Jan-2026 22:13:41 JST clacke clacke
      in reply to
      • Ken Fallon (PA7KEN, G5KEN)
      • Dave Morriss
      @ken_fallon I'll check it out. Knowing @perloid 's past work, they're probably the jq reference I've been looking for that I'd want to share with others. 🥰
      In conversation about 6 months ago permalink
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Monday, 19-Jan-2026 20:33:26 JST clacke clacke
      in reply to
      • Ken Fallon (PA7KEN, G5KEN)
      • Dave Morriss

      @perloid Read the show notes a bit and saw a challenge I couldn't resist:

      hackerpublicradio.org/eps/hpr4…

      As a point of interest, I wrote a little Bash loop to show the positive and negative offsets of the characters in the test string - just to help me visualise them.

      Could I do this in jq? I could!

      $ echo '"asdf"' | jq -c '. as $in | [ range(length) | . as $i | { "key": "\(.)", "value": ( $in | explode | [.[$i]] | implode ) } ] | from_entries' {"0":"a","1":"s","2":"d","3":"f"}

      Negative indexes left as an exercise for the reader.

      @ken_fallon

      In conversation about 6 months ago permalink
    • Embed this notice
      Dave Morriss (perloid@mastodon.sdf.org)'s status on Monday, 19-Jan-2026 20:33:27 JST Dave Morriss Dave Morriss
      in reply to
      • Ken Fallon (PA7KEN, G5KEN)

      @clacke @ken_fallon
      The show numbers of the episodes I have already done are: 4104, 4114, and 4227

      I will strive to record and upload the fourth in the next couple of weeks.

      In conversation about 6 months ago permalink
    • Embed this notice
      clacke (clacke@libranet.de)'s status on Friday, 30-Jan-2026 12:59:55 JST clacke clacke
      in reply to

      TIL #jq can do HTML/XML escaping, URI encoding, URI decoding, shell quoting, even base64 encoding and decoding.

      This will come in handy for sure.

      jqlang.org/manual/#format-stri…

      In conversation about 5 months ago permalink

      Attachments


    • Embed this notice
      clacke (clacke@libranet.de)'s status on Friday, 30-Jan-2026 12:59:56 JST clacke clacke
      in reply to

      Turns out that not only do Actions runners come with jq preinstalled, but yq is there too.

      hollycummins.com/using-yq-in-g…

      There was a featured snippet for “is yq available on GitHub actions,” which directed me to a marketplace installer. The yq project itself had a marketplace installer. Clearly, I needed to install it before using it. Right?

      My colleague George Gastaldi looked at what I’d done, and pointed out yq was available on the runners. This matters, because we try and limit our use of external, ‘non-official’ actions, for supply chain security reasons.

      So I searched again to confirm, and … still found very little. To actually confirm, I had to merge and experiment. And, indeed, the GitHub runners do come with yq pre-installed. They’ve had yq since 2021.

      #yaml #yq #jq #GithubActions
      #CICD
      #ContinuousIntegration
      #ContinuousDeployment

      In conversation about 5 months ago permalink

      Attachments



    • Embed this notice
      clacke (clacke@libranet.de)'s status on Friday, 30-Jan-2026 12:59:57 JST clacke clacke
      in reply to
      ... and csv!
      In conversation about 5 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.