Today I Learned

Short TIL posts

1864 posts latest post 2026-06-04 simple view
Publishing rhythm
May 2026 | 29 posts
Looking for inspiration? markata-slides [1] by WaylonWalker [2]. A slides plugin for markata that allows you to create presentations in markdown from the comfort of your favorite editor. Each new h2 tag (## in markdown) becomes a new slide. This plugin leverages the built-in feeds plugin for navigation, and adds in some hotkeys (j/k) to go the the previous and next slides. References: [1]: https://github.com/WaylonWalker/markata-slides [2]: https://github.com/WaylonWalker
I’m really excited about small-group-notes [1], an amazing project by pypeaday [2]. It’s worth exploring! Landing zone for small group notes - plan is to make this a nicer website for all things small group related References: [1]: https://github.com/pypeaday/small-group-notes [2]: https://github.com/pypeaday
Looking for inspiration? techstructive-blog [1] by Mr-Destructive [2]. Blogging Platform powered by Django. References: [1]: https://github.com/Mr-Destructive/techstructive-blog [2]: https://github.com/Mr-Destructive
I’m really excited about meetgor.com [1], an amazing project by Mr-Destructive [2]. It’s worth exploring! My Personal Blog and Portfolio made with Markata SSG and Python References: [1]: https://github.com/Mr-Destructive/meetgor.com [2]: https://github.com/Mr-Destructive
The work on jinja2-fragments [1] by sponsfreixes [2]. Render Jinja2 template block as HTML [3] page fragments on Python web frameworks. References: [1]: https://github.com/sponsfreixes/jinja2-fragments [2]: https://github.com/sponsfreixes [3]: /html/
Looking for inspiration? ansible-language-server [1] by ansible [2]. 🚧 Ansible Language Server codebase is now included in vscode-ansible repository References: [1]: https://github.com/ansible/ansible-language-server [2]: https://github.com/ansible
I’m really getting into using hatch as my go to build system, and I am really liking it so far. I am slowly finding new things that just work really well. hatch new is one of those things that I didn’t realize I needed until I had it. [1] creating new versions created by myself with stable diffusion [2] ❯ pipx run hatch new --help Usage: hatch new [OPTIONS] [NAME] [LOCATION] Create or initialize a project. Options: -i, --interactive Interactively choose details about the project --cli Give the project a command line interface --init Initialize an existing project -h, --help Show this message and exit. Note! I am running all of these commands with pipx. I like to use pipx for all of my system level cli applications. To emphasis this point in the article I am going to use pipx run hatch, but you can pipx install hatch then just run hatch from there. Interacively create a new project # [3] Running hatch new -i will ask let you interactivly choose details about the project, such as the project’s name. pipx run hatch new -i After running and naming the project Hatch New we end up with the following filetree. ❯ tree . . ├── hatch_new │   ├── __about__.py │   └── __in...
Hatch has an amazing versioning cli for python packages that just works. It takes very little config to get going and you can start bumping versions without worry. [1] creating new versions created by myself with stable diffusion project layout # [2] For trying out the hatch version cli let’s make a simple project with the terrible name pkg. ❯ tree . . ├── pkg │   ├── __about__.py │   └── __init__.py ├── pyproject.toml └── README.md 1 directory, 4 files pyproject.toml # [3] The main hero of this post is the pyproject.toml. This is what defines all of our PEP 517 [4] style project setup. [project] name = "pkg" description = "Show how to version packages with hatch" readme = "README.md" dynamic = [ "version", ] [build-system] requires = [ "hatchling>=1.4.1", ] build-backend = "hatchling.build" [tool.hatch.version] path = "pkg/__about__.py" statically versioning # [5] project.version It is possible to set the version number inside the pyproject.toml statically. This is fine if you just want to version your package manually, and not through the hatch cli. [project] name = "pkg" version = "0.0.0" # ... Statically versioning in pyproject.toml will not work with hatch ...
Just starred cloak.nvim [1] by laytan [2]. It’s an exciting project with a lot to offer. Cloak allows you to overlay *’s over defined patterns in defined files. References: [1]: https://github.com/laytan/cloak.nvim [2]: https://github.com/laytan
Markata is a great python framework that allows you to go from markdown to a full website very quickly. You can get up and running with nothing more than Markdown. It is also built on a full plugin architecture, so if there is extra functionality that you want to add, you can create a plugin to make it behave like you want. Full transparancy… I built markata. The talk # [1] The talk is live on YouTube. Make sure you check out the other videos from the conference. There were quite a few quality talks that deserve a watch as well. https://youtu.be/Wq9YBamSgs0 [2] References: [1]: #the-talk [2]: https://stable-diffusion.waylonwalker.com/000221.1721400243.webp
I spoke at python webconf in March 2022 about how I deploy this blog on a continuous basis. Building this blog has brought me a lot of benefits. I have a set of custom curated notes to help describe a problem and how to solve it to me. At theis point it’s not uncommon to google an Issue I am having and finding my own blog with exactly the solution I need at the top. I also bump into people from time to time that recognize me from the blog, its a nice conversation starter, and street cred. The Talk # [1] The talk recently released on Youtube, you can watch it without having a ticket to the conference for free. There were a bunch of other talks that you should check out too! https://youtu.be/JDZVjDCTKHE References: [1]: #the-talk
rofi-network-manager [1] by P3rf [2] is a game-changer in its space. Excited to see how it evolves. A manager for network connections using bash, rofi, nmcli,qrencode. References: [1]: https://github.com/P3rf/rofi-network-manager [2]: https://github.com/P3rf
I got all the pypi packages that I own behind 2 factor authentication. 💪 Recently this really made it’s rounds in the python news since pypi was requiring critical package maintainers to have 2FA on and even offering them hardware tokens to help them turn this on. I feel like this caused a bit of confusion as turning on 2FA does not mean that you need to do anything different to deploy a package, and it DOES NOT require a hardware token. You can continue using your favorite 2FA app. You might wonder what this means for my projects. It means that to edit any sensitive content such as pull a new api token, add/remove maintainers, or deleting a release I need to use a TOPT (time based one time password) application such as Google Authenticator, Microsoft Authenticator, Authy, or FreeOTP. This has very little change to my overall workflow as my CI system still automatically deploys for me with the same api token as before. This is one small thing that maintainers can do to prevent supply chain attacks on their projects that they put so much work into. Login # [1] When I log in I now get this extra screen asking for an auth token. [2] My packages # [3] Once I turned on 2FA...
Looking for inspiration? build [1] by pypa [2]. A simple, correct Python build frontend References: [1]: https://github.com/pypa/build [2]: https://github.com/pypa
Check out squidfunk [1] and their project mkdocs-material [2]. Documentation that simply works References: [1]: https://github.com/squidfunk [2]: https://github.com/squidfunk/mkdocs-material
I just love how some features of vim are so discoverable and memorable once you really start to grasp it. Sorting and uniqing your files or ranges is one of those examples for me. " sort the file :sort " sort the file only keeping unique lines :sort u " sort a range :'<,'> sort " sort a range only keeping unique lines :'<,'> sort u I recently used this to dedupe my autogenerated links section for rich-syntax-range-style [1]. More often I am using it to sort and uniqify objects like arrays and lists. Here is what the markdown looks like. * [py-tree-sitter](https://github.com/tree-sitter/py-tree-sitter) * [rich](https://github.com/Textualize/rich) * [@textualizeio](https://twitter.com/textualizeio) * [rich](https://github.com/Textualize/rich) * [another post](https://waylonwalker.com/designing-kedro-router) * [print-register-pipelines](https://screenshots.waylonwalker.com/print-register-pipelines.webp) * [rich](https://github.com/Textualize/rich) * [console-print-register-pipelines](https://screenshots.waylonwalker.com/console-print-register-pipelines.webp) * [rich](https://github.com/Textualize/rich) * [syntax-print-register-pipelines](https://screenshots.waylonwalker.com/syn...
Today I’ve been playing with py-tree-sitter [1] a bit and I wanted to highlight match ranges, but was unable to figure out how to do it with rich [2], so I reached out to @textualizeio [3] for help. https://twitter.com/_WaylonWalker/status/1562469770766589952 While waiting for that reply let’s show how we got this far. imports # [4] Lets import all the classes that we need from rich [2] and setup a console to print to. from rich.console import Console from rich.syntax import Syntax from rich.style import Style console = Console() some code # [5] Now we need some code to highlight. I am going to rip my register_pipeline from another post [6]. code = ''' from find_kedro import find_kedro def register_pipelines(self) -> Dict[str, Pipeline]: """Register the project's pipeline. Returns: A mapping from a pipeline name to a ``Pipeline`` object. """ return find_kedro() ''' print # [7] We could simply print out the code we have as a variable, but thats a bit hard to read. [8] console.print # [9] printing with rich [2]’s console makes it a little better, but not much by default. [10] Syntax # [11] We can pull from rich [2]’s syntax module to really pretty this up. ...
How to vimgrep over hidden files. I needed to delete all build pipeline steps that were named upload docs. I currently have about 60 projects running from the same template all running very similar builds. In the past I’ve scripted out migrations for large changes like this, they involved writing a python script that would load the yaml file into a dictionary, find the corresponding steps make the change and write it back out. Today’s job was much simplar, just delete the step, were all steps are surrounded by newlines. My first thought was to just open all files in vim and run dap. I just needed to get these files:positions into my quickfix. My issue is that all the builds reside within hidden directories by convention. The issue # [1] variability After searching through all the projects it was clear that all the steps were in their own paragraph, though I was not 100% confident enough to completely automate it, and the word upload docs was in the paragraph. some were a two liner - name: upload docs script: aws s3 ... Some had a variation in the name - name: upload docs to s3 script: aws s3 ... some were more than 2 lines. - name: upload docs script: | aws s3 ... s...
vim
[1] a sprinter edging out his opponent by Dall-e It’s about time to release Markata 0.3.0. I’ve had 8 pre-releases since the last release, but more importantly it has about 3 months of updates. Many of which are just cleaning up bad practices that were showing up as hot spots on my pyinstrument reports Markata started off partly as a python developer frustrated with using nodejs for everything, and a desire to learn how to make frameworks in pluggy. Little did I know how flexible pluggy would make it. It started out just as my blog generator, but has turned into quite a bit more. Over time this side project has grown some warts and some of them were now becoming a big enough issue it was time to cut them out. Let’s compare # [2] I like to use my tils articles for examples and tests like this as there are enough articles for a good test, but they are pretty short and quick to render. mkdir ~/git/tils/tils cp ~/git/waylonwalker.com/pages/til/ ~/tils/tils -r cd ~/git/tils/tils running tils on 0.2.0 # [3] At the time of writing this is the current version of markata, so just make a new venv and run it. python3 -m venv .venv --prompt $(basename $PWD) pip install markata marka...
Check out stable-diffusion [1] by CompVis [2]. It’s a well-crafted project with great potential. A latent text-to-image diffusion model References: [1]: https://github.com/CompVis/stable-diffusion [2]: https://github.com/CompVis