I got curious about how git knows what a Python function / class definition looks like when displaying diffs. Turns out it ships with a giant ball of regular expressions covering 22 different languages, in github.com/git/git/blob/m…
Here's where they added support for Python "async def" functions seven months ago. The way to conquer terrifying regular expressions is with neat, comprehensive unit tests: github.com/git/git/commit…
@zzxiv@andrewparker@datasetteproj I'm not yet fetching the content of the linked articles, but I've thought about doing that - I could have a separate DB table with URLs and article contents which is also setup for full-text search pretty easily
What bothers me is that in Mobile Safari the Apple News app still hijacks clicks on Atom/RSS feeds - so if you click a feed icon you'll be bounced to the News app, which will then display an error message.
I don't think there's a workaround for this. Atom links just look broken.
I released a fun new plugin for datasette: datasette-bplist, which adds tooling for handling values in SQLite databases that are data structures encoded using Apple’s binary plist format. github.com/simonw/dataset…
Why would you want this? Because it turns out the ~/Library/ folder on any OS X laptop is positively crammed with SQLite databases that embed binary-plist data in some of their tables.
Combine bplist_to_json() with json_extract() to pull out all kinds of interesting things...
My favourite example is the RKMaster_dataNote table tucked away in
~/Pictures/Photos\ Library.photoslibrary/database/photos.db - which contains EXIF data from every photo you've ever shared with Apple Photos. Here's a before and after shot showing what the plugin reveals
TIL about "origin trials" - a neat way of trialing experimental implementations of new potential web standards in an opt-in manner, intended to avoid the chaos caused when experiments prematurely become de-facto standards github.com/GoogleChrome/O…
This is one of the main benefits I see of a "service" abstraction - be it a networked microservice or just a class that encapsulates some core business logic. A lightweight layer for reading and writing the DB.
A big reason this is useful is that in any large system those updates are likely to be denormalized in some way - a write to the DB may also need to also invalidate a cache or refresh a separate search index. So all updates should share a codepath.
And for reads in a large system speed is crucial. It's much easier to avoid pathological query performance if reads are all made through some kind of getPostsByIDs method that knows how to efficiently batch queries and uses optimizations like Django's select_ and prefetch_related
In important London news: 5 (five!) of the 43 surviving Imperial Fabergé Eggs are on display at two separate temporary exhibitions right now! You should totally go and see them.
The Science Museum's exhibition "The Last Tsar: Blood and Revolution" runs until 24th March 2019 and includes the Imperial Steel Easter Egg (one of my favourite eggs) and the Imperial Red Cross Fabergé Easter Egg
And across town at the Queen's Gallery the Royal Collection exhibition "Russia, Royalty & the Romanovs" has all three of the Queen's Fabergé eggs on public display! royalcollection.org.uk/collection/the…
I wrote about documentation unit tests: a technique I've been exploring recently to use automated tests to ensure documentation exists for the key concepts contained within a codebase: simonwillison.net/2018/Jul/28/do…
The key idea is to use introspection to figure out which concepts exist within the code (for Datasette I'm listing plugin hooks, view classes and config options) and then use regular expressions to check for matching headings or labels within the docs
They're also a fun way of exploring some of the advanced features of @pytestdotorg - in my article I demonstrate pytest fixtures,
parametrized tests and how the xfail decorator can be used to ship the tests without breaking the build even when some docs have not been added yet
Ray Bandar (1927-2017) was an artist, scientist, naturalist and an incredibly prolific collector of bones. His collection is in the process of moving to the California Academy of Sciences but Natalie managed to land us a private tour lead by his great nephew.
The collection is truly awe-inspiring, and a testament to an extraordinary life lived following a very particular passion.
All of this was in the basement of Ray's unassuming-looking house in San Francisco - 6,000+ skulls collected over a period of more than 50 years.