Deleting Specific Lines in a File with sed or yq — Nick Janetakis We Nick Janetakis · nickjanetakis.com sed can be a tricky beast, I often stumble when trying to pipe into it. Next time I need to use sed, I should reference this article by Nick Janetakis. He makes it looks much easier than my experience has been, and it appears to behave like a vim substitution does, or a g command.
Publishing rhythm
External Link htmx.org json-enc extension converts url encoded form values into json encoded data, this is very useful for fastapi to have the same interface for htmx and curl type of interfaces.
Header Parameters - FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi.tiangolo.com Getting request headers in fastapi has a pretty nice stetup, it allows you to get headers values as function arguments, I was able to use headers to detect if a request was made from htmx or not. If the request was made from htmx, then we want a html format, otherwise I’m probably hitting the api programatically from something like or
GitHub - 1j01/textual-paint::art: MS Paint in your terminal.:art: MS Paint in your terminal. Contribute to 1j01/textual-paint development by creating an account on GitHub. GitHub · github.com 1j01 created a complete working clone of ms paint in the terminal using the textual framework. It’s incredible.
Dear Red Hat… featuring Jeff Geerling (Changelog & Friends #7) Red Hat's decision to lock down RHEL sources behind a subscription paywall was met with much ire and opened opportunity for Oracle to get a smack in and SUSE to announce a fork with $10 million beh… Changelog · changelog.com Loved this explanation about all the recent lock down with RHEL from Jeff Geerling.
sqlite-utils now supports plugins sqlite-utils 3.34 is out with a major new feature: support for plugins. sqlite-utils is my combination Python library and command-line tool for manipulating SQLite databases. It recently celebrated... Simon Willison’s Weblog · simonwillison.net As the title states sqlite-utils now supports plugins. I dug in just a bit and Simon implemented this completely with entrypoints, no framework or library at all.
Great short explaination of session vs token authentication.
Form Data - FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi.tiangolo.com Getting form data inside of fastapi was not intuitive to me at first. Everything I had used in fastapi leaned on pydantic models. Form data comes in differently and needs collected differently.
I am creating this post from a desktop app that I created in 3 lines.
Column INSERT/UPDATE Defaults — SQLAlchemy 1.4 Documentation docs.sqlalchemy.org sqlalchemy server_defaults end up as defaults in the database when new values are inserted.
Template Designer Documentation — Jinja Documentation (3.1.x) jinja.palletsprojects.com A feature of jinja that I just discovered is including sub templates. Here is an example from the docs. And inside of my thoughts project I used it to render posts. note that post_item. html automatically inherits the post variable.
Templates - FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi.tiangolo.com A guide to add Jinja2Templates to fastapi.
</> htmx ~ Documentation htmx gives you access to AJAX, CSS Transitions, WebSockets and Server Sent Events directly in HTML, using attributes, so you can build modern user interfaces with the simplicity and power of hypert... htmx.org A complete reference of all of the htmx swapping methods.
External Link stackoverflow.com I am trying to use htmx on a new fastapi site for my thoughts, and have been hitting this error. What is happening # I have an htmx component that gets the current users name, but if they are not logged in the backend redirects to a login form. But for some reason when the front end gets this redirect, it tries to do it through http, and flags it as insecure. The solution # To solve this issue, the post directs to set the to ‘*’
gistfile1.txt text [registries.search] registries = ['docker.io'] functions. You might get errors like: Various documentation (redhat blog entries, pages) say that dockerhub is a default, but without this step it’s clearly not. By default podman will not pull images from docker.io and will need setup. This guide worked for me.
External Link htmx.org Using templates with htmx requires the client-side-templates extension, and the template engine to be loaded in a tag. example htmx using templates.
Static Files - FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi.tiangolo.com Mounting static files in fastapi.
#javascript" playlabel="Play: HTMX looks pretty neat #coding #javascript "> Love the poling example with hx-trigger=‘every 1s’.
First-class session support in FastAPI · Issue #754 · fastapi/fastapi Is your feature request related to a problem All of the security schemas currently supported by FastAPI rely on some sort of "client-server synergy", where, for instance, the client is expected to... GitHub · github.com Here is a snippet provided by @tiangolo to store the users jwt inside of a session cookie in fatapi. This was written in feb 12, 2020 and admits that this is not a well documented part of fastapi. It’s already in place. More or less like the rest of the security tools. And it’s compatible with the rest of the parts, integrated with OpenAPI (as possible), but probably most importantly, with dependencies. It’s just not properly documented yet. 😞 But still, it works 🚀 e.g.
External Link duckdb.org Harlequin is a pretty sweet example of what textual can be used to create. Its a terminal based sql ide for DuckDB.