Thoughts

Link based "commentary" style posts, commenting on a web link

844 posts latest post 2026-04-16
Publishing rhythm
Apr 2026 | 18 posts

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.

A feature of jinja that I just discovered is including sub templates. Here is an example from the docs.

{% include 'header.html' %} Body goes here. {% include 'footer.html' %}

And inside of my thoughts project I used it to render posts.

<ul id='posts'> {% for post in posts.__root__ %} {% include 'post_item.html' %} {% endfor %} </ul>

note that post_item.html automatically inherits the post variable.

I am trying to use htmx on a new fastapi site for my thoughts, and have been hitting this error.

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 #

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.

<div hx-get='/users/me' hx-trigger='load'> get me </div>

But for some reason when the front end gets this redirect, it tries to do it through http,...

...

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

[registries.search] registries = ['docker.io']

(drawn from https://www.projectatomic.io/blog/2018/05/podman-tls/)


Without the above you won’t be able to use basic podman functions. You might get errors like:

Various documentation (redhat blog entries, 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.

...

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.

![[None]]

When setting up a new machine, vm, docker image you might be installing command line tools from places like pip. They will often put executables in your ~/.local/bin directory, but by default your shell is not looking in that directory for commands.

WARNING: The script dotenv is installed in '/home/falcon/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

To solve this you need to add that directory to your $PATH.

export PATH=$PATH:~/.local/bin

To make this change permanant add this line to your shell’s init script, which is likely something like ~/.bashrc or ~/.zshrc.

In order to turn url encoded links back into links that I would find in the database of my thoughts project I need to urldecode them when they hit the api. When anything hits the api it must urlencode the links in order for them to be sent correctly as data and not get parsed as part of the url.

Here is a snippet of how I am using urlib.parse.unquote to un-encode encoded urls so that I can fetch posts from the database.

In order to send data that includes special characters such as / in a url you need to url encode it. You have probably seen these many times in urls with things like %20 for spaces.

I’m working on a chrome extension to make quick blog posts, like thoughts or a persistent bookmark tool with comments. The backend is written in fastapi and when I check to see if I have a post for a page I need to url encode it.

curl -X 'GET' \ 'https://thoughts.waylonwalker.com/link/?link=https%3A%2F%2Fhtmx.org%2Fextensions%2Fclient-side-templates%2F' \ -H 'accept: application/json'

curl example generated from the fastapi swagger docs.

Here is how I used javascript’s encodeURIComponent to turn my chrome extension into a notification when I already have a post for the current page.

Lately in 2023 I have been leaning on lazyvim for my new setups where I am not necessarily ready to drop my full config. It’s been pretty solid, and comes with a very nice setup out of the box, the docs are pretty fantastic as well.

A nice cheat sheet for jq. jq looks so nice, but it so quickly gets overwhelming on how to select what you want. I was able to make a jq contains query.