Last year, I repurposed an old PC as a home server. Before that, I was already running a few Docker containers on a Synology NAS, but I wanted something more cost-effective—especially when it came to storage capacity.
One of my goals was to define the entire setup as code. I wanted to avoid clicking around in the UI and waiting for pages to load every time I needed to change a setting. So I installed Proxmox (manually), set up API credentials, and jumped on the Terraform bandwagon. With it, I defined all my containers, firewall rules, and the public and private domain names needed to access my services.
Every end of the year, I think about getting back to writing regularly on this blog. And every year, it somehow slips away. Sometimes I lack inspiration. Sometimes I’m unsure what to write about. Other times I worry that what I share might be too obvious or not worth posting.
This year, however, I want to do things differently. Over the past few months, I’ve been working on a couple of projects that have sparked new ideas. I now have notes, discoveries, and stories worth sharing—both about the work itself and the motivation behind it. Writing this down publicly should also help keep me accountable.
I’ll begin with my Homelab and its migration from Terraform to Pulumi. I’m also planning to redesign this website and potentially move away from WordPress on the client side. Expect a few posts on each project, along with regular progress updates.
Although I’m writing mainly for myself, as a kind of learning journal, I hope some of it proves useful to you as well.
Recently I had to write a type-safe function that allowed to update (nested) paths of a JavaScript object. I wanted the function to prevent setting a wrong value to the requested path, even nested ones with optional values.
After playing a bit with TypeScript type system I came up with these types which I think can be useful and will be using for sure in future projects. You can play with it in this playground or see the code right below:
exporttype KeyPath<
T extendsstring,
K extendsstring,
Separator extendsstring = ".",
> = `${T}${""extends T ? "" : Separator}${K}`;
exporttype KeyPaths<T extends object, P extendsstring = "", Separator extendsstring = "."> = {
[K in keyof T]-?: K extendsstring ? NonNullable<T[K]> extends object
? KeyPath<P, K, Separator> | KeyPaths<NonNullable<T[K]>, KeyPath<P, K, Separator>, Separator>
: KeyPath<P, K, Separator>
: never;
}[keyof T & string];
exporttype GetTypeAtKeyPath<T, Path extendsstring, Separator extendsstring = "."> = Path extends keyof T
? T[Path]
: Path extends`${infer K}${Separator}${infer Rest}` ? K extends keyof T
? NonNullable<T[K]> extends object
? GetTypeAtKeyPath<NonNullable<T[K]>, Rest, Separator>
: never
: never
: never;
Code language:TypeScript(typescript)
Modern front-end developer experience is nicer than the one we had in 2007 when WordPress came out.
CSS preprocessors help you reduce boilerplate and reuse mixins.
TypeScript minimizes runtime errors with its type-checking and IDE auto-completion.
The latest syntactic sugar from ECMAScript drafts makes your code simpler.
Partial content refresh when files change with HMR enables a seamless experience.
Regular WordPress themes require reloading the entire page when any JavaScript or CSS changes. However, with tools like Vite we can achieve a state-of-the-art developer experience.
In this post I will guide you through all the steps required to add SASS, TypeScript, and HMR support to any WordPress theme.
A Twenty Twenty child theme with SASS stylesheet and HMR, and early preview of what we will achieve by the end of the post.Read more →
This post was published 3 years ago so it might be outdated.
JVM ecosystem has a steep learning curve: missing a Maven/Gradle dependency might end up being a cryptic runtime exception about a package that is partially referenced in an XML file. I experienced this recently at work, trying to set up Log4j2 to write JSON logs in an AWS Lambda function.
This post was published 4 years ago so it may be outdated.
When you build a Docker image you will notice a “transferring context” step in the output (“Sending build context to Docker daemon” in older Docker versions) that can take a lot of time. This step is just Docker copying local files so keeping those to the minimum will make this step faster.
This post was published 5 years ago so it may be outdated.
throttle and debounce are two functions widely used in frontend applications but they are confusing and oftentimes used interchangeably even though they are not the same thing. In this article we’ll review both and clarify their differences (or go directly to the interactive demo showcasing the differences).
This post was published 5 years ago so it may be outdated.
It’s easy to make Docker images bigger than needed. This has a negative impact in both push and pull time but it may also be hiding additional problems you should address before they become critical.
In this post I will explain you three techniques to help you slim down your Docker images:
This post was published 6 years ago so it may be outdated.
There are days when you know you are working on something amazing. You would love to share it with the world, but cannot. I felt that every single day at the office for months, knowing that someday – eventually – I would be able to share this project. Finally – today – Geoblink’s Design System has been open sourced (GitHub repository).