First month of functional programming in Elixir

Thoughts from one month of functional programming in Elixir

Elixir has an impressive feature set and a fast-growing community. Coming from an object-oriented background using mostly Java and Javascript, Elixir syntax and structure is both familiar and not.

Processing Large CSV files with Elixir Streams

Processing Large CSV files with Elixir Streams

Elixir Streams are a powerful and elegant way to process large CSV files. In this article I compare the greedy and the lazy approach with memory and cpu benchmarking.

No Touching released

no_touching provides a way to check if your code is calling private functions from other libraries/dependencies! Highly configurable, extremely fast, and a really nice check to add to CI.

https://hex.pm/packages/no_touching

Shameless plug: Check out @elixirstatus' other community project:

Credo, a new static code analysis tool that acts as a code linter, but also focusses on teaching coding practices and code consistency.

How to perform Hot Code Swapping using Distillery— #2 — A (Live Demo) GenServer State update.

https://medium.com/@blackode/how-to-perform-hot-code-swapping-using-distillery-2-a-live-demo-genserver-state-update-53d8344d9147

This article will guide you to perform hot code swapping in Elixir using the Elixir package distillery-2.0 (at the moment of writing this article).

A live demo on updating GenServer state will stand out as a good example.

WaspVM 0.8.0 released

Complete instruction set support, 67% increase in efficiency over previous version, and more. View the release notes here

Phoenix Contexts

In the latest ElixirCast episode we’ll look at Phoenix contexts. This is a great episode for anyone new to Phoenix or wanting to see how contexts work.

https://elixircasts.io/phoenix-contexts

Phoenix 1.4 Chat Server: Part 4

Phoenix 1.4 Chat Server, Part 4.

This episode covers building an Auth Plug. It will let us restrict any action in any controller to only logged-in users or to only admins. We also set up a special function plug for the user controller for restricting actions to the correct user. E.g. users can edit their own accounts but not each others.

Message passing for actors and humans

Slides and Video for my CodeMesh talk this year.

http://crowdhailer.me/2018-11-08/message-passing-for-actors-and-humans/

Inject from your controller to decouple your contexts in Phoenix.

In this post I will show you a simple pattern to decouple your Phoenix context so that you can specify from your controller how you want to preload your Ecto.Query.

https://polymorphic.productions/posts/inject-from-your-controller-to-decouple-your-contexts-in-phoenix

Shameless plug: Check out @elixirstatus' other community project:

Credo, a new static code analysis tool that acts as a code linter, but also focusses on teaching coding practices and code consistency.

Hex Bob Package Status Page

I’ve created a small page listing all available precompiled packages of hex bob. Added availability checks given the recent issues with updates.

https://bobs-list.kobrakai.de/

Ecto and Binary IDs

Using UUIDs as primary keys is simple with migration_primary_key and a simple change to the schema:

https://www.annkissam.com/elixir/alembic/posts/2019/01/04/ecto-and-binary-ids.html

How We Used Elixir's GenServers + Dynamic Supervisors to Build Concurrent, Fault Tolerant Workflows

At The Flatiron School, we leveraged Elixir’s GenServers and Dynamic Supervisors to “deploy” large amounts of content to our students faster and less error-prone than ever before. https://www.thegreatcodeadventure.com/how-we-used-elixirs-genservers-dynamic-supervisors-to-build-concurrent-fault-tolerant-workflows/

hackney version 1.15.0 has been released

just released hackney version 1.15.0 an HTTP client library. This release add a performance improvement to the pool and an addition to multipart forms handling.

site: https://github.com/benoitc/hackney news: https://github.com/benoitc/hackney/blob/master/NEWS.md#1150---2019-01-04

Gitlab-ing Phoenix — (Elixir and others) Aka GitOps

https://medium.com/blackode/gitlab-ing-phoenix-elixir-and-others-aka-gitops-50e291ce5d85

This article is all about Automating Phoenix Development & Deployment using Gitlab CI/CD.

TMIB-24: Last December, priority bumping and CircleCI integration were improved

https://bors.tech/newsletter/2019/01/01/tmib-24/

How to pattern match a function in Elixir

I found how to pattern match a function on Improve error messages for invalid expression in match · Issue #5649 · elixir-lang/elixir.

x = &List.first/1
case &List.first/1 do
  ^x -> true
end

I also wrote a summary for it: How to pattern match a function in Elixir - dsdshome

Feel free to check it out and leave some comments.

A deeper dive in Elixir's Plug

Being new to Elixir and Phoenix, I spend quite some time in the projects’ documentation. One thing that stood out for me recently is the first sentence of Phoenix’s Plug documentation: “Plug lives at the heart of Phoenix’s HTTP layer and Phoenix puts Plug front and center.”

So naturally, I felt compelled to take a deeper dive into Plug and understand it better. I hope the article helps you out as well, you can read it here.

Correios CEP 0.3.0 released! Zip code validation.

Correios CEP allows to find Brazilian addresses by zip code, directly from Correios database. No HTML parsers.

Changelog for version 0.3.0:

  • Validate zip code.
  • Typespecs and Dialyzer.

Check it out at:

Cloak v1.0.0-alpha.0 released!

Cloak is an encryption library which helps you encrypt your Ecto schema data, and it’s now nearly at 1.0.0!

http://blog.danielberkompas.com/2018/12/31/cloak-1.0.0-alpha-released/

Introducing Whistle, a different approach to building interactive web apps in Elixir

Whistle is an implementation of an Elm(ish) architecture in the server, letting you write interactive web apps entirely in Elixir.

https://moboudra.com/whistle-interactive-web-apps-with-elixir/