ElixirMix Podcast 070: Home Automation Using Radio Frequencies with Jon Carstens
In this episode of ElixirMix, we talk with Jon Carstens about using Nerves Project, radio controllers and ingenuity for hacking the home. We also cover NervesHub’s new IEx shell, how it was built, what SmartRent.com does and much more!
Creating a Rate Limiter – Live Stream Archive
Eric’s Elixir live stream is back! Here’s the archive from yesterday’s session, where he added a rate limiter to the message sending part of Grapevine.
Sharing Phoenix templates across controllers & views
I published a new tutorial: https://alchemist.camp/articles/shared-phoenix-templates
Whenever you use Phoenix’s generators to create a full HTML scaffold, you’ll see that in the template directory, there’s a form.html.eex “partial” or sub-template that’s used inside of both the new.html.eex and the edit.html.eex.
The entire form is embedded inside those new and action templates with just this single line:
<%= render “form.html”, Map.put(assigns, :action, Routes.article_path(@conn, :create)) %>
You can use the same pattern to embed any eex template into another in the same directory. But some templates are things you’d want to render from any template. An email list sign-up form, for example, might appear within a blog post, an about page and many other parts of the site.
This tutorial goes through how to make a clean setup for these “shared templates” so it’s just as easy to create and use them as any other template.
IntelliJ Elixir v11.1.0
Enhancements
-
Update gradle plugins
-
gradle-intellij-plugin
(org.jetbrains.intellij
) to0.4.10
-
org.jetbrains.kotlin.jvm
to1.3.50
-
de.undercrouch.download
to4.0.0
-
-
Update IDEA version in builds
-
2019.2
->2019.2.2
-
Bug Fixes
-
Don’t log if partial or no header typeID is read. It happens too often due to
.beam
files being written partially to disk during the build process. They will be re-indexed when they are complete. -
Update gradle intellij plugin to fix
runIde
on newer macOS. -
Fix
ConcurrentModificationException
in Structure ViewJava 9 fixed a bug (https://bugs.openjdk.java.net/browse/JDK-8071667) in
HashMap
wherecomputeIfAbsent
did not check for concurrent modifications, and it turns out thatTreeElementList
was using concurrent modifications, so it was now broke. Fixed by useget
orput
if it is absent, so thatputNew
can ensure that theCallDefinition
is in theTreeElementList
before it is added to theMutableList<TreeElement>
, which was the original reason why there was aput
inside ofcomputeIfAbsent
, which would haveput
when the function returned anyway.
On the Utility of Phoenix LiveView
Brief post documenting why I think LiveView is such a big deal: https://jclem.net/posts/on-the-utility-of-phoenix-liveview
Web UI for SMS Messaging using Phoenix channels.
Web UI for SMS Messaging using Phoenix channels.
Ecron- A lightweight/efficient cron-like job scheduling library.
Ecron is very simple and small, but it’s designed to be so, keeping lightweight and fully customizable.
- Both cron-like scheduling and interval-based scheduling.
-
Well tested by
PropTest
100% coverage. -
Use
receive after
at any given time (rather than reevaluating upcoming jobs every second/minute). - Minimal overhead. ecron aims to keep its code base small.
Cowboy architecture and execution flow
A little in-depth blog post about cowboy and ranch OTP architecture. I tried to explain how cowboy handles requests and sends the responses.
Application Layering - A Pattern for Extensible Elixir Application Design
An in-depth walkthrough of Application Layering, a design technique for building maintainable, adaptable and flexible large-scale Elixir codebases.
Up And Running With Faktory In Elixir
This post covers how to get an Elixir application set up with Faktory to allow us to process jobs in the background of our applications and take full advantages of the many features Faktory has on offer.
Oban Recipes Part 5: Batch Jobs
In the fifth Oban recipe we consider monitoring jobs as a group with the power of pattern matching and queue introspection.
LazyFor → Kernel.SpecialForms.for/1 but returning stream
The stream-based implementation of Kernel.SpecialForms.for/1
.
Allows the same syntax as for
and acts the same way. This is an initial release. It does not yet support :into
, :uniq
and :reduce
options and bitstring comprehensions.
Everything else is supported.
Gearbox - A functional state machine with an easy-to-use API, inspired by both Fsm and Machinery
Gearbox focuses on doing one thing and doing one thing right – state transitions. No surprise callbacks, no process management overhead, just pure functional state transitions.
Read more about the description/rationale behind the project over at GitHub!
ElixirMix Podcast 069 - Distributed Databases with Wiebe-Marten ("Marten") Wijnja
In this episode of ElixirMix, we talk with Wiebe-Marten about designing for distributed systems. We discuss the common fallacies, the Byzantine General’s problem, CRDTs, GenServer.multi_call and databases like Mnesia, Cassandra, CouchDB, Riak and much more!
Password breach lookup and other password validation rules
Together with @danschultzer I wrote a guide on doing password validation rules in Pow based on the NIST SP800-63b recommendations. https://powauth.com/guides/2019-09-14-password-breach-lookup-and-other-password-validation-rules.html
Prometheus, PostGIS and Phoenix Part 2
In the final part of this series, we wrap up our Prometheus monitoring stack, write a stress tester with Erlang’s httpc, and make our Grafana dashboards dance! https://akoutmos.com/post/prometheus-postgis-and-phoenix-two/
New version 0.3.0 of Incident
I just released a new version of my library that helps you with Event Sourcing and CQRS applications. Now you can use Postgres to store events and projections with new adapters. https://hex.pm/packages/incident #myelixirstatus
Running a Gatsby blog inside a Phoenix app
I wrote a simple guide on running a Gasby blog inside a Phoenix app. The basic approach I used was:
- Create a new Phoenix app
- Create a new Gatsby project from their hello-world starter inside the assets directory of the Phoenix project
-
Set up a symbolic link
assets/static
directory to Gastby’spublic
directory -
Update
endpoint.ex
and add that new linked directory to the whitelist forPlug.Static