Setting up a custom subdomain for a GitHub Pages site
2024-08-03
This is so much easier than I was expecting it to be.
246 words
|
1 minute
Find local variables in the traceback for an exception
2024-08-03
For [sqlite-utils issue #309](https://github.com/simonw/sqlite-utils/issues/309) I had an error that looked like this:
222 words
|
1 minute
Using SQL with GDAL
2024-08-03
Inspired [by Brad Neuberg](https://twitter.com/bradneuberg/status/1633875601789681666) I decided to take a look at the SQL features in the GDAL fam...
985 words
|
5 minutes
Removing a git commit and force pushing to remove it from history
2024-08-03
I accidentally triggered a commit which added a big chunk of unwanted data to my repository. I didn't want this to stick around in the history fore...
97 words
|
1 minute
How to get Cloudflare to cache HTML
2024-08-02
To my surprise, if you setup a [Cloudflare](https://www.cloudflare.com/) caching proxy in front of a website it won't cache HTML pages by default, ...
227 words
|
1 minute
Dynamically loading multiple assets with a callback
2024-08-02
For [datasette-leaflet-geojson](https://github.com/simonw/datasette-leaflet-geojson) I wanted to dynamically load some external CSS and JavaScript ...
615 words
|
3 minutes
Efficiently copying a file
2024-08-02
**TLDR:** Use `shutil.copyfileobj(fsrc, fdst)`
222 words
|
1 minute
The most basic possible Hugo site
2024-08-02
With [Claude's help](https://gist.github.com/simonw/6f7b6a40713b36749da845065985bb28) I figured out what I think is the most basic version of a sta...
737 words
|
4 minutes
Using expect() to wait for a selector to match multiple items
2024-08-02
In the Playwright tests for [datasette-cluster-map](https://github.com/simonw/datasette-cluster-map) I wanted to assert that two markers had been d...
158 words
|
1 minute
pytest coverage with context
2024-08-02
[This tweet](https://twitter.com/mariatta/status/1499863816489734146) from \@Mariatta tipped me off to the ability to measure "contexts" when [runn...
479 words
|
2 minutes
Using packages from JSR with esbuild
2024-08-01
[JSR](https://jsr.io/) is a brand new package repository for "modern JavaScript and TypeScript", [launched on March 1st](https://deno.com/blog/jsr_...
1130 words
|
6 minutes
Manipulating query strings with URLSearchParams
2024-07-31
The `URLSearchParams` class, in [every modern browser](https://caniuse.com/?search=URLSearchParams) since IE 11, provides a sensible API for manipu...
165 words
|
1 minute
Null case comparisons in SQLite
2024-07-31
I wanted to say "output this transformed value if it's not null, otherwise nothing". The recipe I figured out was:
115 words
|
1 minute
Attaching a bash shell to a running Docker container
2024-07-31
Use `docker ps` to find the container ID:
96 words
|
1 minute
Constructing GeoJSON in PostgreSQL
2024-07-29
In order to efficiently generate a GeoJSON representation of a vast number of locations, I'm currently experimenting with generating the GeoJSON di...
506 words
|
3 minutes
Basic Datasette in Kubernetes
2024-07-29
This recipe for deploying the official `datasetteproject/datasette` container in Kubernetes just worked for me. It uses an interesting (possibly na...
194 words
|
1 minute
Using just with Django
2024-07-29
Jeff Triplett [convinced me](https://twitter.com/webology/status/1532860591307726851) to take a look at [just](https://github.com/casey/just) as a ...
504 words
|
3 minutes
Deploying Python web apps as AWS Lambda functions
2024-07-29
I've been wanting to figure out how to do this for years. Today I finally put all of the pieces together for it.
1787 words
|
9 minutes
Upgrading a pipx application to an alpha version
2024-07-27
I wanted to upgrade my [git-history](https://datasette.io/tools/git-history) installation to a new alpha version.
107 words
|
1 minute
Using namedtuple for pytest parameterized tests
2024-07-27
I'm writing some quite complex [pytest]() parameterized tests this morning, and I was finding it a little bit hard to read the test cases as the nu...
349 words
|
2 minutes
Pausing traffic and retrying in Caddy
2024-07-27
A pattern I really like for zero-downtime deploys is the ability to "pause" HTTP traffic at the load balancer, such that incoming requests from bro...
460 words
|
2 minutes
Handling CSV files with wide columns in Python
2024-07-27
Users [were reporting](https://github.com/simonw/sqlite-utils/issues/229) the following error using `sqlite-utils` to import some CSV files:
241 words
|
1 minute
Geocoding from Python on macOS using pyobjc-framework-CoreLocation
2024-07-26
Rhet Turnbull [shared](https://twitter.com/RhetTurnbull/status/1883559820541956605) this [short script](https://gist.github.com/RhetTbull/db70c113e...
580 words
|
3 minutes
Finding the SQLite version used by Web SQL in Chrome
2024-07-25
Google Chrome still includes support for [Web SQL](https://www.w3.org/TR/webdatabase/), the long since abandoned proposed standard for shipping a S...
266 words
|
1 minute