Today I learned that arch has a helper script archlinux-java to set the version of java.
Published
All published posts
This is a pretty sweet interface into llms. I used it a bit with my son tonight while he was asking me for datapack ideas.
❯ mods -f 'I am trying to have fun on my minecraft server and am creating a minecraft datapack send me some load.mcfuncions that will make it fun'
You can continue the conversation with a -C
❯ mods -C -f 'I like where you are going with number 4, can you make it so that it runs when a player opens a door'
You can pass it some data
This is a pretty sweet interface into llms. I used it a bit with my son tonight while he was asking me for datapack ideas.
❯ mods -f 'I am trying to have fun on my minecraft server and am creating a minecraft datapack send me some load.mcfuncions that will make it fun'
You can continue the conversation with a -C
The work on mods by charmbracelet.
AI on the command line
I am starting to build out some custom tool holders for my tool box, and using gridfinity. This is a super handy reference guide for spec’ing out the bases.
Today I was running some sqlmodel queries through the sqlalchemy orm. Admittedly I’ve not done enough orm queries before, and I’ve done quite a bit of raw sql. I was trying to get objects from two separate models that had relationships setup.
session.query(User, Images).where(User.id == 3).all()
It is incredibly slow, and gives me the following warning.
SELECT statement has a cartesian product between FROM element(s)
What I learned from the SQLModel docs is that you should give it a join to correct this and go much faster.
So after months of fighting with gf not going to template files, I finally decided to put in some effort to make it work.
This was the dumbest keybind in my config, that I copied from someone else without understanding it.
I have jinja templates in a directory called templates. I want to bind gf to open a template file, but it is trying to open a new file ./base.html
{% extends "base.html" %} {% if request.state.user %} {% block title %}Fokais - {{ request.state.user.full_name }} {% endblock %} {% else %} {% block title %}Fokais {% endblock %} {% endif %} {% block content %} {% if request.state.user %} <h1 id="title" class="inline-block mx-auto text-5xl font-black leading-loose text-transparent bg-clip-text bg-gradient-to-r from-red-600 via-pink-500 to-yellow-400 ring-red-500 text-shadow-xl text-shadow-zinc-950 ring-5"> {{ request.state.user.full_name }} </h1> {% endif %} {% include "me_partial.html" %} {% endblock %}
What did not work #
I tried all sorts of changes to my path, but it still didn’t work.
...
html code generated by my jinja templates generally look half garbage because of indents and whitespace all over the place. I just learned about these pesky Whitespace Control characters that can get rid of the whitespace added from templating.
You can also strip whitespace in templates by hand. If you add a minus sign (-) to the start or end of a block (e.g. a For tag), a comment, or a variable expression, the whitespaces before or after that block will be removed:
I just learned that if you can exec into the container running minecraft with the itzg/minecraft container you can run rcon-cli to get command access to the server. You need to set the RCON_PASSWORD if you want to access rcon remotely, but if you have not already done this and have access to the server you can just run rcon-cli when you are in.
Theo’s response puts a lot of my feelings about unit testing into words. It’s crazy how cargo culty it becomes that the echo chamber of twitter can bring in beliefs that we think we believe, but have not experienced enough or put enough thought in to form our own opinion.
This video made me think so much that it turned into it’s own blog post
thoughts on unit tests
Your browser does not support the audio element.
Theo’s response puts a lot of my feelings about unit testing into words. Many of us have grown up in this world preaching unit testing. We often hear these statements “Everything must be unit tested, tests make code more maintainable.” In reality when we are not writing complex low level code unit tests are probably the wrong approach.
...
Mastadon.py is a python api client for mastadon that makes it easy to cross post to mastadon.
bunny.net looks like an interesting cloudflare alternative.
This is a sick guided site to validate indieweb tags on your site. It makes it much easier than trying to do it yourself.
I came across nvim-macroni from jesseleite, and it’s packed with great features and ideas.
🤌 Save your macros for future use
jesseleite has done a fantastic job with macroni.nvim. Highly recommend taking a look.
Save your macros for future use 🤌
ikalnytskyi has done a fantastic job with httpie-auth-store. Highly recommend taking a look.
Credential store plugin for HTTPie, attaches auth to ongoing request.
Authentication from cli tools can be a bit of a bear, and I have to look it up every time. This is my reference guide for future me to remember how to easily do it.
I set up a fastapi server running on port 8000, it uses a basic auth with waylonwalker as the username and asdf as the password. The server follows along with what comes out of the docs. I have it setup to take basic auth, form username and password, or a bearer token for authentication.
The og of command line url tools.
# basic auth curl -u 'waylonwalker:asdf' -X POST localhost:8000/token # basic auth with password prompt curl -u 'waylonwalker' -X POST localhost:8000/token # token curl -H 'Authorization: bearer...
...
After struggling to get dependencies inside of middleware I learned that you can make global dependencies at the app level. I used this to set the user on every single route of the application without needing Depend on getting the user on each route.
This page shows how to customize your fastapi errors. I found this very useful to setup common templates so that I can return the same 404’s both programatically and by default, so it all looks the same to the end user.