Coney 2.2.0 released, healthcheck support added.
Coney is a convenience library for working with RabbitMQ effectively. It supports consuming and publishing messages, working with RabbitMQ cluster and holding several connections. Now it supports to be integrated into your service’s healthcheck system!
Check it on Github
Building a JSON API in Elixir with Phoenix 1.4+
Do you have a Rails background?
Are you tired of looking at outdated or incomplete tutorials on how to build a JSON API using Elixir and Phoenix?
This won’t just be about how to generate a new Phoenix API only app. That’s easy enough, you just need to pass the –no-webpack –no-html to mix phx.new.
This tutorial is about creating a small, but fully operational JSON API for web applications.
https://lobotuerto.com/blog/building-a-json-api-in-elixir-with-phoenix/
ZXCVBN Port For Elixir
Just released zxcvbn v0.1.2, Elixir implementation of dropbox’s zxcvbn for password estimation in Elixir apps https://github.com/techgaun/zxcvbn-elixir
Function/Method look up in Elixir/Ruby
This was a fun one to write because at one point I thought Elixir had inheritance(!!). I thought GenServer function injections were done through inheritance!
Spoiler: it’s not, it’s done through through defoverridable
https://dev.to/edisonywh/functionmethod-look-up-in-elixirruby-622
End-to-end tests with Phoenix and Cypress in real life
Test your whole frontend and backend using phoenix, cypress and some minor manual tweaks to make it all work! https://medium.com/@svengehring/phoenix-end-to-end-testing-in-real-life-efdba3a85be1
Exvalibur → Module-based validators
Starting with v0.8.0
Exvalibur
accepts module-based validatiors:
defmodule Validator do
use Exvalibur, rules: [
%{
matches: %{currency_pair: <<"EUR", _ :: binary>>},
conditions: %{foo: %{min: 0, max: 100}},
guards: %{num: num > 0 and num < 100}}]
end
Validator.valid?(%{currency_pair: "EURUSD", foo: 50, num: 50})
#⇒ {:ok, %{currency_pair: "EURUSD", foo: 50, num: 50}}
Validator.valid?(%{currency_pair: "USDEUR", foo: 50, num: 50})
#⇒ :error
The Primitives of Elixir Concurrency: a Full Example
The Primitives of Elixir Concurrency: a Full Example
Let’s finally put in practice what we’ve seen about concurrency primitives in Elixir!
In this article we see how to use spawn
, send
and receive
to make multiple concurrent HTTP requests, merging the results in a single one. Then we see how to refactor our code with Task
, which makes everything easier.
The most passionate will find a small challenge at the end.
Walk Through of Phoenix Live View
With LiveView’s preview out, Elixir Schools got a walk-through on the what, why, and how of building real-time features without writing JavaScript.
Integrating Phoenix LiveView
For the SmartLogic TV stream this week, I worked on integrating LiveView into an existing application replacing a previously static admin dashboard.
How to Create a Counter with Phoenix LiveView
Last Friday, Phoenix LiveView was publicly released, allowing you to create cool applications that live update the frontend code without you writing any Javascript. This video and post cover how to set up an Elixir application for Phoenix LiveView and then how to create a counter that you can increment and decrement with all the state managed in the backend.
https://dennisbeatty.com/2019/03/19/how-to-create-a-counter-with-phoenix-live-view.html
Accessing Neo4j from Elixir with Bolt and Cypher
I just published a post today ‘Property graphs and Elixir: Accessing Neo4j from Elixir with Bolt and Cypher’.
The post shows how to access Neo4j graph databases from Elixir using the ‘bolt_sips’ package and how to query graphs using the Cypher query language.
It then shows how to create a simple graph (modified from an RDF graph) and how to import graphs and to parse out graphs from GraphGists.
And just as we can query Neo4j property graphs with Cypher, in previous posts I also showed how Elixir can be used to query RDF graphs with SPARQL. It is therefore rather intriguing to consider what role Elixir could play in moving data between these two graph worlds.
Analysis of JSON parser for Elixir
https://medium.com/@kanishkablack/analysis-of-json-parser-for-elixir-d1aed8332ce7
Well, Elixir is been moved into production in serious environments. One of the major deployment, I came across is JSON API or JSON related endpoints on Elixir application.
We have observed that, Poison used to be and still being used as JSON parser in many major modules. Now, Jason is default in phoenix application, for its performance upgrades.
This is good for small scale application, but when the application has to process 5MB/sec and when application have to process about 4–5TB/data a day. Even Jason falls short.
ElixirMix Podcast 043 - Using GenServers and Tasks Together to Create Fault-Tolerant Apps with Jack Marchant
In this episode of ElixirMix, the panel talks with Jack Marchant about his perspectives on GenServers, Tasks, and Supervisors with a unique comparison to React. We talk about coming to Elixir from PHP, finding programmers, Nerves and more!
AWS IoT Core, Elixir, and Nerves: A Crash Course
https://www.verypossible.com/blog/aws-iot-core-elixir-and-nerves-a-crash-course
Build on a solid foundation of Nerves, quickly write robust firmware in Elixir, and rocket through the clouds with AWS. Along the way this post will expose you to some of the biggest pieces of the IoT puzzle.
Event Sourcing With Elixir - Part 3
In Part 3 of this series on Event Sourcing we’ll build our first feature!
Solving the "Cannot return null for non-nullable field" error in an Absinthe GraphQL API
Solving the “Cannot return null for non-nullable field” error in an Absinthe GraphQL API when using Kronky and Elixir: https://link.medium.com/z1bmdO5Y6U
Iteraptor.Array
Iteraptor
package update.
Iteraptor.Array
is a naïve implementation of Array
, the idea borrowed from MapSet
. It wraps a list into a structure with an internal map %{index => value}
. where index ∈ [0, length)
.
It implements Access
behaviour. It could be useful if the structure requires deep access and an intermediate term is a list: simply wrap it with Array
and voilà.
THINGS YOU COULD DO WITH MIX - PART 1
https://www.theguild.nl/things-you-could-do-with-mix/
Mix, is something that everybody that uses Elixir has definitely used. But you might have not discovered the power (and fun!) this little tool can bring to your workflow.
Most tutorials will show you to create the task itself as that is very straightforward, but let’s not do that. Let’s write a test first!