aarol.dev

Recent content on aarol.dev
https://aarol.dev/ (RSS)
visit blog
How do HTTP servers figure out Content-Length?
6 Oct 2024 | original ↗

Anyone who has implemented a simple HTTP 1.1 server can tell you that it is a really simple protocol. Basically, it’s a text file that has some specific rules to make parsing it easier. All HTTP requests look something like this: 1 GET /path HTTP/1.1\r\n Host: aarol.dev\r\n Accept-Language: en,fi-FI\r\n Accept-Encoding: gzip, deflate\r\n \r\n The...

Testing my website for visual regressions with Playwright snapshot tests
6 Jul 2024 | original ↗

Making changes to websites is tricky, because even small changes may lead to visual regressions in the page layout. For example, changing a bit of CSS to fix something somewhere may blow up in a completely different place. I could just click around and make sure everything looks okay, but that is boring and error-prone. What if I told you that...

Creating a battery indicator app for my SteelSeries Arctis headset
14 Apr 2024 | original ↗

Recently, the cushions of my old headset, the HyperX Cloud Stinger, were breaking apart pretty bad. I had been using them for 5+ years at that point, so it was time for an upgrade. I bought a new wireless gaming headset, the SteelSeries Arctis Nova 7. So far, it has been great. I was expecting to feel a noticeable delay in the audio since they...

aarol/reload
12 Dec 2023 | original ↗

Go package for soft-reloading web server assets

Useful functions when doing Advent of Code in Go
9 Dec 2023 | original ↗

Advent of Code is an annual set of Christmas-themed computer programming challenges that follow an Advent calendar. It has been running since 2015. The programming puzzles cover a variety of skill sets and skill levels and can be solved using any programming language. Participants also compete based on speed on both global and private...

Setting up a Windows Dev Drive with Go
5 Nov 2023 | original ↗

Dev Drive is a new type of storage volume in Windows 11 that is specially made for programming workloads. Instead of the typical NTFS filesystem, it uses ReFS (Resilient File System), which is a newer filesystem based on Copy-on-Write (COW) linking. Basically, if you have two copies of a file, only one copy actually exists on the disk. The other...

Generating OpenGraph images with Hugo
23 Sept 2023 | original ↗

Have you ever shared a link somewhere and wondered where those little preview images of websites come from? Well if you didn’t know, they are called OpenGraph tags. Open Graph protocol was invented by Facebook and is now used by many other social media sites, like X (Twitter), LinkedIn, Reddit, Discord, Mastodon and many others. They look like...

Ylioppilaskokeet
30 Jun 2023 | original ↗

Valmistuin ylioppilaaksi keväällä 2023. Kirjoitin viisi eri ainetta, joista sain seuraavat arvosanat: Aine Pistemäärä / Max Arvosana L:n pisteraja Äidinkieli 80 / 120 E 89 Pitkä englanti 271 / 299 L 267 Pitkä matematiikka 105 / 120 L 81 Fysiikka 84 / 120 L 81 Kemia 111 / 120 L 99 Olin...

Hosting Vaultwarden on fly.io for free
22 Apr 2023 | original ↗

After Lastpass suffered a massive data breach last year, I began looking for an alternative password manager. Bitwarden is another centralized password manager like LastPass, but with the added benefit of being completely open source! They also allow you to spin up your own Bitwarden server and connect to them with all of their clients. Fly.io...

Writing a semaphore in Go
9 Jan 2023 | original ↗

Compared to Javascript, Python and other single threaded languages, Go takes a very different approach to I was having difficulties understanding how concurrent Go programs are supposed to work. Coming from single-threaded event-driven languages like Dart and Javascript, it was not easy wrapping my head around things like mutexes or channels. I...

How to get rid of the annoying firewall prompt on 'go run'
9 Dec 2022 | original ↗

TLDR: # http.ListenAndServe(":8080", nil) // bad http.ListenAndServe("localhost:8080", nil) // good If you are using Go with Windows, you might encounter a small annoyance when running a http server. When using go run to run the server, Windows Defender will sometimes prompt you for firewall access. Here is an example of a Gin server doing...

Useful shortcuts and settings in VS Code
11 Nov 2022 | original ↗

Shortcuts # Ctrl + Shift + K : Delete current line Alt + Down/Up : Move selected line(s) up/down Alt + Shift + Down/Up : Duplicate selected line(s) up/down Ctrl + D : Select next occurrence of selection (shown below) Ctrl + K + Ctrl + D : Unselect the last occurrence and select the next one (used in combination with Ctrl + D )...

Variable fonts helper
24 Sept 2022 | original ↗

Self host variable fonts from Google Fonts

Running Stable Diffusion locally on Windows
26 Aug 2022 | original ↗

ATTENTION: there are now several forks of SD that offer web GUI’s and can install on Windows in one click (most notably sd-webgui). If you want to run Stable Diffusion programmatically and don’t mind some extra steps, read on. Prerequisites # In order to run Stable Diffusion locally on Windows, you will need a Nvidia GPU with at least 8 GB of...

Building a SPA with Fly.io and Caddy
29 Jul 2022 | original ↗

Fly.io is a cloud service that can be used to easily deploy fullstack applications on the web. You only pay for what you use, and servers can be scaled up and down easily. Fly.io supports lots of frameworks and Docker images, which will come in handy. I’ll show how you can deploy a Caddy web server serving a single page application with a Go...

Why I can't use linux on the desktop yet
19 Jul 2022 | original ↗

X11 doesn’t support monitors with variable refresh rates: When using one 60hz monitor and one 144hz monitor, the shell (Gnome, KDE etc) will run at 60hz on both monitors. Wayland might fix this, but: Wayland is not enabled on Nvidia GPUs by default. Even if it is possible to use Wayland with the proprietary drivers, it’s not stable enough to be...

Don't copyWith a ThemeData in Flutter
6 Jun 2022 | original ↗

While reading the code of flutter apps, I’ve seen this particular piece of code repeated way too many times: return MaterialApp( theme: ThemeData.dark().copyWith( textTheme: ... ), home: ... ) This is problematic for a couple reasons that become clear when we take a peek at how ThemeData works. This is taken directly from the material...

Units in SpeedCrunch
1 Apr 2022 | original ↗

There are a lot of units to remember in physics. I often make errors because I forget to multiply by something, or I’m mixing up meters and kilometers by mistake. Wouldn’t it be convenient to not have to worry about that and make the computer to it instead? I recently found out that SpeedCrunch, which is a fast & minimal open-source scientific...

Getting the actual screen height in Flutter Android
19 Mar 2022 | original ↗

The app I’m currently building has a feature which displays a custom wallpaper on the home screen. It involves the user choosing an image from their gallery and cropping it to their device’s aspect ratio. The app then modifies the image and sets it as the background. There’s just problem: How do I get the pixel dimensions of the screen? Screen...

First post
6 Mar 2022 | original ↗

This is the first post on my website. I made this website to host anything that I want to publish. My number one goal is to write about things that atleast one person somewhere might find useful. Solutions to problems that I have encountered, guides on languages/frameworks or just something cool I want to share. Static site generation # Static...

Goclean
1 Jan 2022 | original ↗

A small utility to delete folders easily

About me
1 Jan 2001 | original ↗

👋 Hi, I’m Aaro # I’m a 20-year-old living in Finland, currently studying computer science at Aalto University. 🦀 Favorite programming languages # Go Rust Typescript C++ 🎮 Favorite games # Team Fortress 2 Monster Hunter: World Warframe Terraria 🖥️ Setup # AMD Ryzen 3600x with 16 GB RAM, RTX 3060 Ti Visual Studio Code Obsidian.md 📮...

↑ these items are from RSS. Visit the blog itself at https://aarol.dev/ to find other articles and to appreciate the author's digital home.