Elixir deployments optimized for free hosting


Recently I stumbled upon this excellent article by Damon Janis about how to deploy a Phoenix web app to a single Linux server, optimizing for cost effectiveness, control, and simplicity.

If you haven’t already, then you should read it immediately. It contains a ton of useful information, not only Elixir-related.

In this post I want to integrate the previous article with the approach that I used during the deployment of one of my latest Elixir side-projects. Keep in mind …

Read More
How to use Fastify on Google Cloud Functions


This post started as a simple guide on how to configure the Fastify web framework to run inside a Google Cloud Function, but its focus quickly switched to a deeper analysis on the authentication to Google Cloud Functions (GCF from now on).

GCF is the FaaS (Function as a Service) platform provided by Google. It’s a serverless execution environment for building and connecting cloud services. With Cloud Functions you write simple, single-purpose functions that are attached to …

Read More
Use context in ExUnit tests


I’m on my journey to learn the Elixir programming language and I’m really enjoying the process so far.

Elixir is a dynamic, functional language designed for building scalable and maintainable applications.

Switching from a Object-Oriented approach to a functional approach makes me appreciate the benefits of immutable data and function composability.

I decided to document my progress in my blog, specifically I would like to write about any non-trivial issue that I …

Read More
Run and debug Github actions locally


The GitHub actions service was launched exactly one year ago (November 2019).

Since then it has got lots of positive feedback and it has quickly convinced many developers to shift the integration and deployment pipelines of their applications from external CI/CD services to GitHub. Having the possibility to build, test and deploy code from a central service greatly helps developers, who are notoriously lazy (or at least, I am 😔).

Usually when creating a new GitHub action, you …

Read More
Reduce the size of a large MySQL dump file


I already mentioned in a previous post that sometimes at work we have to deal with very large mysqldump backups of our production MySQL databases. A couple of days ago I had to restore locally a database from a 2.6 GB dump file gzipped, which means that the full database was almost 27 GB large.

Running the import command

$ mysql -u homestead -psecret mydatabase < large-dump.sql

completely killed my MySQL development instance (I’m using Laravel Homestead), forcing me …

Read More
Send email in Laravel without using Mailables


I keep forgetting how to send an email in Laravel without using Mailables. The the documentation does not help so I’m writing this down here for future reference.

The following examples are based on the code of the Mailer class

How to

In order to send a raw message (in plain text) you can use the raw method of the Mail facade:


Mail::raw('Hello, welcome to Laravel!', function ($message) {

On the …

Read More