TIL How to Select Merge with Ecto.Query
In this post, you’ll learn why and when you might want to use Ecto.Query#select_merge/3 when querying data from unassociated tables: https://medium.com/flatiron-labs/til-how-to-select-merge-with-ecto-query-679d03204b9d
10 Common Code Refactoring Experiences|Elixir
https://medium.com/blackode/elixir-code-refactoring-techniques-33589ac56231
This article comprises of common Elixir coding techniques that you may or may not know.
A Jist of the Article
We usually encounter a situation like we expect a map has certain key and if not we need to send some default value.
Immediately, we will end up using Map.has_key? like in the following way
currency =
if(Map.has_key? price, "currency") do
price["currency"]
else
"USD"
If you see any such lines in your code then it is time to refactor them as
currency = Map.get(price, "currency", "USD")
However, you can also take this to the next level like
currency = price["currency"] || "USD"
How to Use Elixir's Compiler to Avoid Typos
In this article, I want to describe how you can use elixir metaprogramming to avoid some runtime errors caused by typos. If you’re passing around some handcrafted messages ex. %{name: “app_one_hello”, payload: “payload”} you can easily introduce errors. Sending app_one_hello and listening for app_ane_hello will not make your system works correctly. Imagine you have thousands of messages. It’s really hard to manage them like that. To make things better, you can create a list of all messages and generate functions to send and receive them. Now when you will create a typo, elixir’s compiler will tell you!
Full article here: https://puddleofcode.com/story/how-to-use-elixir-s-compiler-to-avoid-typos
“mix release” and missing dependencies
I have stumbled upon a problem where some of my dependencies were missing in the releases and <a href=”https://www.amberbit.com/blog/2019/8/23/mix-release-and-missing-dependencies/“>wrote a blog post about it</a>.
SmartSoftware S2E7 - Todd Resudek on Hex // Elixir Internals
We talked with Todd about Hex, the Erlang ecosystem package manager, including its top five underground features and what’s in the pipeline for upcoming features.
Observing Phoenix on Heroku
Thanks to help from @codefinger, you can now observe Elixir applications running on Heroku using Observer! https://jclem.net/posts/2019-08-21-observing-phoenix-on-heroku/
Oban Recipes Part 4: Reporting Progress
The fourth recipe looks at how to keep applications feeling responsive by reporting progress from long running background jobs.
Prometheus, PostGIS and Phoenix Part 1
Learn how to set up and use Prometheus+Grafana to monitor a PostGIS backed Phoenix application in this 2 part series!
Multiple Room Chat App
In this episode we’ll build a chat application that supports different chat rooms.
Ecto Associations in Phoenix LiveView: One to Many
In this post and video, I go over how to handle one-to-many associations in Ecto while building out a piece of an admin panel with Phoenix LiveView. Followup posts for many-to-many and one-to-one will be coming soon!
https://dennisbeatty.com/2019/08/20/ecto-associations-in-phoenix-liveview-one-to-many.html
ElixirMix Podcast 065 - The Life Cycle of Elixir
In this episode of ElixirMix, we talk together about where Elixir is in it’s Language Lifecycle. We discuss Hype Cycles, where the jobs are, share perspectives on how increased Elixir adoption can happen, and much more! Josh Adams Mark Ericksen Michael Ries
Use Github CI for Elixir Projects
Github launched actions which make it possible to perform CI without leaving the place where the code belongs. This is all great, save for the documentation.
This blog post shows how to configure GH CI for the Elixir project with external services.
http://rocket-science.ru/hacking/2019/08/19/use-github-ci-for-elixir-projects
Panpipe - an Elixir wrapper around Pandoc and its Markdown AST
If you don’t know what Pandoc is, you should definitely read about it: https://pandoc.org
It’s a hugely powerful Markdown tool and you can now use it easily from within Elixir esp. access the Markdown AST and do transformations on it.
Github: https://github.com/marcelotto/panpipe Hex: https://hex.pm/packages/panpipe
Use Return Value to Defer Decisions
By deferring decisions of how to respond to an event, our app can become extremely flexible. This post is about the simplest, yet the most powerful tool for deferring decisions in our app: Return Value.
SmartSoftware S2E6 - Chris Keathley on Wallaby and Raft // Elixir Internals
In our latest episode, we talked with Chris Keathley from Bleacher Report about Wallaby, Raft, concurrent tests, why he doesn’t work on front ends, consensus algorithms, and how he got started contributing to open source projects.
The dangers of the single global process
In this article Keathley discusses some of the dangers of trying to maintain state in a single, unique process. He also presents some solutions to these problems as well as some alternatives.
ElixirTalk Podcast Episode 152 - Hire an Elixir Developer! and Chris' Ecto Adventures
This episode of ElixirTalk your favorite hosts Chris & Desmond are back talking about a new project, Hire an Elixir Developer and we dive into some deep Ecto topics.
Redex, a Redis server implemented in Elixir
Do you need a replicated Redis cluster in Kubernetes, checkout Redex, a cloud-native strong consistent masterless high available Redis implemented in Elixir.
