Tried out biome today and it worked better than prettier on jinja templates, I might adopt this over prettier.
GitHub Stars
GitHub stars posts
Check out aboutfeeds by genmon. It’s a well-crafted project with great potential.
Web feeds/RSS “getting started” guide for new users.
An extension to disable elements during flight of an htmx request, Looks super useful for things like a create or delete button where the server would end up with an error if you double delete or double create. This eliminates an error path that the user might see under normal use of the ui.
The htmx-request class is added to htmx-target elements. You can target this css selector to create loading state throbbers.
By default the target element will the self, but you can use the typical htmx css selector to select which element will recieve the htmx-request class while the request is running.
The only way to override the name of the class is through config.
Prime concisely made sense of why htmx is so awesome compared to what has become modern reactive web dev in 2 minutes. I had never thought of it this way and it’s incredible.
One thing I have comepletely missed out on with my use of htmx is setting the disabled state while the server is working, what a genius move!
Three ways to support updating other content. Fantastic article walking through the different ways to update other parts of the screen using htmx.
In htmx there is no 2 way data binding, the dom is your state, and if you have elements derived from the same data on the screen in different places you need to think about how to keep them in sync.
Fastapi lets you tag your APIRouter’s so that the swagger docs are grouped according to the router.
router = APIRouter(tags=['router'])
Now all routes in router will appear in the router group in the swagger docs.
Datasette has its own static server that can host assets such as style sheets.
Just starred htmx-lsp by ThePrimeagen. It’s an exciting project with a lot to offer.
its so over
Tailwind css component library. There are many examples with copy and pastabily with the tailwind classes already setup.
A nice searchable cheatsheet for tailwindcss classes.
Busting cache with curl. I’m not sure how much gets cached by curl, but I have ran into several cases where I am looking for new content and I want to ensure the content is new and no chance of being cached.
This article suggests 3 different techniques.
sqlite has 3 different tokenizers, porter, ascii, trigram.
These can be used with sqlite-utils.
sqlite-utils enable-fts --tokenize porter database.db post title message tags
And with the python api.
Bat is my favorite pager, its the one for me that seems to just work more than the rest. colors, syntax highlighting, line numbers search, it just feels the most natural.
Check out server-hot-reload by mikeckennedy. It’s a well-crafted project with great potential.
Include in your web projects for dev-time auto reloading of web browser when any change is detected in content.
sqlite-utils is primarily a cli tool for sqlite operations such as enabling full text search, and executing searches, but it also has a nice python api that is exposed and pretty straightforward to use.
from sqlite_utils import Database db = Database("database.db") db["post"].enable_fts(["title", "message", "tags]) db["post"].search("water")
This returns a generator object that you can iterate over the row objects with.
Use prettier to format all files in a directory. By default prettier does not write, it just echos out the format that it would do. Give it the --write and it will write the changes to the files.
prettier --write .
I just used this on my thoughts repo.
datasette really does everything doesn’t it!
> A command-line utility for taking automated screenshots of websites
Daaaang, this is such an elegantly simple way to get web screenshots with a cli. I was literally up and running with two commands on my arch linux machine (which it warned was unsupported by playwright).
pip install shot-scraper # Now install the browser it needs: shot-scraper install shot-scraper waylonwalker.com shot-scraper https://datasette.io/ shot-scraper https://datasette.io/ -h 1280 -w 1920 shot-scraper https://datasette.io/ -h 480 -w 720 shot-scraper shot --selector '#posts' https://thoughts.waylonwalker.com/post/89
Note
shot-scraper https://datasette.io/is a full length screenshot of the entire page.Oh and its pretty dang fast, let alone the setup time, this crushes on startup time in my attempts to use a headless browser in the past.