Assah Bismark

APIs & Data

How to Read Hacker News Threads with Most Recent Comments First

Learn how to read HN threads in reverse chronological order.
Hacker News displays comments in a tree structure, which can make it difficult to track the latest updates in a conversation. To address this, I explored three different methods to sort and read Hacker News comments by most recent first. Here's how you can do it, starting from the simplest approach....More ›

How to use cURL to interact with GraphQL APIs.

How to use cURL to interact with GraphQL APIs.
Running GraphQL queries from the command line using can be made simple and readable. Here's an example of how to query the GitHub GraphQL API using , tested in both and . Replace with your GitHub API personal access token. This command constructs and submits a GraphQL query encoded in JSON, using...More ›

How to retrieve a GraphQL schema from an endpoint.

How to retrieve a GraphQL schema from an endpoint.
The GraphQL schema language is a concise way to represent the available schema provided by a GraphQL endpoint. It looks something like this: You can retrieve a JSON version of this from the GraphQL server itself using the query at the bottom of this document. But... if you want it back in readable t...More ›

Programmatically Access Postgres

How to access Postgres programmatically from your application.
The db-to-sqlite tool can connect to a PostgreSQL database, export all of the content, and write it to a SQLite database file on disk. This guide demonstrates how to integrate this process into a GitHub Actions workflow, allowing programmatic access to a Heroku PostgreSQL database. Overview Heroku p...More ›

jq Array of Array Object

Example of handling arrays of array objects in jq.
Input: I want an array of objects. Here's what I came up with, using jqplay.org: This outputs: If you remove the outer and and use the "Compact output" option you get back this instead:More ›