Elixir ▷ Max

Elixir ▷ Max

@mxgrn.com

https://x.com/elixirtap Have *you* fallen for #ElixirLang yet? TILs and reflections from my 10 years with Elixir. Cranking out Elixir for jumpapp.com on weekdays. Cooking on my days off.

1.7K followers105 following419 posts

In the AI era, a good developer's core job is _understanding_ what the AI wrote, down to the details when it matters. Understanding complex systems is a rare skill. It always has been. So demand for good developers isn't going anywhere. If anything, it's going up.

... and the talk is now public! bsky.app/profile/elix...

ElixirConf@elixirconf.bsky.social

We've got a great surprise! 🎉 If you couldn't attend this year, some of the videos are now public. www.youtube.com/playlist?lis... We can't wait to see you at our next events this year: CBL Stockholm, ElixirConf US and Code BEAM & MQ Summit in Haarlem. ✨

A small TIL for Git lovers: `git merge-base HEAD main` gives you the nearest common commit between the current branch and main. That's the commit where those two parted ways.

People have always been wary of computer viruses, and for good reason. Now, we have much smarter non-deterministic (!) systems running our VPSs and laptops, online, with increasing access to other services. What can go wrong?

So sad that Telegram has a bad reputation in the West. It's *by far* the best UI/UX messenger out there. WhatsApp doesn't even come close (although I love the fact that it runs on the BEAM).

For as long as I can remember, I thought these were equivalent: 1) if foo, do: bar, else: baz 2) foo && bar || baz Until the day bar was nil. #ElixirLang

I don't know who needs to hear this, but this works in #ElixirLang (new line after :foo is key): if true, do: (:foo :bar) Can you guess what it returns?

Want a supervised task to finish (not get killed) during rolling #ElixirLang deployments? Simply trap the exit: Task.Supervisor.start_child( MyApp.TaskSupervisor, fn -> Process.flag(:trap_exit, true) do_work() end ) The task will have 5 seconds to finish.

Just downloaded ChatGPT Atlas, and I must say this direct browser-ChatGPT integration can be very useful. It just walked me through creating a free-form Google Analytics report, which I had no knowledge of. Previously, I'd need to send ChatGPT screenshots of where I was, and it was tedious.

Are you learning a foreign language by any chance? And what are the odds you use Telegram too? 🤔 I’ve been building a Telegram bot that finally makes vocabulary learning with spaced repetition fun for me, thanks to LLMs. Maybe it will for you, too. Give it a try: t.me/lexicornbot?...

TIL: If you append /rss to the link of any bsky profile, you'll get, well, an RSS feed. Handy if you really don't want to miss posts from a specific someone.

Want to disable all unmocked HTTP calls from Req at once during #ElixirLang tests? Simply add this to test/test_helper.exs: Req.default_options( adapter: fn req -> raise "Unmocked call to #{req.url}" end ) (replace `raise` with a log warning if that's more useful)

It's easy to keep nudging the AI until it 'fixes' the tests, and it feels like achieving something, while the value of such tests may be plainly negative. Seeing too many false positives like that lately.

Quick Neovim pro tip: Say, you’re adding a keymap and are torn between using a leader/space as a prefix or <C-somekey>. Choose Ctrl when pressing this combination repeatedly would make sense, such as for actions like moving around. Choose a prefix for stand-alone actions, like firing a command.

Ok, I ran out of available <c-somekey> mappings. But guess what, Ghostty enabled the whole bunch of <option-somekey>'s for mapping. Current challenge: what finger do I use to press <option>? 🤔

Just something to casually mention to your next non-Elixir developer friend.

Josh Price@joshprice.com

Let’s recap: BBC uses custom Elixir DSLs to serve 📈 600m+ monthly unique views 💻 12 servers (down from 100 🧑‍💻 7 #elixirlang engineers! Mind blowing! 🤯

When to name your #ElixirLang function with a bang? Only if the function is *expected* to throw errors during normal execution. Do not simply 'inherit' bangs from what’s inside that function (`Repo.update!`) if those exceptions would signal a bug (that is, should never happen).

Just published my first Hex package—one that no one else should even consider using. It was simply the easiest way to get its documentation into Dash. Am I doing it wrong? #ElixirLang

#elixirlang and #neovim users, You're probably already using the vim-surround plugin. The following config line will allow you to press % in visual mode to wrap the selection in %{}: let g:surround_37 = "%{\r}" It's useful for converting keyword lists to maps, for example.

Could you recommend an #ElixirLang library for tracking changes in the database, such as for audit purposes? I need it to work with Postgres and Ecto.

I just realized that, for my purposes, I don't even need Elixir or Ecto. Aside from the UI, this should be achievable with pure SQL. Lo and behold, ChatGPT provided exactly what I needed: a log of JSON-formatted differences for changes in selected tables.

I no longer understand why merge commits are so demonized. If every commit is meaningful, why squash? If a PR contains multiple meaningful commits and rebasing guarantees multiple merge conflicts, why rebase? Just merge. Bonus: it preserves the exact history of changes.

Saša Jurić@sasajuric.bsky.social

My opinion on squash merge: don't. This is the hill I'll die on.