Use asdf to Manage Multiple Versions of Languages

I normally use Arch’s package management to install new languages and environments. The package manager is mostly up-to-date and easy to use. If you run a system-wide update, it also installs new versions of a package. The Problem Some repositories on my machine use older versions of Node or Elixir. When I run those applications, I might get errors. Sometimes Arch packages don’t use the latest version. For example, the Elixir installation uses version 1.
Read more →

Friday Picks 025

Read more →

Awesome Elixir Newsletter Mention

Read more →

Phoenix 1.4 with Bootstrap, jQuery, Bootstrap Notify, SASS, and Webpack

I’m currently working through Mastering Phoenix Framework by Shankar Dhanasekrann. The book teaches you how to build a shop application with Test-Driven Development using Phoenix. But the code uses Phoenix 1.3. Phoenix 1.3 still uses brunch for JavaScript asset generation. And the framework ships with Bootstrap for CSS. In v1.4 the authors replaced brunch with webpack. And now Phoenix uses Milligram, a minimalist CSS framework, instead of the heavyweight Bootstrap.
Read more →

NeoVim and LanguageClient for Elixir

Yesterday I installed LanguageClient-neovim for NeoVim. This tool adds Language Server Protocol support for NeoVim (or Vim8). It helps with autocompletion, code formatting, code definitions, and offers other features as well. LanguageClient-neovim Installation With minpac: call minpac#add(‘autozimu/LanguageClient-neovim’, {‘rev’: ‘next’, ‘do’: ‘!bash install.sh’}) In Neovim, run the following command afterwards: :UpdateRemotePlugins elixir-ls Installation You have to install a language server for each language you want to support and then configure the plugin.
Read more →

Learning About Clean Code With Elixir

Today I found an excellent article about Cleaning up your Elixir Code. It shows how you can refactor your code and use best practices (hexagonal design with adapters/ports, dependency injection, decoupling business logic from implementation details). I’m excited about learning about clean code and how to write maintainable programs. For a beginner, it’s still hard to apply these principles. Some frameworks, like [NestJS][nestjs], make this easier as they are very opinionated and enforce clean code principles.
Read more →

Friday Picks 012

Here are some things I’ve found useful this week or that I enjoyed: The Architecture of Open Source Applications - some free books on architecture! Use Svelte with SASS/SCSS in VSCode - add SASS to your Svelte project An Introduction to Domain-Driven Design - DDD w/ TypeScript - provides a good overview on DDD How to make your NodeJS application or API secure - some beginner-friendly advice on how to tackle security Mastering Phoenix Framework - free online version of a guide to Phoenix with TDD Building a JSON API in Elixir with Phoenix 1.
Read more →

Phoenix: Use Ecto to Recreate Your Database

Today I learned that it’s a bad idea to drop a PostgreSQL table directly with PGAdmin. Afterwards, I got tons of errors, because the table was missing. I you want to re-create your database from scratch, you should use Ecto. If you want to completely roll back your database and re-create it, use: mix ecto.reset From Codebase: reset is the equivalente of running the following commands: mix ecto.
Read more →

Phoenix LiveView Primer

I can’t help myself - I’m too enamored with Elixir and Phoenix. If you want to see what’s so exciting about Phoenix’s new features, check out the videos linked below by Dennis Beatty. He shows how to write two simple applications (a counter and a todo app) with Phoenix LiveView - no JavaScript! What is Phoenix Liveview? Phoenix LiveView is an exciting new library which enables rich, real-time user experiences with server-rendered HTML.
Read more →

Immutability in Elixir: Tuples and Lists

Let’s talk about what I learned about immutability and Elixir today. This is from the book Elixir in Action, Second Edition by Saša Jurić. So far, the book has been a great tour of Elixir and its features. Elixir’s data structures are immutable. You can’t change data. You can only make a new version of the original thing and switch out what you wanted to change. But the original data still exists.
Read more →