Fernando Mendes

eventually consistent in the sense that I consistently fail for a living.

Read this first

stop the overhead, refresh from your editor

tl;dr: I am lazy and I made a script for when I don’t have webpack to refresh my browser for me. I can now refresh it from my editor. It’s available here. This is specific for macOS. Script is explained ahead.

I’m a lazy programmer. If anything requires me to get off my terminal or my vim, I will probably automate it. Like checking the most recent xkcd.

Sometimes I don’t have webpack to refresh my browser for me. This is an issue because it requires me to change focus from the terminal to the browser and then refresh. You may think that automating this is a huge overkill. However, I found that having a shortcut in my editor to do that has significantly decreased the time it takes for me to process everything that happened.

Let’s go through this one step at a time.

First of all, you need to do cmd+tab. You are very likely to code in full screen and in macOS which means you have a cute...

Continue reading →


I always wanted to do a screencast

I always wanted to do a screencast. I was also always afraid to do it.

That being said, it’s called Beware of the Software and the first episode is here:

You can find the code for it here.

The screencast is going to be about… uh… computer stuff, let’s call it that. I can’t promise you it will always be about Elixir or distributed systems. But at least the next batch of episodes will be precisely on that. Distributed systems with Elixir. From there, I’m thinking about going through some CS papers. I also take suggestions if you’re willing to give them.

I’m still learning and experimenting with the format so it is far from perfect… Or maybe even “good”. But you can help me make it good.

I’m asking everyone for feedback. Drastically reducing the number of minutes, showing myself while coding, increasing the font size, tips for the mic and voice. Help has been invaluable. Hit me on...

Continue reading →


mix format in vim from anywhere (or just in umbrella apps)

Spoiler alert: This post is about setting up vim so that you run mix format automatically when you save a file and have it detect the nearest .formatter.exs

I have this weird issue with mix format and umbrella apps.

The issue is that mix format assumes you have a .formatter.exs file in the current directory. If you don’t, it doesn’t look upwards in the file tree. It simply assumes you want to run it with the default config. You can change this behaviour by using the --dot-formatter flag to explicitly point to the formatter file you want to use.

Now, in vim you can also use ale to run mix format on save. If you don’t know ale, take the time to do so. I set up ale to do this precisely by adding the following line to my (n)vim config:

let g:ale_fixers['elixir'] = ['mix_format']

Most of the time you will be good to go with this and you won’t find any more issues.

But when I’m working...

Continue reading →


a look into bloom filters with ruby

Disclaimer: this blog post was originally written and published in the Subvisual blog in April 2016.

I remember one particular class I had. It was late May and, as pretty much every Spring day in Portugal, the sun decided to greet us with a little too much enthusiasm.

The class was about Reliable Distributed Systems, as part of my Distributed Systems & Cryptography master’s program. Distributed Systems students at University of Minho have their classes every Monday in the mythical 0.05 room. A room conveniently located just a couple of meters away from the coffee machine. A room in front of a beautiful, grassy, green patch right in the middle of the campus. A room where the blazing heat caused by 6 straight hours of direct sunlight meets the noisy embrace of dozens of servers in the back. Of course, eager PhD students have millions of tests, queries and transactions to analyse, which...

Continue reading →