A Simple Echo Server in Zig
🖊️ Austin Riba ⌚ 🔖 code zig 💬 1
Recently I’ve been trying to hone my low-level programming skills. Zig is cool and it’s less painful than Rust.
Eventually I’d like to implement a HTTP server. We’ll see if I get there. As a baby step, here is a simple echo server written in Zig:
Should MIT Really be the Default License?
🖊️ Austin Riba ⌚ 🔖 code 💬 0
When and why did MIT become the default license for open source projects?
I was watching some Fireship videos yesterday and one popped up called The Dark Side of Open Source // What really happened to Faker.js? I am familiar with the story of Aaron Swartz, but I had not heard about faker.js. The author of this extremely popular library got so fed up with companies taking and giving nothing in return that he blanked out the repo and broke it for everyone.
I couldn’t help but notice faker.js was under the MIT license.
What Learning Rust Feels Like
🖊️ Austin Riba ⌚ 🔖 code memes 💬 0
I think I’m going to try Zig
A Web Component for Highlighting Remote Code with Prism
🖊️ Austin Riba ⌚ 🔖 code 💬 0
I was playing around with Web Components and thought it would be neat to be able to display code snippets, but instead of static text load the content from a remote source. For example, displaying the source code for a file hosted on Github inline in a blog post. Thus prism-remote was born.
I’ve been using Kagi for a month and I haven’t missed Google for a minute. Crazy to me how it can absolutely demolish one of the world’s most powerful company’s flagship products.
The Power of Django, HTMX and django-components
🖊️ Austin Riba ⌚ 🔖 code django python 💬 5
In this post, I’m going to explore using Django, HTMX, django-components and a slick project layout to build the best todo app you’ve ever seen that doesn’t require React.
A minimal todo app for Waybar
🖊️ Austin Riba ⌚ 🔖 linux 💬 0
What is the simplest TODO app imaginable? In my opinion, it’s just a text file
in your home directory named todo.txt
. One line per item, edited with Vim. No
need for additional software, websites, or electron apps.
Using standard unix tools, this setup is easy to extend. In my case, I wanted a persistent, nagging reminder of my constant procrastination. I also use waybar. Naturally then the end goal is a custom module.
Obviously, it displays the number of TODOs you have remaining. Additionally, hovering over the module will print display them in a tooltip. When you click a new Neovim instance will spawn opening the file.
Simple and effective. Here’s the code. I placed this is ~/.config/waybar/scripts/todo.sh
:
#!/bin/bash
COUNT=$(wc -l < ~/todo.txt)
TODOS=$(cat ~/todo.txt | head -c -1 - | sed -z 's/\n/\\n/g')
printf '{"text": "%s", "tooltip": "%s"}\n' "$COUNT" "$TODOS"
And then add a custom module to ~/.config/waybar/config
:
"custom/todo": {
"exec": "~/.config/waybar/scripts/todo.sh",
"return-type": "json",
"format": "{} todos",
"on-click": "wezterm -e nvim ~/todo.txt",
"interval": 5,
}
Replace wezterm with your preferred terminal emulator and you should be good to go!
Speeding Up API Endpoints using Python AsyncIO
🖊️ Austin Riba ⌚ 🔖 code python 💬 0
As a developer, you want the APIs you write to be as fast as possible. So what if I told you that with this one simple trick, you might be able to increase the speed of your API by 2x, 3x, or maybe even 4x? You’d probably tell me to get lost with the clickbait, but hear me out. In this article you will learn how to utilize Python asyncio, the httpx library, and the Flask micro framework to optimize certain parts of your API.
A Humble Makefile
🖊️ Austin Riba ⌚ 🔖 code 💬 0
I’ve been adding GNU Makefiles to all my projects recently and it’s not because I’ve suddenly become a C programmer.
Shell Plus for SqlAlchemy
🖊️ Austin Riba ⌚ 🔖 code python 💬 1
If you’ve ever used Django, you might be familiar with Django Extensions Shell Plus. It allows you to execute $ ./manage.py shell_plus
for a very handy iPython REPL with all your ORM models pre-imported. This snippet will allow us to accomplish the same with FastAPI or Flask.