Tuesday Picks 005

Read more →

Friday Picks 033

Here are 5 links for this Friday: How to create a simple REST API with Python and Flask in 5 minutes - a beginner-friendly Python & Flask tutorial What is Phoenix LiveView - a good overview about the new experimental feature in Elixir’s web framework For a Good strftime - if you quickly want to look up how to format a string in Python Introduction to CSS - Youtube series about CSS A Recap of Frontend Development in 2019 - what happened in 2019?
Read more →

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.drop 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 →

Developing with Elixir in Vim

Using (Neo)Vim is surprisingly enjoyable after the initial hurdle. Language support for Elixir also works fine in Vim. Plugins I use minpac as my package manager. VimCasts has a good introduction video on minpac if you’re interested. Add these plugins to your ~/.vimrc: elixir-editors/vim-elixir optional: tpope/endwise for automatically adding end after def, do, etc. optional: dense-analysis/ale for fixing and linting files Configuration: " in .vimrc or ~/.config/nvim/init.vim syntax on filetype plugin indent on set laststatus=2 set wildmenu Elixir Language Server You need the Elixir Language Server as a backend/integration tool.
Read more →

nrepl Frustrations

A few months ago I worked through the book Web Development with Clojure, 2nd Edition. The book was written in 2016 and some code is outdated. That was frustrating but I could get it to work by looking up the documentation for Luminus and googling everything else. When I tried to start another project today, I got tons of errors from the nrepl. And I have no clue if it’s related to VSCode, Luminus, Clojure, leiningen or whatever tool I use.
Read more →

Fizzbuzz with Elixir

I’m reading Programming Elixir ≥ 1.6 right now and there are two interesting examples of coding Fizzbuzz. defmodule Fizzbuzz do def upto(n) when n > 0, do: _upto(1, n, []) defp _upto(_current, 0, result), do: Enum.reverse(result) defp _upto(current, left, result) do next_answer = cond do rem(current, 3) == 0 and rem(current, 5) == 0 -> "Fizzbuzz" rem(current, 3) == 0 -> "Fizz" rem(current, 5) == 0 -> "Buzz" true -> current end _upto(current+1, left-1, [next_answer | result]) end end This is the output:
Read more →

Useful Elixir Learning Resources for the Beginner

I’m learning ELixix at the moment, to have some variety from coding in JavaScript. Elixir is a friendly, functional language with a syntax that is a bit similar to Ruby. This document gives a good overview: Range.new(1,10) |> Enum.map(fn x -> x * x end) |> Enum.filter(fn x -> rem(x, 2) == 0 end) #=> [4, 16, 36, 64, 100] from the official homepage: Elixir is a dynamic, functional language designed for building scalable and maintainable applications.
Read more →