How to sort results from a sqlalchemy based orm.
.order_by(model.Entry.amount.desc())
I needed this to enable paging on my thoughts api.
All published posts
How to sort results from a sqlalchemy based orm.
.order_by(model.Entry.amount.desc())
I needed this to enable paging on my thoughts api.
A neovim database client that I need to check out.
A very straightforward guide to moving your docker data, such as container storage to a different location. In my case I wanted it off of my boot drive.
I ran into some dns issues while running podman on arch, aparantly I had missed an optional dependency of aardvark-dns for container to container dns resolution.
I kept running into limits in the number of subuid and subgid’s I had on my system by default. As always thank the arch wiki guide for having the most comprehensive yet consice guide to setup podman.
What I needed to do to fix the error.
testdisk is an amazing command line utility (interactive tui) that just saved me a hard drive that was filled with data, but every machine that I plugged it into told me that it was completely unpartitioned.
I love rich inspect. It’s one of my most often used features of rich. It gives you a great human readable insight into python object instances.
>>> from rich import inspect >>> text_file = open("foo.txt", "w") >>> inspect(text_file)
I have a pyflyby entry for it so that I can just run it ang get automatic imports. To not clash with the standard library inspect, which is quite useful on it’s own, I have aliased it to rinspect.
And this is why we don’t run cdn in prod, respect your users who can’t control where the assets are stored. There are so many fast static hosting providers out there, if you are worried about performance reasons use one of those to self host.
A fantastic overview of the systemd cli.
Hacky solution to get zpool import tank to work on boot right away. This has been an issue that has plagued my system for months and no matter what dependencies I add in it never works, but adding a sleep as ExecStartPre did the trick.
In flask apps I often get a 404 for routes with a trailing slash. This Stack Overflow post shows how to configure flask to allow trailing slashes on some or all routes.
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 :%s/ substitution does, or a g/ g command.
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 curl or python
1j01 created a complete working clone of ms paint in the terminal using the textual framework. It’s incredible.
Loved this explanation about all the recent lock down with RHEL from Jeff Geerling.
...
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.
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.