realcorvus

realcorvus

Setting User-Agent in Elixir with Finch, HTTPoison, Req, or Tesla

Four examples of how to set your user agent when making HTTP requests, thank you!

1
Post #839
Onor.io

Onor.io

Two Kinds Of Elixir Constants

Two ways you can emulate a constant in Elixir code.

1
Post #840
chriseyre

chriseyre

This is a walkthrough of how to use javascript in a clean manner in a livebook component:

4
Post #842
realcorvus

realcorvus

ElixirConf 2022 Teller Challenge Writeup

My writeup on the Teller challenge, I did the virtual one, which was different from-person.

1
Post #843
dewetblomerus

dewetblomerus

A list of things a newcomer could skip vs things they need to start immediately.

2
Post #844
soyjeansoy

soyjeansoy

I wrote a blog post for creating a simple infinitescroll page using LiveView, Intersection Observer API and JS interop using phx-hook.

2
Post #845
NataliaCuriosum

NataliaCuriosum

“I am the classic example - my background is mainly Ruby” - he said. Why Michał changed his programming road?

Meet Michał Buszkiewicz - a Senior Elixir Dev himself! He’ll give us his insights on what it means to be a SENIOR Elixir programmer, share some of their favourite features, and talk through how he developed over time (and how you can develop yourself!)

https://curiosum.com/blog/junior-to-senior-who-is-senior-elixir-dev-interview-michal-buszkiewicz

Elixir is a hot topic in programming right now. I could tell you about its benefits, but why don’t we just go ahead and ask this guy who knows everything there’s to know?

Learn more from the interview!

1
Post #846
realcorvus

realcorvus

Elixir code style, a brief example

The other day I wrote

  def build_string(a, b, ops, sep) do
    Enum.reduce(ops, "", fn op, acc ->
      acc <> sep <> Integer.to_string(calculate(a, b, op))
    end)
    |> String.trim_leading(sep)
  end

For a function, and was annoyed by how ugly it was. Improved version is

  def build_string(a, b, ops, sep) do
    ops
    |> Enum.map(&calculate(a, b, &1))
    |> Enum.join(sep)
  end

The real point of the blog post is to avoid introducing cases like the first function, which requires a call to String.trim_leading.

0
Post #847