TILs
Filters: Sorted by date
575 results
«« first
« previous
page 8 / 20
next »
last »»
TIL
Start, test, then stop a localhost web server in a Bash script
— I wanted to write a bash script that would start a Datasette server running, run a request against it using `curl`, then stop the server again.
TIL
Comparing database rows before and after with SQLite JSON functions
— Here's a trick I've been using to compare the rows in a table before and after I perform an operation against it. It works well for a few hundred (and maybe a few thousand) rows.
TIL
SQLite can use more than one index for a query
— I was trying to figure out if SQLite has the ability to use more than one index as part of executing a single query, or if it only ever picks a single index that it thinks will give the best performance.
TIL
Viewing GeoPackage data with SpatiaLite and Datasette
— I managed to display polygons fom a GeoPackage database file today, using SpatiaLite and Datasette.
TIL
Show files opened by pytest tests
— My test suite for [Datasette](https://github.com/simonw/datasette) has grown so large that running the whole thing sometimes causes me to run out of file handles.
TIL
Reformatting text with Copilot
— I wanted to write alt text for the following screenshot ([of this page]()), so I could include it in [this post on Mastodon](https://fedi.simonwillison.net/@simon/109484810256112309).
TIL
Finding uses of an API with the new GitHub Code Search
— The [GitHub Code Search beta](https://docs.github.com/en/search-github/github-code-search) is really powerful - it allows advanced search - including regular expression matches - against every public repo on GitHub.
TIL
Workaround for google-github-actions/setup-gcloud errors
— I used the [google-github-actions/setup-gcloud](https://github.com/google-github-actions/setup-gcloud) action in all of my GitHub Actions workflows that deploy applications to Cloud Run.
TIL
Using pipenv and Docker
— I had [a Django project](https://github.com/natbat/cbwg) that used `pipenv` (in particular a `Pipfile.lock`) to manage dependencies and I wanted to build a Docker container for it.
TIL
actions/setup-python caching for setup.py projects
— I used to use a combination of `actions/setup-python` and `actions/cache` in all of my Python GitHub Actions projects in order to install Python dependencies via a cache, rather than hitting PyPI to download copies every time.
TIL
Lazy loading images in HTML
— [Most modern browsers](https://caniuse.com/loading-lazy-attr) now include support for the `loading="lazy"` image attribute, which causes images not to be loaded unti the user scrolls them into view.
TIL
Writing a CLI utility that is also a Datasette plugin
— I'm working on [dclient](https://github.com/simonw/dclient), a CLI tool for interacting with Datasette instances via the Datasette API.
TIL
Wider tooltip areas for Observable Plot
— In [this Observable notebook](https://observablehq.com/@simonw/mastodon-users-and-statuses-over-time) I'm plotting a line on a chart, but I want to provide tooltips showing the exact value at any point on the line.
TIL
Verifying your GitHub profile on Mastodon
— Mastodon has a really neat way of implementing verification, using the [rel=me microformat](https://microformats.org/wiki/rel-me).
TIL
How to create a tarball of a git repository using "git archive"
— I figured this out in [a Gist in 2016](https://gist.github.com/simonw/a44af92b4b255981161eacc304417368) which has attracted a bunch of comments over the years. Now I'm upgrading it to a retroactive TIL.
TIL
HTML datalist
— A [Datasette feature suggestion](https://github.com/simonw/datasette/issues/1890) concerning autocomplete against a list of known values inspired me to learn how to use the HTML `<datalist>` element ([see MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist)).
TIL
Writing tests with Copilot
— I needed to write a relatively repetitive collection of tests, for a number of different possible error states.
TIL
JSON Pointer
— I'm [looking at options](https://github.com/simonw/datasette/issues/1875) for representing JSON validation errors in more JSON. The recent [RFC 7807: Problem Details for HTTP APIs](https://datatracker.ietf.org/doc/draft-ietf-httpapi-rfc7807bis/) looks relevant here.
TIL
Generating OpenAPI specifications using GPT-3
— I wanted to start playing around with [OpenAPI](https://www.openapis.org/). I decided to see if I could get GPT-3 to generate the first version of a specification for me.
TIL
Export a Mastodon timeline to SQLite
— I've been playing around with [the Mastodon timelines API](https://docs.joinmastodon.org/methods/timelines/). It's pretty fun!
TIL
Getting Mastodon running on a custom domain
— This TIL is mainly a rehash of these two articles by Jacob and Andrew:
TIL
GitHub Pages: The Missing Manual
— [GitHub Pages](https://pages.github.com/) is an excellent free hosting platform, but the documentation is missing out on some crucial details.
TIL
The pdb interact command
— Today [Carlton told me](https://twitter.com/carltongibson/status/1587155176590385159) about the [interact command](https://docs.python.org/3.10/library/pdb.html#pdbcommand-interact) in the Python debugger.
TIL
git bisect
— I extracted and enhanced this TIL from [my April 8th 2020 weeknotes](https://simonwillison.net/2020/Apr/8/weeknotes-zeit-now-v2/#git-bisect) to make it easier to find.
TIL
Finding the SQLite version used by Web SQL in Chrome
— Google Chrome still includes support for [Web SQL](https://www.w3.org/TR/webdatabase/), the long since abandoned proposed standard for shipping a SQL engine in browser JavaScript. I was reminded of its existence today while reading about the new official [sqlite3 wasm build](https://sqlite.org/wasm/doc/tip/about.md).
TIL
os.remove() on Windows fails if the file is already open
— I puzzled over this one for [quite a while](https://github.com/simonw/sqlite-utils/issues/503) this morning. I had this test that was failing with Windows on Python 3.11:
TIL
Writing a Datasette CLI plugin that mostly duplicates an existing command
— My new [datasette-gunicorn](https://datasette.io/plugins/datasette-gunicorn) plugin adds a new command to Datasette - `datasette gunicorn` - which mostly replicates the existing `datasette serve` command but with a few differences.
TIL
Simple load testing with Locust
— I've been using [Locust](https://locust.io/) recently to run some load tests - most significantly [these tests](https://github.com/simonw/django_sqlite_benchmark/issues?q=is%3Aissue+is%3Aclosed) against SQLite running with Django and [this test](https://github.com/simonw/datasette-gunicorn/issues/1) exercising Datasette and Gunicorn.
TIL
Adding a Datasette ASGI app to Django
— [Datasette](https://datasette.io/) is implemented as an ASGI application.
TIL
Guessing Amazon image URLs using GitHub Copilot
— I was experimenting with the new [Readwise export API](https://readwise.io/api_deets#export) and it gave me back the following JSON:
«« first
« previous
page 8 / 20
next »
last »»