My name is José Diogo Viana, but everyone calls me /(Zé|Diogo)/.
I'm a Backend Engineer at Remote.
Here, you can find posts about random things I explored either in my free time or discoveries at work.
At night, I'm building Albwer, with a great friend.
Look around the post list or other website pages to know a bit more about what I do: 👨🏼💻🍺⚽️
Do you see any error? This website is open source
As the title implies, I wanted to analyse and discover patterns in my house’s electricity consumption. Which days consumed the most electricity, and what hours do we have peak consumption? On the other side, we also have some photovoltaic panels that produce energy for direct consumption. With both metrics, I can discover a lot of interesting heuristics, for example, the best hours to power the washing machine and take direct advantage of the sunlight we get in Portugal ☀️. For that, I’m using Elixir’s Livebook for the whole data manipulation and visualization.
Even if you’re relatively new to the Elixir ecosystem, you have likely come across the concept of generators. These generators are very common and you may recognize them from running commands like
mix new hello_world, or
Phoenix related commands. The cool thing is that these generators are not unique to big projects you have been following or using in the past. You can develop custom generators for your projects quite easily if they benefit from having something similar in place.
Metamask is an Ethereum crypto wallet, and serves as a gateway to dApps (decentralized Apps). By using a solution such as
Sign in with Metamask (or any other wallet, as highlighted before) the user doesn’t need to worry about an extra
username + password combo. There are several solutions to do this using React or any modern JS Framework, but in this blogpost I’ll tackle this using Elixir’s LiveView.
In this post you get an insight into how you can turn asynchronous requests into synchronous ones, using a
GenServer and the
handle_call function without a reply in place. This is possible because of an existing
reply/2 function that enables us to explicitly send a reply to a client when the reply cannot be specified in the return value of
handle_call/3. There are a few catches, of course, so be sure to read till the end
During the last 12 months, more or less, I had to build 3 different services that were highly concurrent and required some degree of resilience and fault tolerance. These services had different requirements and did completely different things, but after the third one, I noticed that I’m pretty much using the same recipe for the structure. That’s what I’ll talk about in this blog post, and at the end, I expect to have given enough insight into this recipe, so that you can also follow it in your next project or even make it better.