Today I Learned

Short TIL posts

1864 posts latest post 2026-06-04 simple view
Publishing rhythm
May 2026 | 29 posts
Kind (Kubernetes in Docker) is a tool that makes it easy to create and tear down local clusters quickly. I like to use it to test out new workflows. Argocd is a continuous delivery tool that makes it easy to setup gitops workflows in kubernetes. Here is how you can setup a new kind cluster and install argocd into it using helm, the kubernetes package manager. kind create cluster --name argocd # your first time through you need to add the argocd repo helm repo add argo https://argoproj.github.io/argo-helm helm repo update # install argocd into the cluster helm install argo argo/argo-cd --namespace argocd --create-namespace # deploy the app of apps kubectl apply -f apps/apps.yaml If you want to add repos and apps to your cluster you can use the argo cli to do that, but first you will need forward the argocd port and login. # Wait until Argo CD API server is available echo "Waiting for Argo CD API server to be available..." while ! kubectl wait --for=condition=available --timeout=60s deployment/argo-argocd-server -n argocd; do echo "Waiting for Argo CD API server to be ready..." sleep 10 done kubectl port-forward svc/argo-argocd-server -n argocd 8080:443 & argocd_admin_pa...
Hogwarts Legacy Argyllshire map: What does the button do? Only one spell can be used to grant you entry. Dot Esports Ā· dotesports.com [1] Damn this button had me stuck for way too long. It definitely looks like a button once I see it, but I don’t recall coming into contact with many buttons in the game, I tried to set it ablaze, pull it, fly it, nothing. Note This post is a thought [2]. It’s a short note that I make about someone else’s content online #thoughts References: [1]: https://dotesports.com/hp/news/hogwarts-legacy-argyllshire-map-what-does-the-button-do [2]: /thoughts/
How can I add my YouTube videos via RSS? You can share your videos or other people SocialBee Help Documentation Ā· help.socialbee.com [1] YouTube makes finding rss feeds way too hard. Hats off to them for still supporting it, allowing you to find content outside the algorithm, and consuming content you asked for. But i had no idea you had to search the source code to get it. Note This post is a thought [2]. It’s a short note that I make about someone else’s content online #thoughts References: [1]: https://help.socialbee.com/article/129-how-can-i-add-my-youtube-videos-via-rss [2]: /thoughts/
External Link stackoverflow.com [1] Another interesting option for slow count queries in sqlite. If you haven’t DELETEd any records, doing: SELECT MAX(ROWID) FROM "table" LIMIT 1; Note This post is a thought [2]. It’s a short note that I make about someone else’s content online #thoughts References: [1]: https://stackoverflow.com/questions/8988915/sqlite-count-slow-on-big-tables [2]: /thoughts/
Optimizing SQLite for servers SQLite is often misconceived as a "toy database", only good for mobile applications and embedded systems because it's default configuration is optimized for embedded use cases, so most ... Sylvain Kerkour Ā· kerkour.com [1] Very interesting article by Sylvain, suggested by Simon Willison. Definitely some things that I want to come back and try later on. Here is the TLDR of the whole post PRAGMA journal_mode = WAL; PRAGMA busy_timeout = 5000; PRAGMA synchronous = NORMAL; PRAGMA cache_size = 1000000000; PRAGMA foreign_keys = true; PRAGMA temp_store = memory; This is interesting, and something I need to consider. I definitely have an application with slow count queries. I am not sure how to make it better as its not a full count(*) so a count table doesn’t work, nor does counting by index. I might need to have a table of cached results, and if a write matches the counter increase it, or update all counters on write. COUNT queries are slow SQLite doesn’t keep statistics about its indexes, unlike PostgreSQL, so COUNT queries are slow, even when using a WHERE clause on an indexed field: SQLite has to scan for all the matching records. One solution...
- Inspiring story transitioning into tech from nursing. I also came to tech through a set of circumstances that made it difficult for me to excel at my current job. Looking back it is something that I was always interested in and I was just unsure how to get in, I am so glad that I figured it out, it has been such a great benefit to my family. I really enjoyed listening to trshpuppy’s journey in through building projects, and choosing tech not based on what she wanted to learn, but what fit the project the best. Note This post is a thought [1]. It’s a short note that I make about someone else’s content online #thoughts References: [1]: /thoughts/
I’m impressed by til [1] from jbranchaud [2]. šŸ“ Today I Learned References: [1]: https://github.com/jbranchaud/til [2]: https://github.com/jbranchaud
I came across Hexa [1] from wyattbubbylee [2], and it’s packed with great features and ideas. Hexa is a game engine References: [1]: https://github.com/wyattbubbylee/Hexa [2]: https://github.com/wyattbubbylee
Some Git poll results Some Git poll results Julia Evans Ā· jvns.ca [1] great poll of git [2] questions poll: did you know that in a git merge conflict, the order of the code is different when you do a merge/rebase? merge: <<<<<<< HEAD YOUR CODE OTHER BRANCH’S CODE c694cf8aabe rebase: «««< HEAD OTHER BRANCH’S CODE YOUR CODE d945752 (your commit message) This one explains a lot. I think I knew this, I might have seen it somewhere, but I have definitely noticed it go both ways and confuse the crap out of me. Feels very similar to how --ours and --theirs flip flops. Note This post is a thought [3]. It’s a short note that I make about someone else’s content online #thoughts References: [1]: https://jvns.ca/blog/2024/03/28/git-poll-results/ [2]: /glossary/git/ [3]: /thoughts/
External Link sealed-secrets.netlify.app [1] kubeseal is a pretty simple to get started with way to manage secrets such that they can be stored in a git [2] repo and be picked up by your continuous delivery service. Sealed Secrets provides declarative Kubernetes Secret Management in a secure way. Since the Sealed Secrets are encrypted, they can be safely stored in a code repository. This enables an easy to implement GitOps flow that is very popular among the OSS community. Note This post is a thought [3]. It’s a short note that I make about someone else’s content online #thoughts References: [1]: https://sealed-secrets.netlify.app/ [2]: /glossary/git/ [3]: /thoughts/
In my homelab [1] kubernetes cluster I am using kubeseal to encrypt secrets. I have been using it successfully for a few months now wtih great success. It allows me to commit all of my secrets manifests to git [2] with out risk of leaking secrets. You see kubeseal encrypts your secrets with a private key only stored in your cluster, so only the cluster itself can decrypt them using the kubeseal controller. [3] KubeSeal # [4] https://sealed-secrets.netlify.app/ [5] installation # [6] Installation happens in two steps. You need the kubernetes controller and the client side cli to create a sealed secret. For a more complete instruction see the [docs#installation](https://github.com/bitnami-labs/sealed-secrets?tab=readme-ov-file#installation] installation - controller # [7] Warning **context** Make sure that you are in the right context before running any kubectl commands. kubectl config current-context sealed-secrets is installed using the helm package manager. To install sealed-secrets run the following command. helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets helm install sealed-secrets -n kube-system --set-string fullnameOverride=sealed-...
Just starred codemirror-codeium [1] by val-town [2]. It’s an exciting project with a lot to offer. Codeium code completion integration for CodeMirror 6 References: [1]: https://github.com/val-town/codemirror-codeium [2]: https://github.com/val-town
- Great episode covering a seemingly simple topic. What I really benefitted from was hearing all the different use cases, from logging, debugging, to a/b testing, caching, and auth. I hadn’t even thought of it being applied to a router. I thought of it being applied for an entire application. This seems very useful for things like an admin router, all routes would need to have the admin role to get in. Note This post is a thought [1]. It’s a short note that I make about someone else’s content online #thoughts References: [1]: /thoughts/
![[None]] I’ve been using these decorators to modify the behavior of specific routes. It will do things like 404 admin only routes in a way that looks just like fastapi [1]’s default, or only allow certain roles into the route, or redirect unauthenticated users to login. After listening to yesterday’s syntaxfm I’m now really thinking about middleware and the benefits it might have. middleware would make it easy to apply things like admin to an entire admin router, so you wont forget it on any one admin route. It will look cleaner as the admin checker is only applied once per router, not once per route. import inspect import time from functools import wraps from inspect import signature from fastapi import Request from fastapi.responses import FileResponse, JSONResponse, RedirectResponse from starlette import status from fokais.config import get_config from fokais.models.user import Role config = get_config() admin_routes = [] authenticated_routes = [] not_cached_routes = [] cached_routes = [] def not_found(request): hx_request_header = request.headers.get("hx-request") user_agent = request.headers.get("user-agent", "").lower() if "mozilla" in user_agent or "webkit" i...
Simon Willison (@simonw) on X TIL Google Chrome has a --headless option you can use to take a screenshot from the CLI that's built into the default installation https://t.co/hoA4ujPSTh X (formerly Twitter) Ā· twitter.com [1] Huh, so this is just built right into the chrome cli. /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \ --headless \ --screenshot=/tmp/shot1.png \ https://simonwillison.net Note This post is a thought [2]. It’s a short note that I make about someone else’s content online #thoughts References: [1]: https://twitter.com/simonw/status/1772043579231445366 [2]: /thoughts/
![[None]] jinja’s url_for in fastapi [1] does not account for https by default, there is probably a better way, but this is a way that allows me to configure when I use http vs https. @pass_context def https_url_for(context: dict, name: str, **path_params: Any) -> str: """ always convert http to https """ request = context["request"] http_url = request.url_for(name, **path_params) return str(http_url).replace("http", "https", 1) def get_templates(config: BaseSettings) -> Jinja2Templates: templates = Jinja2Templates(directory="templates") templates.env.globals["https_url_for"] = https_url_for ## only use the default url_for for local development, for dev, qa, and prod use https if os.environ.get("ENV") in ["dev", "qa", "prod"]: templates.env.globals["url_for"] = https_url_for console.print("Using HTTPS") else: console.print("Using HTTP") return templates Note This post is a thought [2]. It’s a short note that I make about someone else’s content online #thoughts References: [1]: /fastapi/ [2]: /thoughts/
[1]@cassidoo [1]) on X — I MADE AN APP ✨ https://t.co/BiyX8XZqDK" loading="lazy"> Cassidy (@cassidoo [2]) on X I MADE AN APP ✨ https://t.co/BiyX8XZqDK X (formerly Twitter) Ā· twitter.com Damn are one time paid and have it apps making a comeback? Seems like the perfect thing to have someone else automate and not pay a subscription for. Genius Idea Cassidy!! Now what do you call this, its not software as a service, is this just sofware? Note This post is a thought [3]. It’s a short note that I make about someone else’s content online #thoughts References: [1]: https://twitter.com/cassidoo/status/1770900985382138291 [2]: https://cassidoo.co [3]: /thoughts/
![[None]] import logging from typing import List import strawberry from fastapi import FastAPI from strawberry.fastapi import GraphQLRouter logger = logging.getLogger(__name__) authors = {} books = {} book_authors = {} authors_books = {} def get_author_for_book(root) -> "Author": return authors[book_authors[root.id]] @strawberry.type class Book: id: int title: str author: "Author" = strawberry.field(resolver=get_author_for_book) def get_books_for_author(root) -> List[Book]: print(f"getting books for {root}") return [books[i] for i in authors_books[root.id]] @strawberry.type class Author: id: int name: str books: List[Book] = strawberry.field(resolver=get_books_for_author) authors = {1: Author(id=1, name="Michael Crichton")} books = {1: Book(id=1, title="Jurassic Park")} # relationships book_authors[1] = 1 authors_books[1] = [1] def get_author_by_id(id: int) -> Author: return authors.get(id) def get_book_by_id(id: int) -> Book: return books.get(id) def get_authors(root) -> List[Author]: return authors.values() def get_books(root) -> List[Book]: print(books) print(authors) print(book_authors) print(authors_books) return books.values() @strawberry.typ...
Joining the split keyboards club: a Moonlander story | Carlos Becker This post will describe my experience with a couple of firsts: carlosbecker.com [1] I switched from a 60% vortex pok3r to a 40% corne June, 2021. I can relate to a lot of what Carlos talks about here. I think going from 60%-40% made my journey harder than it needed to be. There’s no going back now, but it took me a really long time to be able to hit all of the numbers and symbols, just figuring out how to do the layout was hard there’s not much space. I didn’t touch type. I never really used my pinkies, except maybe for ESC, Shift, CTRL, Backspace et al. I can relate to this, my typing habits were terrible. Shortly before going split ortho I worked on my speed with lots, and lots of practice on keybr and monkeytype. I took my speed from 35wpm to 80wpm with a few months of steady practice. This is one of the best things I did for myself. Once I got split it dropped down to single digits and slowly rose back up to 80, just barely breaking my PB on monkeytype. I still feel like I still can’t type at my previous max speed — mostly because I wasn’t used to use my pinky and used the ā€œwrong fingerā€ for a lot of...
My workflow, part 1 | Carlos Becker I keep getting asked how my setup works, how I use tmux and nvim over ssh… all that good stuff. carlosbecker.com [1] Carlos has a pretty sick setup here, I can relate to mostly, cept the macos part. My main critique is that I don’t think he gave window managers much chance on linux, and they just don’t work on MacOS/Windows. Most of the time I have a single, maximized window. I can relate to this. I should really make a full post about my experience with tiling window managers. TLDR, I came for tiling and I stayed for the workspaces. Multiple Displays An exception here could be streaming: having multiple displays can help preventing doxing yourself if you only share the screen of one of them. I only did stream like 3 times and that’s what I did, but I’m sure experienced streamers have better workflows (with or without multiple displays). Accurate, my home machine uses one monitor, and for work I use one monitor+laptop. I pair, screenshare, and present quite a bit at work, and its good to have one screen for sharing, and one for seeing things like the app you are sharing from (chat, cams, etc) Note This post is a thought [2]. It’s a sh...