Chienjo retweeted
Phoenix LiveView 0.19.0 is out along with `TodoTrek` – an open source showcase for the new features! Check the blog for details
phoenixframework.org/blog/ph…
Chienjo retweeted
Need to double check some regex written in @elixirlang?
Check out elixirstream.dev/regex - super useful for testing your expressions
#myelixirstatus
Chienjo retweeted
#Elixirlang Tip of the Day: Did you know you can update nested lists with put_in/3 and Access.filter/2? Now how convenient is that?! #myelixirstatus
Chienjo retweeted
TIL `tmux popup` to pop up a mini-shell as a floating overlay window, e.g.
(tmux)$ tmux popup -E "$(which ed) somefile.txt"
Chienjo retweeted
Ergo Framework v.2.2.2 is just released with the new cool feature gen.Pool github.com/ergo-services/erg…. This behavior implements a basic design pattern with a pool of workers. Here is an example of how it looks in action github.com/ergo-services/exa…
#golang #erlang #elixirlang
Chienjo retweeted
In case you didn't know, you can open up the browser with `--open` flag in more and more utilities these days! #MyElixirStatus
$ mix phx.server --open
$ livebook server --open
$ mix docs --open
Chienjo retweeted
The Protobuf tooling for @elixirlang keeps on growing 📈
@JeanParpaillon just put out a neat project, github.com/OffgridElectric/p…. It's a fully-integrated Mix compiler for .proto files. Super handy if you keep those definitions in your Mix project 👨🔧
Chienjo retweeted
Creating complex web UIs often leads people to React or Vue. This quick recipe shows how nested stateful LiveView components keep their state as the user navigates around to other areas. A win for productivity and UX! #MyElixirStatus @elixirphoenix fly.io/phoenix-files/live-re…
Chienjo retweeted
Just wrapped up and merged the Broadway PR into PromEx. I must say...the @grafana dashboard came out beautifully for this plugin. Really happy with how it all came together 😀.
#MyElixirStatus
Chienjo retweeted
You can now use Tailwind as a stand-alone CLI in Phoenix, with no dep on node or npm! `phx.new` will eventually support it out of the box but it’s super quick to add yourself today.
Check my write up to find out how:
fly.io/phoenix-files/tailwin…
Chienjo retweeted
Another fanboy moment of @elixirlang and Ecto
In one transaction, I'm fetching old data, composing it using Delta from @SLAB, inserting it or updating it...
The capability of fetching results from previous operations so cleanly just blows my mind, and it's just so clean❤️
![Image with the following code:
fetch_ops = fn repo, _ ->
case repo.get(Model, id) do
nil -> {:ok, []}
value -> {:ok, value.ops}
end
end
reduce_ops = fn _, %{fetched_ops: fetched_ops} ->
{:ok, Delta.compose(fetched_ops, ops)}
end
set_ops = fn repo, %{reduced_ops: reduced_ops} ->
repo.insert(
Model.changeset(%Model{}, %{id: id, ops: reduced_ops}),
on_conflict: [set: [ops: reduced_ops]],
conflict_target: :id
)
end
Multi.new()
|> Multi.run(:fetched_ops, &fetch_ops/2)
|> Multi.run(:reduced_ops, &reduce_ops/2)
|> Multi.run(:set_ops, &set_ops/2)
|> Repo.transaction()](https://pbs.twimg.com/media/FHF_TMuWUAkB7bR.jpg?name=small&format=webp)
ALT Image with the following code: fetch_ops = fn repo, _ -> case repo.get(Model, id) do nil -> {:ok, []} value -> {:ok, value.ops} end end reduce_ops = fn _, %{fetched_ops: fetched_ops} -> {:ok, Delta.compose(fetched_ops, ops)} end set_ops = fn repo, %{reduced_ops: reduced_ops} -> repo.insert( Model.changeset(%Model{}, %{id: id, ops: reduced_ops}), on_conflict: [set: [ops: reduced_ops]], conflict_target: :id ) end Multi.new() |> Multi.run(:fetched_ops, &fetch_ops/2) |> Multi.run(:reduced_ops, &reduce_ops/2) |> Multi.run(:set_ops, &set_ops/2) |> Repo.transaction()
Chienjo retweeted
“Anger...is not a desire to fix something but a way of grasping the fact that it is broken. You are angry about something that is now in the past, and there is nothing to be done about that. What I did will always diverge from what I ought to have done, no matter what I do next.”
Chienjo retweeted
Hi, I’m a senior engineer. You might know me from my greatest hits “but *why* is it null?” “There is greater honor in deleting code than in writing more” And the chart-topping “let’s just walk over to them and ask”
Chienjo retweeted
Congrats! Now think before you type. With great power comes great responsibility commitstrip.com/ #unix #linux






![Screenshot of the following Elixir code:
data = %{"items" => [%{"id" => 1}, %{"id" => 2}]}
path = ["items", Access.filter(& &1["id"] == 2), "name"]
put_in(data, path, "Item #2")
# =>
# %{"items" => [
# %{"id" => 1},
# %{"id" => 2, "name" => "Item #2"}
# ]}](https://pbs.twimg.com/media/FsYJwz9XwAMs9bs.jpg?name=small&format=webp)





















