![]() Here is what you need to know: □Īlias gwip='git commit -a -m "work in progress - fixup"' I use this alias all the time and it gives me confidence that I can always get back to my last good state. I never really mastered it and it was a challenge each time I tried to use it. Jq is great for pretty-printing JSON but it does so much more. I’d love to hear your feedback, or if you have any tips of your own. You can define you own functions and even find primes with jq:įast, repeatable CI/CD with an instantly familiar syntax – like Dockerfile and Makefile had a baby. The jq query language is a full programming language and you can do lots of exciting things with it. So far I’ve only covered the basics of jq. Of course, these things rarely come up, but after writing all this, I’m hooked on this tool.ĭoing all this isn’t necessary, but if you follow me in some of these steps, I think using jq will become second nature. ![]() Lastly, to deepen my knowledge, I’m learning about recursive descent, declaring variables, and defining functions and advanced features found in the manual. Whether it’s exploring a REST API or looking at docker inspect results, JSON is everywhere, so opportunities abound. At least for the next little while, even if there is an easier way to do it. So when I have a task that can be solved using jq, then it is what I use. If you don’t use a tool, you will never master it. So over time, my retention should improve. Often, I still need to look something up, but science has shown that repeated retrieval yields retention. If memory fails me, sometimes jqterm, which has auto-completion, is helpful. Whenever I need to extract data or transform a JSON document, I try to do it first without looking anything up. Jq-tutorial is not a tutorial at all, but a collection of around 20 interactive exercises that test you knowledge of jq. Here is my process for cementing this knowledge: 1. Reading about (or writing about) a tool is not enough to master it. ![]() The simplest filter is the identity filter which returns all its input (. To use it, you construct one or more filters, and it applies those filters to a JSON document. I install it with brew ( brew install jq), but it’s a single portable executable, so it’s easy to install on Linux, Windows, or macOS. Jq is a lightweight, command-line JSON processor. Of course, you still might occasionally need to head to google to find a function name or check your syntax, but at least you’ll have a firm grounding in the basics. In this article, I’m going to go over the basics building blocks of jq in enough depth that you will be able to understand how jq works. So I solve my problem but never learn the tool. I know it’s a powerful tool, but I always end up back at Google and then copying and pasting a solution from somewhere. However, some things never stick in my head, nor my fingers, and I have to google them every time. Other actions, I know how they work, but I have to think about them every time. The same way my fingers know the vim key bindings, they know gwip. It happens without conscious thinking on my part. Whenever I reach a stopping point in my work, I use a bash alias called gwip 1 to create a ‘work in progress’ commit. This article is about JSON and using JQ but if you’re interested in a different approach to building software then check us out. We make building software simpler and therefore faster.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |