Debugging a Click application using pdb
This tip is for when you are working on a Python command-line application that runs using that program's name, as opposed to typing `python my_scri...
255 words
|
1 minute
Ordered group_concat() in SQLite
I was trying to use `group_concat()` to glue together some column values into a stiched together Markdown document. My first attempt looked like this:
213 words
|
1 minute
Safely outputting JSON
Carelessly including the output of `json.dumps()` in an HTML page can lead to an XSS hole, thanks to the following:
68 words
|
1 minute
Replicating SQLite with rqlite
I tried out [rqlite](https://github.com/rqlite/rqlite) today, a "lightweight, distributed relational database, which uses SQLite as its storage eng...
306 words
|
2 minutes
Setting cache-control: max-age=31536000 with a Cloudflare Transform Rule
I ran https://simonwillison.net/ through [PageSpeed Insights](https://pagespeed.web.dev/) and it warned me that my static assets were not being ser...
607 words
|
3 minutes
Constant-time comparison of strings in Node
When comparing secrets, passwords etc it's important to use a constant-time compare function to avoid timing attacks.
108 words
|
1 minute
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 ...
652 words
|
3 minutes
Limited JSON API for Google searches using Programmable Search Engine
I figured out how to use a JSON API to run a very limited Google search today in a legit, non-screen-scraper way.
508 words
|
3 minutes