It has been a while since I posted an article, and even more since I posted an article about my workflow. Let’s fix this. Introduction Git is a powerful tool. It helps us keep the history of our projects, which is useful in the case we want to go back in time, still support an old version, or simply have traceability. It also helps us collaborate with others, by providing a way to share changes to…
TD;DR A new version of TypedStruct is available with a plugin interface and some bug fixes. For nearly two years now, TypedStruct has helped me and other people in the Elixir community to define typed structs without writing boilerplate code. Its core functionality is fairly minimal and I aim to keep it as such. Nonetheless, I have had some feature requests about integrating with Ecto or a lens…
This article is also available in French . Cet article est également disponible en français . TL;DR My blog is now hosted at ejpcmac.net/blog . Introduction I have started this blog a bit less than two years ago on Medium . It was a great platform to start with: there is no setup, nothing to configure, so you can start to blog in minutes. I just wanted to share some tips about programming in…
This article was originally published on Medium . Nix is a purely functional package manager that makes possible to create reproducible setups to share between developers. I have written a rather long article about it recently and I want to continue here with some specific instructions for Elixir projects in a much more concise way. I assume you know a bit about Nix in general—if it is not the…
This article was originally published on Medium . TL;DR If you don’t want to read how I’ve got to use Nix and general information about it but only focus on its use to setup a development environment, please jump to Using Nix. Even from that part, the reading can take some time as I wanted to share what I’ve learned and found useful accross two months of intensive usage. I had some initial…
This article was originally published on Medium . TD;DR A package is available on hex.pm and GitHub . In Elixir, you can define a struct by calling defstruct in a module. This macro takes a list of atoms which becomes the keys of the struct, or a keyword list associating these keys to default values: defstruct name: " John Smith ", age: nil , phone: nil All the keys are optional by default. To…
This article was originally published on Medium . TD;DR I’ve written an Elixir package to enable persistent logins through an authentication cookie, following Barry Jaspan’s Improved Persistent Login Cookie Best Practice . It is available on hex.pm and GitHub . After writing my server-side session store using Mnesia , I found a new problem to solve: how should I manage persistent logins? One…
This article was originally published on Medium . TD;DR A package is available on hex.pm and GitHub . I am currently writing my second Phoenix application, Kakte. This is the first one with full-featured user management, so I came to ask myself how sessions are actually handled in the Elixir world. A session is a way to associate a state with an HTTP connection, so it is a pretty important feature…
This article was originally published on Medium . Introduction TL;DR If you came here only for the technical article, please jump to the next section. If you are curious about who am I and why I start publishing here, you can continue reading this introduction. This is my first article on medium, so I thought it would be a good idea to start it with an introduction. I will present myself, who am…