Announcing Potion Shop - An Open Source Vulnerable Elixir/Phoenix App for Security Education
Potion Shop is a Phoenix application vulnerable to common web security issues, such as RCE, XSS, and CSRF.
Thinking Elixir News 143
Episode 143 of Thinking Elixir. New minor LiveView release, a new Nerves focused Elixir case study was published, a post about audio transcriptions using Bumblebee and another about using Tailscale to cluster Elixir apps across cloud providers. ElixirConf US was announced, nimble_options reaches 1.0 and more!
Generating Data Functions in Your Elixir App
In part two of this three-part series on testing data with Elixir, we’ll look at using data generation functions: https://blog.appsignal.com/2023/03/21/generating-data-functions-in-your-elixir-app.html
IV Vitamin Therapy- McDowall Psychology & Healthcare
Are you looking for the best Naturopath in Toronto?
To get to the root of your health issues, our multidisciplinary team uses a mind-body approach that examines the interaction between all aspects of health.
We utilise cutting edge lab diagnostics, clinical dietary intervention, botanicals, and other modalities, at our Naturopathic clinic in Toronto.
In conjunction, you can expect to make progress with treatments such as CBT and DBT in sessions with our psychotherapists.
Our IV Vitamin Therapy Toronto staff creates custom infusions to address both mental and physical symptoms.
The best naturopath in Toronto found at McDowall Integrative Psychology & Healthcare works alongside the psychotherapy team to make sure all your needs are met and addressed. Our one-of-a-kind integrative method is like nothing you’ve seen before.
Functional Arrays in Elixir and Erlang
A brief walk-through of functional arrays in Elixir and Erlang: https://readreplica.io/functional-arrays-in-elixir-erlang/
"Programming Machine Learning" in Nx and Axon
“Programming Machine Learning” guides you through the creation of an image recognition application from scratch with supervised learning, iteratively and step-by-step.
All the code examples provided with the book are in Python/numpy, but I wanted to give Elixir a spin using Livebook, Nx and Axon, therefore I started to rewrite all the Jupyter notebooks in Elixir.
All the livebooks can be found in this Github repository https://github.com/nickgnd/programming-machine-learning-livebooks
Phoenix Dev Blog - Sounds Like a Bug
In Chris McCord‘s 2nd Phoenix Dev Blog post, he delves into diagnosing and fixing an 8-year old LiveView race condition when long-polling. Even if the bug didn’t affect you personally, his deep dive illuminates how things work as he walks us through the diagnosis and multiple levels of the problem and the final changes. A great guided-tour with insights shared along the way!
https://fly.io/phoenix-files/phoenix-dev-blog-sounds-like-a-bug
New library - `map_with_indifferent_access`
Have you ever found it difficult to work with maps that sometimes have string keys (if it’s controller params coming from outside) and sometimes atom keys (if it’s params defined inside of the code)?
If so, consider using our newly published map_with_indifferent_access library, which gives you functions such as MapWithIndifferentAccess.get/3
, MapWithIndifferentAccess.put/3
, that mimic the Map.*
functions.
The advantage of using them is that you don’t have to worry if the map currently uses string or atom keys. You, as the caller, only use atom keys. The underlying code will automatically deduce if the map uses string or atom keys, and depending on it, convert the key to string or leave it as atom, before handing it further to the original Map.*
function.
This will prevent you from reaching a Ecto.CastError
saying it received a map with mixed key types.
(Inspired by Ruby on Rails’ HashWithIndifferentAccess.)
The benefits of using Elixir for backend development: Our perspective
At Welcome to the Jungle, we have been using Elixir in production for five years now, and in this article we are going to share our feedback on how things have worked out. https://medium.com/wttj-tech/the-benefits-of-using-elixir-for-backend-development-our-perspective-9d421fde426a
Long-lived Processes in Elixir
Something that never ceases to amaze me about Elixir is that tail call optimization is the trick to having long-lived processes.
In other languages, we’d get a stack overflow.
In Elixir, we get a process that can hold state and send/receive messages.🤩
👉 short video exploring that https://youtu.be/bezaBt5pi7E 👀
Using :dets for Persistent Caching and Avoiding Data Loss
:dets allows us to persist items on disk quickly and natively in Elixir, however there is a small chance we can loose data when using this method. In this article we discuss how to create a persistant cache module in Elixir with :dets, why we can lose data and what we can do about it
https://learn-elixir.dev/blogs/avoiding-data-loss-with-elixir-dets
ThinkingElixir 142: Orion for Distributed Tracing in Production
Episode 142 of Thinking Elixir. Orion is an interesting library created by Thomas Depierre that makes it easy to run dynamic distributed tracing in your app on production! It includes a LiveView UI for visualizing the performance and running multiple traces simultaneously. We talk with Thomas to learn more about the history, the inspirations, how it works, why it’s safe to run in production, how to get performance insights, and more!
Deleting LiveView Stream Elements by `dom_id`
We can delete LiveView stream elements with stream_delete/3
(already awesome!)
But we need the full record in memory. 😔
What if we only have the dom ID? 🤔
LiveView ships with a stream_delete_by_dom_id/3
function that lets us use the dom_id
! 🥳
👀 short video exploring that! https://youtu.be/tg377m24Jls
ExRoseTree - A Rose Tree and Zipper in Elixir with a slew of navigation primitives.
Posted an announcement on elixir forum about a new lib I’ve released: ExRoseTree - a Rose Tree and Zipper in Elixir with a slew of navigation primitives.
Hopefully it can prove useful to some of you, and if nothing else it may be enjoyable to dig through if you just enjoy data structures. While I’ve deemed it good enough for its first release, there is certainly room for improvement and new features, so don’t hesitate to post issues in the issue tracker, propose feature requests, or contribute to further development.
Thanks, and happy zipping!
Using npm to manage JS dependencies in Phoenix
Blogged on how to use npm to manage all JS dependencies in Phoenix - https://latinum.xyz/posts/phoenix-1.7-with-npm/
Elixir/Phoenix Security Live Coding: Deserialization and Preventing Remote Code Execution
Tuesday, March 21, 4pm EST join the founder of Paraxial.io, Michael Lubas, for a live webinar on secure coding in Elixir.
Finitomata ❤ Mox
Blogged on how to use Mox
to test highly concurrent applications (on the Finitomata
example.)
https://rocket-science.ru/hacking/2023/03/06/finitomata-mox-testing
Synchronization points. The proper way to test FSM in details: how to control data flow (opinionated approach.)
Using macros for consistent authorization
We recently needed to add authorization to a lot of our context modules. We’ve written a blog post about how we achieved this using macros:
https://nobilisdata.com/blog/using_macros_for_authorization/
Animating LiveView Deletions with JS.hide/2 & JS.push/2
Someone asked me how to animate deleting elements in LiveView. The trick is to use LiveView.JS:
-
JS.hide/2
withanimate
option to hide and animate, and -
JS.push/2
to send the event to the server - ✨ beautiful deletions ✨