Using jq to manipulate JSON in command line

Sometimes during the testing of REST API with curl in the command line, we need to process JSON from the response to present it in readable format or check a specific key or value. I used jq utility for that purpose and didn’t pay too much attention to how powerful it can be:

curl https://mysuperapi.com/superendpoint | jq

Recently, I found this article showed many cool examples of using jq. For example, to get a list of all sensors from this JSON:

[
    {
        "name": "Station1",
        "location": "Centerville",
        "sensors": ["temperature", "humidity"]
    },
    {
        "name": "Station5",
        "location": "Anytown",
        "sensors": ["temperature", "humidity", "rainfall", "wind_speed"]
    }
]

the following command can be used:

curl https://mysuperapi.com/superendpoint | jq -r '.[] .sensors[]'

The result will be like this:

temperature
humidity
temperature
humidity
rainfall
wind_speed

Codemotion online tech conference – October 20-22, 2020

The multitrack tech conference made by developers for developers Codemotion will take a place online October 20-22, 2020. Topics to be covered are:

  • Software architecture and security
  • Frontend and design
  • AI and machine learning
  • Effective developers and teams

They are two types of tickets – free and 90 EUR. The paid one includes workshops, QA sessions, the ability to watch a recorded stream a week after the event.

Built and Launched a Product in 14 Hours

Many of us have pet projects we never finish. This article shows how to complete your project in 14 hours from idea to live product! Sure, your project can be more complicated and may take more time. In any case this article will be helpful in terms of services used by author as well as inspiration to bring your idea live.

Choosing new mobile phone

It’s time to replace my old Nokia E65. I like that phone. Regardless its problem with alarm. So, I made decision about platform easily – Android (IMHO it’s the most perspective platform for mobile devices). But to choose the phone wasn’t so simple. The potential variants were following: HTC Desire, HTC Wildfire, Samsung Galaxy 551 and Samsung I5800 Galaxy 3. But the winner even wasn’t in that list. It’s Motorola Defy. Why I chose it? Well, first of all I like its design and Gorilla Glass display with resolution 480×854. Also it has very good spec – 800MHz processor, 2 GB storage, 512 MB RAM, microSD slot (supports cards up to 32GB), 5MP camera. It run Android OS, v2.1 (Eclair), upgradable to v2.2. And finally, Motorola Defy is dust-proof, water-resistant (check the awesome video after below) and has very reasonable price – around €350.00. So, I’m going to buy it this weekend if it’ll be available in the Cyprus shops, of course.

Continue reading Choosing new mobile phone