Cristian Álvarez's Avatar

Cristian Álvarez

@crbelaus.com

I write software (mainly #ElixirLang) and I do martial arts. Sometimes I blog at https://crbelaus.com/

736
Followers
128
Following
64
Posts
31.08.2023
Joined
Posts Following

Latest posts by Cristian Álvarez @crbelaus.com

Preview
Release v0.7.0 · elixir-error-tracker/error-tracker What's Changed Igniter installer by @crbelaus in #149 Improve documentation of Error kind field by @tjarratt in #154 Require LiveView 1.0 at least by @crbelaus in #159 Require Ecto 3.13 at least b...

Version 0.7 of the #ElixirLang Error Tracker 🐛 is out with improved LiveView support, MariaDB fixes, better sensitive header redaction and an all-new Igniter installer.

github.com/elixir-error...

09.11.2025 10:22 👍 12 🔁 1 💬 0 📌 0

It's official! Igniter support is coming to the next version of #ErrorTracker 🚀. It's already merged on main and will be included in the next release @zachdaniel.dev #ElixirLang

11.05.2025 18:03 👍 22 🔁 5 💬 1 📌 0
Preview
Customize the Logger metadata key name by crbelaus · Pull Request #1267 · elixir-plug/plug In certain scenarios we may want to use the Plug.RequestID plug multiple times with different headers or assigns. While this is possible, the issue is that every call adds a :request_id key to the ...

I got a small PR merged into Plug.
You could use Plug.RequestID multiple times with different options but it always set the same logger metadata, overriding the previous value with each call.

This is configurable now.

github.com/elixir-plug/...

#myelixirstatus #elixirlang

24.04.2025 06:48 👍 7 🔁 0 💬 0 📌 0
Embedding external resources in Elixir code | Cristian Álvarez Belaustegui If your Elixir module reads external resources during compilation you should use the @external_resources attribute so the compiler can track those resources and recompile when they change.

I wrote about embedding external resources in your #elixirlang application so the compiler can keep track of when they change.

crbelaus.com/2025/03/31/e...

06.04.2025 05:58 👍 8 🔁 1 💬 0 📌 0
Difftastic can now properly highlight changes in Elixir ~H sigils.

Difftastic can now properly highlight changes in Elixir ~H sigils.

My pull request has just been merged!
If you use difftastic with #elixirlang (you should! it is amazing) you will notice that changes in ~H sigils are now properly highlighted.

github.com/Wilfred/diff...

10.02.2025 17:52 👍 21 🔁 1 💬 1 📌 0
Preview
GitHub - elixir-error-tracker/error-tracker: 🐛 An Elixir-based built-in error reporting and tracking solution 🐛 An Elixir-based built-in error reporting and tracking solution - elixir-error-tracker/error-tracker

The #elixirlang ErrorTracker has just surpassed 40k downloads.
Codebase has been slowly improving and stabilising since the initial release. We just need a logger handler and then it can be considered "done".

github.com/elixir-error...

10.02.2025 09:01 👍 10 🔁 1 💬 0 📌 0

Other shows I enjoyed recently are: Yellowstone, The Americans and Ozark.

04.01.2025 19:52 👍 1 🔁 0 💬 0 📌 0

Silo is amazing. Best sci-fi show I've watched lately along with Severance. Others (Fallout and The Expanse) are great but not at the same level IMHO.

04.01.2025 19:48 👍 1 🔁 0 💬 1 📌 0

Amazing to see how well the ErrorTracker and @ash-hq.org work together 🤝

31.12.2024 18:42 👍 2 🔁 0 💬 0 📌 0

Thread worth reading for #ElixirLang devs.

28.12.2024 09:58 👍 2 🔁 0 💬 0 📌 0

For example "upcoming_events" may be such a scope that is extracted. Each LiveView or controller builds its own query based on that scope and then applies the required ordering, filtering, etc.

28.12.2024 09:57 👍 1 🔁 0 💬 0 📌 0

This is what we do at work and so far it has worked great. We try to keep an eye on common "scopes" (as Ruby on Rails calls them) that show up in multiple queries and extract them out.

28.12.2024 09:57 👍 2 🔁 0 💬 1 📌 0

I started using it in my day job (about 12 people in the team) and for my personal projects as well.
You can use it on any git repo without forcing others to switch (the rest of the team is using git).

26.12.2024 20:11 👍 1 🔁 0 💬 0 📌 0

After using it daily for a few weeks I can confidently say that jj is to git what Tailwind is to CSS.

I went from "I don't think this adds any value over vanilla git" to "I don't know how I ever worked without this".

26.12.2024 09:56 👍 2 🔁 0 💬 1 📌 0

This is the way.

18.12.2024 14:57 👍 0 🔁 0 💬 0 📌 0
Preview
GitHub - michallepicki/asdf-erlang-prebuilt-macos: Erlang plugin for asdf version manager, using Erlang builds by erlef/otp_builds for macOS Erlang plugin for asdf version manager, using Erlang builds by erlef/otp_builds for macOS - michallepicki/asdf-erlang-prebuilt-macos

TIL that you can use github.com/michallepick... to install prebuilt Erlang versions with asdf instead of compiling them from source. Much faster and less problematic.

18.12.2024 08:16 👍 8 🔁 1 💬 0 📌 0

Just compiled my job codebase to #ElixirLang 1.18 rc.0 and it already found dead code (four unused function clauses which were the only callers of some other private functions) and a typing violation (min/2 comparison between two structs).

17.12.2024 11:48 👍 7 🔁 1 💬 0 📌 0

Por el momento nada, pero le tengo muchas ganas. Todo lo que he visto es brutal, especialmente esto:
bsky.app/profile/giac...

14.12.2024 11:00 👍 1 🔁 0 💬 1 📌 0
Changelog for Elixir v1.18 — Elixir v1.18.0-rc.0

Elixir 1.18 improves the type inference and checking and is now able to detect dead code, clauses that will never match, etc.
hexdocs.pm/elixir/1.18....

This will only get better over time. For example upcoming Elixir versions will be also able to do type inference on guards.

12.12.2024 15:32 👍 0 🔁 0 💬 0 📌 0

This allows the compiler to understand which data structures you are using an helpfully warn you if you try to access non-existing fields.
This makes it so much easier to move fields around and rename them confidently.

12.12.2024 15:32 👍 0 🔁 0 💬 1 📌 0
Screenshot showing a `deactivate/1` function. In one case it pattern matches on the `%User{}` struct so the compiler will warn us if we try to access non-existing fields. In the other case there is no pattern match, so the compiler doesn't know that we are working with a `%User{}` and we will have runtime errors instead of compilation warnings.

Screenshot showing a `deactivate/1` function. In one case it pattern matches on the `%User{}` struct so the compiler will warn us if we try to access non-existing fields. In the other case there is no pattern match, so the compiler doesn't know that we are working with a `%User{}` and we will have runtime errors instead of compilation warnings.

Over the last few months I've been in charge of deep data structure refactors on a big #ElixirLang application.
I'll write a detailed blog post with the lessons learnt, but the most important takeaway is to rely on pattern match and guards as much as possible.

12.12.2024 15:32 👍 3 🔁 0 💬 1 📌 0

Just added the book to my reading list. I’ve also found the exercises and will start doing them tomorrow morning.
Thanks for the recommendation @thebrianb.bsky.social !

11.12.2024 21:48 👍 1 🔁 0 💬 0 📌 0
Preview
Healing Back Pain: The Mind-Body Connection “Dr. Sarno saved me from a life of pain.” — Howard Ster…

Thanks! I will take a deeper look. I've been also recommended this book: www.goodreads.com/book/show/14...

10.12.2024 10:43 👍 1 🔁 0 💬 1 📌 0

Good luck! (Or break a leg 😂)
We in the Elixir community are thankful for your work!

09.12.2024 19:34 👍 2 🔁 0 💬 1 📌 0

Looks like I have to learn other things than playing the guard!

09.12.2024 19:32 👍 0 🔁 0 💬 0 📌 0

Very interesting. Thanks! 🙇‍♂️

09.12.2024 19:31 👍 1 🔁 0 💬 0 📌 0

He doesn’t recommend me using a standing desk, but I have a strong feeling that switching between sitting and standing while working would benefit me.

Anyone with a similar problem has tried the standing desk? Thoughts?

09.12.2024 10:03 👍 1 🔁 0 💬 2 📌 0

I’ve been diagnosed with a damaged L4-L5 disk. Doctor tells me that BJJ is not doing any good to my lower back and I’d better do pilates/swimming instead.

09.12.2024 10:03 👍 5 🔁 0 💬 2 📌 0
Preview
Easy, alternative soft deletion: `deleted_record_insert` An alternate to traditional <code>deleted_at</code> soft deletion that stays out of the way and minimizes bugs.

I was going to suggest this same approach: triggers that convert the updated/deleted row to a JSON object that can be logged or archived.
@brandur.bsky.social provides a great example in brandur.org/fragments/de...

07.12.2024 21:30 👍 2 🔁 0 💬 1 📌 0

Wait. I have to check this out.

29.11.2024 07:25 👍 0 🔁 0 💬 1 📌 0