Notes on software engineering

Archive / page 24

461–480 of 547 posts, newest first.

  1. 2023
  2. Using ChatGPT Browse to name a Python package

    I needed a name for my new Python CLI tool. It was originally called because I checked and https://pypi.org/project/py-grep/ was available - but when I tried to push the package to PyPI I got an error…

    4 min read
  3. Rendering Markdown with the GitHub Markdown API

    I wanted to convert the Markdown used in my TILs to HTML, using the exact same configuration as GitHub does.

    1 min read
  4. A simple pattern for inlining binary content in a Python script

    For simonw/til issue 82 I needed to embed some binary content directly in a Python script. I wanted to wrap that content to fit within 80 columns.

    1 min read
  5. Redirecting a domain using Cloudflare Pages

    I wanted to redirect https://global-power-plants.datasettes.com/ to https://datasette.io/ - I decided to spin up a Cloudflare Pages site to do the work.

    1 min read
  6. Concatenating strings and newlines in Google Sheets

    I was asked if there was a way to run shot-scraper against a list of URLs in a Google Sheet. I came up with this example sheet which uses a formula to code-generate the YAML configuration needed by…

    1 min read
  7. Trying out cr-sqlite on macOS

    cr-sqlite is fascinating. It's a loadable SQLite extension by Matt Wonlaw that "allows merging different SQLite databases together that have taken independent writes".

    3 min read
  8. Setting up a custom subdomain for a GitHub Pages site

    This is so much easier than I was expecting it to be. https://simonw.github.io/datasette-lite/ Shortly after launching I realized that the project deserved its own vanity subdomain.

    1 min read
  9. Scraping Reddit via their JSON API

    Reddit have long had an unofficial (I think) API where you can add to the end of any URL to get back the data for that page as JSON. I wanted to track new posts on Reddit that mention my domain .

    1 min read
  10. Explicit file encodings using click.File

    I wanted to add a option to which could be used to change the file encoding used to read the incoming CSV or TSV file - see sqlite-utils 182.

    1 min read
  11. Optimizing PNGs in GitHub Actions using Oxipng

    My datasette-screenshots repository generates screenshots of Datasette using my shot-scraper tool, for people who need them for articles or similar.

    2 min read
  12. Using LD_PRELOAD to run any version of SQLite with Python

    I've been wanting to figure this out for ages. This thread on Hacker News plus this Stackoverflow post gave me some initial clues.

    3 min read
  13. Extracting objects recursively with jq

    The Algolia-powered Hacker News API returns nested comment threads that look like this: https://hn.algolia.com/api/v1/items/27941108 (For this story: https://news.ycombinator.com/item?id=27941108) I…

    1 min read
  14. Converting Airtable JSON for use with sqlite-utils using jq

    The Airtable API outputs JSON that looks like this: The items in the array each have an , a nested dictionary and a .

    1 min read
  15. Passing command arguments using heredoc syntax

    This trick works for both Bash and zsh. I wanted to pass the following as an argument to the sqlite-utils CLI tool: Problem: this contains both single AND double quotes, which makes string escaping a…

    1 min read
  16. Deno KV

    Initial article: April 28th 2023 - see below for an update I got intrigued by Deno KV, which describes itself as "a global database for global apps".

    4 min read
  17. Loading SQLite extensions in Python on macOS

    I finally found a workaround for this error when attempting to load a SQLite extension in Python on macOS: The fix is to install Python using Homebrew, and then use that version of Python.

    1 min read
  18. Using packages from JSR with esbuild

    JSR is a brand new package repository for "modern JavaScript and TypeScript", launched on March 1st by the Deno team as a new alternative to npm My JavaScript ecosystem fluency isn't great, so it took…

    3 min read
  19. Interpreting photo orientation and locations in EXIF data

    I upgraded my Niche Museums site to use PhotoSwipe for its photo galleries today. Here's my issue. This lead me down a bit of a rabbit hole of photo EXIF data.

    3 min read
  20. Accessing repository dependencies in the GitHub GraphQL API

    Access to a Repositories Dependency Graph describes a preview API for accessing GitHub repository dependencies.

    1 min read
  21. Building Mastodon bots with GitHub Actions and toot

    Twitter announced today that they'll be ending free API access for bots. My @covidsewage Twitter bot posts a screenshot of the latest Covid sewage data for parts of the San Francisco Bay Area every…

    2 min read