SeedFactory - a toolkit for test data generation
The main idea of SeedFactory is to generate data in tests according to your application business logic (read as context functions if you use Phoenix Contexts) whenever it is possible and avoid direct inserts to the database (as opposed to ex_machina). This approach allows you to minimize testing of invalid states, as you’re not forced to keep complex database structure in your head in order to prepare test data.
Optimum Elixir CI with GitHub Actions
Learn how we approach continuous integration at Optimum:
Optimum Elixir CI with GitHub Actions
Elixir Streams |> ♻️ Refactoring complex `else` clauses in `with` (an anti-pattern)
Love Elixir’s with
clause… but it can lead to confusing else
statements 😕
In Elixir’s docs, it’s called the “Complex else clauses in with” anti-pattern! ❌
Thankfully, it’s easy to improve that with some refactoring! 🥳 👇
🎥 Elixir Streams |> ♻️ Refactoring complex else
clauses in with
(an anti-pattern)
Thinking Elixir 195: Migrating from Next.js to Phoenix
Episode 195 of Thinking Elixir. In this compelling episode, we sit down with Ben Reinhart who shares his journey of transitioning from the JavaScript ecosystem, specifically migrating off of Next.js and Vercel, to Elixir and Phoenix, with Fly.io as the new host. Ben discusses his frustrations with the complexity and performance issues he faced, and how the switch to Elixir helped streamline operations and improve the efficiency of his AI-focused product at Axflow. He delves into his strategic choice for leveraging the operational simplicity and real-time features of Phoenix, while also acknowledging trade-offs such as rebuilding front-end components. Join us to explore Ben’s story, learn about the features of Elixir that helped him, and discover how the move has influenced Axflow’s path towards finding product-market fit, and more!
Survey on Refactoring for Elixir
Please answer this survey! https://www.youtube.com/watch?v=axpc7zbEOvE
What is Elixir GenServer
Check our new blog post: https://curiosum.com/blog/what-is-elixir-genserver
Want to run a simple LiveView with as less keystrokes possible?
https://hexdocs.pm/liveview_playground/0.1.1/readme.html
I wanted to give beginners an alternate path on getting started with LiveView that didn’t need a lot of setup.
- Copy and paste file.exs
- $ elixir file.exs
Done!
Content Security Policy header with Phoenix LiveView
How to set up Content Security Policy header with Phoenix LiveView and support inline styles and scripts with CSP nonces.
https://danschultzer.com/posts/content-security-policy-with-liveview
Fabulous Speaker Line Up at GigCityElixir 2024!
NervesConf and GigCityElixir - May 9-11th! Tickets: GigCityElixir.com Nestled in a valley along the Tennessee River, Chattanooga is known as Gig City for pioneering gigabit internet speed. Our community tells us that Gig City Elixir feels like home, and there’s a reason for that. We mix great speakers and excellent hospitality in a setting built to foster relationships and community.
🔔 NervesConf and GCE Training day both take place on May 9th. Training: Ash Framework (Zach Daniel and Josh Price) Training: Effective Teaching and Training Practices for Software Developers (Andrew Ek and Ruth Kohtz Ek.) NervesConf: Full day of your favorite Elixir IoT people and talks!
So whether you’re looking to deepen your knowledge of Elixir, meet like minded individuals, or simply be inspired by the vibrant tech scene, Gig City is the place to be.
Join us in Chattanooga and be a part of two conferences where programming meets community, innovation, and fun!
Tickets and details: www.gigcityelixir.com May 9-11, 2024 https://youtu.be/r8WFnnxfgYk
Easy empty states for Phoenix LiveView streams using Tailwind
When rendering a collection in LiveView using streams, we commonly want to display a special empty state when the collection is empty. It’s tricky to do this with Elixir constructs like if/else, but fortunately there’s a neat trick we can use to get the desired behavior using Tailwind CSS.
https://phoenixonrails.com/blog/easy-empty-states-for-phoenix-liveview-streams-using-tailwind
Clustering Elixir From Laptop to Cloud
Cluster the Elixir app running on your laptop to an Elixir app running on Fly.io! Can be the same or different app. Step-by-step guide created and a script to help automate the process. Works great for:
- offloading AI/ML tasks to a machine with a GPU and develop our applications locally as normal
- develop and debug truly globally distributed applications right from your laptop
- And, it’s freaking cool!
https://fly.io/phoenix-files/clustering-elixir-from-laptop-to-cloud/
ElixirConf EU 2024 coming up!
Another ElixirConf EU is getting closer. If you haven’t already, check the schedule and book your ticket: https://elixirconf.eu/#schedule
Check out the training offer:: https://elixirconf.eu/#training This is your reminder about additional opportunity to upskill: training sessions with experts, just before the conference.
You can choose from 4 in-person trainings: Practical testing with Elixir (and Phoenix) with Saša Jurić
Ash Framework: The Fast Track to Full Stack with Zach Daniel & Josh Price
Mastering Phoenix LiveView: Essential Insights with Łukasz Pauszek
Elixir Application Security with Michael Lubas
Bun 1.2.0 released
This new version of the Bun installer uses Bun as a process wrapper that kills the process when the stdin closes. We now use Bun to wrap Bun itself, which allows us to remove the POSIX shell dependency on development.
You are welcome to take a look at the GitHub repo and the Hex.pm package for detailed release notes and more information.
Operational Elixir: Knowing When to Grow Up
Episode 194 of Thinking Elixir. In the final installment of our series, we sit down with the creator of the Ash framework, Zach Daniel, to move beyond his expertise in Ash and explore his experiences with the other systems we use to support our Elixir applications. Zach shares his journey from the dynamic environment of startups to the structured world of midsize companies, giving us a glimpse into the strategic timing for scaling monitoring and data collection tools. He emphasizes the value of fostering a blame-free culture and sheds light on his hands-on encounters with deployments, Kubernetes, and more!
Elixir Streams |> ⚡️ Stream Server Logs to Console!
If you recently upgraded to phoenix_live_reload
1.5 without looking at the changelog you may have missed an awesome update.
With a small change to two files, we can stream our server logs directly to our browser’s console!
Direct File Uploads to Amazon S3 with Phoenix LiveView
Let’s explore how you can upload from Phoenix LiveView directly to Amazon S3: https://blog.appsignal.com/2024/03/19/direct-file-uploads-to-amazon-s3-with-phoenix-liveview.html
Fundamentals of Object Storage in Elixir
After my previous livestream I went ahead and made a text version of what we covered. If you want to learn about S3-compatible Object Storage and cool things you can do to it with Elixir, read on. Basics as well as presigning, chunked uploads and range requests. https://underjord.io/fundamentals-of-object-storage.html
Exploring Erlang, Elixir and Beyond: A Conversation with Professor Laura Castro
In this episode of the Professor Adolfo Neto podcast, join me, Adolfo, as we sit down with Laura Castro.
Laura is a distinguished professor at Universidade da Coruña (UDC), Spain, and the chair of Cátedra CICAS, a collaborative project aimed at advancing Open Science through Software. She is involved in the BEAM (Erlang and Elixir) community and is a member of the Erlang Ecosystem Foundation.
During our conversation, Laura shares her journey into Erlang and Elixir, her role at the University of A Coruña, and her involvement in the BEAM community and the Erlang Ecosystem Foundation. We also delve into the topic of gender diversity in computing and Laura’s thoughts on knowledge sharing within the field. A big thank you to Laura for sharing her expertise with us.
YouTube: https://www.youtube.com/watch?v=m1RgrdTF5B8
Audio platforms: https://podcasters.spotify.com/pod/show/adolfont/episodes/Exploring-Erlang–Elixir-and-Beyond-A-Conversation-with-Professor-Laura-Castro-e2h8btk
Adding OpenTelemetry and custom traces
I’m using OpenTelemetry to get custom data about FIT file decoding in a LiveView app. Includes a custom sampler to drop some redundant traces.
https://arathunku.com/b/2024/notes-on-adding-opentelemetry-to-an-elixir-app/