ex_check now runs npm test & empowers umbrellas

ex_check was under active development in last few weeks and it now comes with a bunch of new handy features:

  1. mix check now detects & runs npm test in Phoenix projects that have assets directory with package.json in it. It’s really consistent with existing Phoenix setup as now mix check will test both your back-end & front-end code just as mix phx.server compiles & watches the two for you. More info in feature request.

  2. mix check now empowers umbrella projects, in particular the experience of running tools recursively from the umbrella root, with a handful of extra benefits over the basic Mix task recursion (parallel execution, clearer presentation & more). More info in docs.

…and a bunch more additions & fixes - all listed in Changelog.


Brief reminder: ex_check provides a mix check task that allows to efficiently run all code analysis & testing tools in an Elixir project with a single command. With no configuration it catches compilation warnings, runs ExUnit, Credo & more. It’s a real convenience for all Elixir & Phoenix projects to ensure that new code is “good to go” & then to recheck it on CI in the exact same way.

Elixir Performance – Using IO Data Lists

Latest post from Eric on the SmartLogic blog:

After watching Johanna Larsson’s ElixirConf 2019 talk, High Performance String Processing Scripts in Elixir, I was inspired to work on some of my side projects to make them use IO lists instead of plain strings.

https://blog.smartlogic.io/elixir-performance-using-io-data-lists/

Tarearbol.Scheduler → Cron on Processes

Tarearbol v0.13.1 includes lightweight cron scheduler fully based on spawn processes. Allows conditional job termination, rescheduling, keeps track of last execution outcome.

Zero boilerplate is required.

Comes with cron record parser, returning all the upcoming events as Stream, Tarearbol.Calendar.{beginning_of,end_of}/2 working properly with any calendar (not only Calendar.ISO.)

ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.

Getting Started with Phoenix and Kubernetes

A complete guide to deploying a Phoenix application to a new and empty Kubernetes cluster.

We’ll cover all the moving pieces, including:

  • creating the cluster
  • running a private docker registry
  • databases and migrations
  • the changes needed to deploy the application, and
  • exposing the application to the world with automatic certificate management.

https://quan.io/blog/deploying-phoenix-to-kubernetes-from-scratch/

How to Create Desktop Application with Elixir?

Can we create desktop application with elixir? Let’s figure it out.

https://puddleofcode.com/story/how-to-create-desktop-application-with-elixir

Rambo 0.2.0 released. Run your command. Send EOF. Get output.

Stream your command’s output while it runs with the :log option. Stop your command with kill/1. Remove unused binaries with :purge setting.

https://github.com/jayjun/rambo

Formulæ and Lazy Combinators

Using macros and bare AST to implement lazy combinations and permutations.

l = for c <- ?a..?z, do: <<c>> # letters list
with {stream, :ok} <- Formulae.Combinators.Stream.permutations(l, 12),
  do: stream |> Stream.take_every(26) |> Enum.take(2)

#⇒ [["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"],
#   ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "l", "w"]]

http://rocket-science.ru/hacking/2019/09/06/formulae-and-lazy-combinators

Smart Software: Shanti Chellaram on Pri-Queue and raft_erl

New episode! Shanti Chellaram on Pri-Queue and raft_erl; learn about priority queues, bootstrapped skew binomial heaps, and Shanti’s advice for someone just starting out in Elixir.

https://podcast.smartlogic.io/season-two-chellaram

Don't tell me how to test my software

There are lot of opinions about software testing. Unit vs integration testing is one of them. I’ve written a post that explains how to avoid making decisions based on conflicting opinions and use facts and logic instead.

https://medium.com/@mkaszubowski/dont-tell-me-how-to-test-my-software-4b87038ed321

ElixirWeekly: The Elixir Community Newsletter, covering community news you easily miss, shared on ElixirStatus and the web, in one email every Thursday.

3 Key Ideas Behind The Erlang Thesis

Elixir is built upon Erlang. To understand many concepts for Elixir, I need to learn more about Erlang. Without any doubt, the paper written by its creator, making reliable distributed system in the presence of software errors, is the best way to learn why Erlang was designed in this way.

This post is my summary of this paper, which are 3 key points that make Erlang such a great language.

  1. Concurrency Oriented Programming
  2. Abstracting Concurrency Out
  3. The philosophy of falling back to an easier task when an error occurs

https://yiming.dev/clipping/2019/09/04/3-key-ideas-behind-the-erlang-thesis/

SmartLogic's ElixirConf19 Highlights

Half our team headed to ElixirConf last week; here are a collection of our highlights from favorite talks to hallway conf moments and more.

https://blog.smartlogic.io/smartlogic-at-elixirconf19/

Interceptor v0.5.0 released! Intercept your functions by using an @intercept annotation

This release introduces the Interceptor.Annotated module, that you can use with @intercept true annotations to intercept your function modules.

If you don’t like to wrap your function definitions with a Interceptor.intercept/1 do block, maybe @intercept true will suit you best.

Personal notes from Elixir Conf 2019

Last week I attended Elixir Conf 2019 and these are my personal notes: https://pedroassumpcao.ghost.io/personal-notes-from-elixir-conf-2019/ #myelixirstatus

TIL: Understanding a specific dialyzer warning

Today I spend a good three hours trying to understand why dialyzer was yelling at me. I think I understood it at last, and I blogged about it:

https://medium.com/@lasseebert/til-understanding-dialyzers-the-pattern-can-never-match-the-type-e948385837d

ElixirMix Podcast 067 - What's New with Nerves with Frank Hunleth

In this episode of ElixirMix, we talk with Frank Hunleth to get an update on the Nerves Project. We discuss announcements, Elixir Circuits, Justin Schneck’s ElixirConf Keynote, the work to make NIFs available and safe, and much more!

Podcast Episode

Elixir Telemetry: Metrics and Reporters

Capturing individual measurements from your projects isn’t enough. For measurements to be valuable, they must be collated into metrics. Elixir’s Telemetry.Metrics library enables us to aggregate measurements from functions and processes into valuable metrics to aid us in making decisions about our projects.

Elixir Telemetry: Metrics and Reporters

Solution v1.0.0 released! - A macro-based solution to working with ok/error tuples in `case` and `with` statements and in collections.

Solution is a library to help you with working with ok/error-tuples in case and with-expressions by exposing special matching macros, as well as some extra helper functions to work with them in collections.

An example:

 x = {:ok, 10}
 y = {:ok, 42, "Oh, here's another argument!"}
 z = {:ok, "something we do not care about"}
 swith ok(res) <- x,
       ok(res2) <- y,
       ok() <- z do
      "We have: \#{res} \#{res2}"
    else
      other -> "Failure at #{inspect(other)}"
  end
# => "We have: 10 33"

Note how it did not matter that y contains more than one value in the tuple, or that z does not return a plain :ok. But if they would have, the outcome of the code would have been exactly the same.

Solution handles these cases for you exactly to allow you to have less of a tight coupling between the places where an ok/error tuple is returned and where it is used:

  • If at some point a caller decides to change from :ok to {:ok, some_value}, then that will not break your code.
  • If at some point a caller decides to change from {:ok, some_value} to {:ok, some_value, some_metadata}, then that will not break your code.

Besides allowing tricks like above, Solution also contains a small module containing some helper functions to combine collections of ok/error tuples in common ways.

Find it at: HexPM, GitHub, ElixirForum.

Rambo. Run your command. Send EOF. Get output.

Ever stumped trying to get output from a port?

Rambo has one mission. Start your program, pipe standard input, send EOF and return with output.

Rambo.run("ls") |> Rambo.run("sort") |> Rambo.run("head")

https://github.com/jayjun/rambo

Pachyderm - Virtual actor framework for durable, globally unique processes

Pachyderm is built to allow developers to work with “effectively” unique processes

https://github.com/CrowdHailer/pachyderm

Testing your Phoenix + Postgres app with GitHub CI

GitHub recently released their own CI. solution recently. Its documentation is kind of overwhelming, so I wrote a step-by-step guide for testing a phoenix + postgres app in GitHub CI.

https://nickvernij.nl/blog/github-ci-elixir.html