I am Fernando, a Full Stack developer, with passions in embedded system and 3D printing. Creating blog posts is a great way for me to share content I really like, so I started blogging. I hope you enjoy my content!
In my first post about this file format I squeezed every country, region and city boundary on Earth into a 72 MiB file. The two fixes that took it to 45 MiB have their own post, and I ended up there with zlib doing the last step. I didn't think there would be something better than this for a while. Then I had an idea, and this is the result: a ~57% reduction in file size. The same format also…
The worldwide loc-to-city file went from 75,935,694 bytes (72.4 MiB) to 47,620,804 bytes (45.4 MiB), which is 37.3% smaller, with two changes to the file format. Measured on the real worldwide file, with percentages relative to the "before" row:
I started loc-to-city because my favourite photo manager kept telling me the wrong city. It has since turned into something I keep reaching for in other projects, so this post is about the tool and the file format it produces, not about the photo manager. The headline I still find hard to believe: every country, region and city boundary on Earth, at a resolution of roughly 300 by 150 metres, in a…
When working with Postgres and dealing with geometric data types, you may encounter situations where you need to convert a polygon into its constituent points. I was unable to find a straightforward function to achieve this, so I used some hacky string replace operations to extract the points from a polygon.
SQL queries are typically seen as something magical, but understanding how they get executed behind the scenes helps you in debugging them. SQL engines typically apply a lot of optimizations in the background to speed them up, but understanding the simple model still helps you to know why something happens and even allows you to build your own SQL like engines The SQL engine follows the following…
Sometimes you just want to run a Minecraft server on your server, but you don't want to run it in a screen session, or you want to run it as a different user. This is where systemd comes in.
One issue I encountered while using Arch Linux is that after some recent upgrade, the system would freeze if it went into sleep mode, which was quite annoying as it would result in the loss of all your work. With some detective work, I looked into the logs from the previous boot to see what was happening:
Curl support creations of a header file when making requests, this is quite useful for shell scripting, as some services provide metadata only via the headers. An exampe of this is the GitHub API, which provides the rate limit and pagination information in the headers. To create a header file, you can use the -D flag, which will write the headers to a file. An example of this is:
One of the underused HTML elements is the <details> element. For the uses
cases this tag gives you, it is not used enough on websites. Lets explore its uses together. This tag is used to make an expanding/collapsing
detail/summary view. The browser then adds interaction to the element, allowing
the user to open/close the element itself. Lets take a look at a basic example:
Webpack looks like a quite intimidating system, but having played around with
them, they are very simple. In this article we will be creating our own loader
from scratch and adding them to our webpack configuration.
When you start with React, it is common that you just start a project with the
CRA tool. While this quickly makes a project, it also does lots of magic in the
background to make it work. For learning purposes, it can be better to write
your own configuration to build a react application.
If you read this quickly after publication, the chance is high you are on my
newly build website. There are multiple techniques used on this website to
archive my goals. Doing this mix with a static website vs easy to add content
was quite the technical challenge, but looking at this website shows I succeeded
in my goals.
In 2021, I was playing around with the online TypeScript sandbox, when I
discovered a weird issue. When trying to write XML to the terminal, it instead
of showing me the string representation, it was actually executing it. While it makes sense for a code sandbox to execute the code you input, it is
important it stays within the sandbox, as the sandbox has the proper
restrictions put on the…
One important thing when playing around with an 3d printer is having a test
pattern, which is useful to test if your printer is working. You want a pattern
that is quick to print, and interesting to show of to others.
Creating small Javascript games is a great way to learn coding. So I make
another breakout game. This time I used Ecmascript Modules and classes. The core design of this breakout is an event bus architecture. Every entity can
throw an event, which affects the game in a certain way.For example, the score
reducer listens to the brick destroyed event to handle updating the score. The
powerup entity…
When working with GitHub, you have the advantage that everything is stored in the cloud. While this is fine for most people, it can be useful to make a local backup in the case you expect to have no internet for a certain period of time, like a vacation.
Creating small Javascript games is a great way to learn coding. As part of
learning, I developed a breakout game. This game features a level selection
screen, which generates levels based on some math. This game used the module pattern to connect all the components together.