I went down the route of leveraging the json-enc extention in htmx, but later realized that this completely breaks browsers/users who do not wish to use javascript. While most of the web would feel quite broken with javascript disabled, I donβt want to contribute to that without good reason.
Taking a second look into this issue, rather than using json-enc, and using as_form to get form data into a model keeps the nice DX fo everything being a pydantic model, but the site still works without js. with js htmx kicks in, you get a spa like experience by loading partials onto the page, and without, you just get a full page reload.
copied from
π€― NES Super Mario Bros level 1 written in pure sed, this is madmess. neovim stopped formatting on save for me awhile ago and I have just been dealing with it. looks like there may have been an api change, idk. I had to make this update.4 How to enable debug mode in pywebview. After a nasty time with alembic upgrades, thoughts is about to get a new users table. This may have came from incorrectly setting up alembic for sqlite from the start, but I was able to fix the issue with this GitHub issue. The change I needed to make to get my migration to run. ![[None]] Since using alembic I have been just running out a new revision checking its content and deleting it if its empty, today I learned there is an π€― jinja comes with a loader to Iβve definitely been missing out on setting up a proper jinja loader on a few projects, I need to lean on this a bit more. The path can be relative or absolute. Relative paths are relative to the current working directory. Nice intro into tailwind, I definitely started grasping some of the concepts after watching Brad. Really cool tui to inspect docker imaages that runs with docker. A nice tool to check compression on a public url. Implement paging in sqlmodel with where, limit, and offset. duckdb is a new in process database that has been making its rounds in analytics for its high performance in those applications. Mother duck is a centeralized server that brings manages storage, data sharing and an ide to duckdb. How to center things in textual. Textual has a very unique way of styling text user interfaces for the terminal using css. If you know css it feels natural. @willmcgugan, has put together a great article on how to center things in textual here the final result Super useful way to show a tree view of an s3 bucketβs structure! How to sort results from a sqlalchemy based orm. 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. 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. 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 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 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 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 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. I am creating this post from a desktop app that I created in 3 lines. sqlalchemy server_defaults end up as defaults in the database when new values are inserted. 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. A guide to add Jinja2Templates to fastapi. A complete reference of all of the htmx swapping methods. I am trying to use htmx on a new fastapi site for my thoughts, and have been hitting this error. 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,... ... [registries.search] registries = ['docker.io'] Without the above you wonβt be able to use basic Various documentation (redhat blog entries, ... Using templates with htmx requires the client-side-templates extension, and the template engine to be loaded in a example htmx using templates. Mounting static files in fastapi. Love the poling example with hx-trigger=βevery 1sβ. 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. Harlequin is a pretty sweet example of what textual can be used to create. Its a terminal based sql ide for DuckDB. To persist data in duckdb you need to first make a connection to a duck db database. Then work off of the connection duckdb can just query any pandas dataframe that is in memory. I tried running it against a list of objects and got this error. Great error message that gives me supported types right in the message. pytest-subtests is a package to register multiple subtests within a similar test function.alembic sqlite ValueError: Constraint must have a name alembic check command to check for operations that need to be created.pre-compile templates! Defihnitely need to look at this for markata, as jinja is till one of the biggest hot spots.class jinja2.FileSystemLoader(searchpath, encoding='utf-8', followlinks=False): ''' Load templates from a directory in the file system. '''
.order_by(model.Entry.amount.desc()) 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.>>> from rich import inspect >>> text_file = open("foo.txt", "w") >>> inspect(text_file) rinspect.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.:%s/ substitution does, or a g/ g command.curl or python{% include 'header.html' %} Body goes here. {% include 'footer.html' %} <ul id='posts'> {% for post in posts.__root__ %} {% include 'post_item.html' %} {% endfor %} </ul>
Mixed Content: The page at 'https://front.mydomain.com/#/clients/1' was loaded over HTTPS, but requested an insecure resource 'http://back.mydomain/jobs/?_end=25&_order=DESC&_sort=id&_start=0&client_id=1'. This request has been blocked; the content must be served over HTTPS. What is happening #
<div hx-get='/users/me' hx-trigger='load'> get me </div> On void linux. Under `/etc/containers/` there is a file called `registries.conf`. It is complemented by `man 5 containers-registries.conf`. Change (for me lines 11-12) which say [registries.search] registries = [] to (drawn from https://www.projectatomic.io/blog/2018/05/podman-tls/)
podman functions. You might get errors like:man podman pages) say that dockerhub is a default, but without this step itβs clearly not.Good luck. Feel free to use the comment box below if you have a github account. <script> tag.con = duckdb.connect('file.db') con rather than duckdb.