Elixir Editor Fonts

The Fira font improves the Elixir Developer experience.

This is how to install it on a mac
`
brew cask install font-fira-code
brew install font-fira-code --cask

`For vscode in settings.json:
    "editor.fontFamily": "'Fira Code'",
    "editor.fontLigatures": true

This turns |> into an arrow. 

The Resignation That Wasn’t

Last Friday Boris Johnson announced that he was resigning with immediate effect and wrote a long resignation letter. The press have announced that he has resigned.

However there is as yet no date announced for the by election!

It appears that he has managed to announce a resignation without actually formally resigning as an MP.

The UK has a very odd system for MPs. The can’t technically resign. Insead they have to apply for one of the nominal positions that disqualify them from being an MP.

In this case it does not seem to have happened. This is also true for the other two that announced their resignations the same day.

Correction:

He did actually resign on Monday

Cat Psychology

Now starting week 4 of getting to know our 2 newly adopted cats.

One of the cats is happy to play string anywhere. The other works to strict zones. There are parts of the room that are for play and others for food/hiding. String will be played in a play zone, and ignored in others.

Understanding the cat zones makes communication easier

Dangers of inheriting config

I have just finished migrating a suite of Elixir projects from distillery to mix release. A key part of that change is that all environment variables need to be called from the runtime.exs rather than the various env.exs files.

This is part of a project to move to build once, deploy many times approach.

While working on this I found a few cases where the staging envitonment files inhereted from production. This is a big problem as you may turn things on in production later and not realise that the staging system (which can have a larger number of possible users) will also be using production.

I untangled the config into distinct files (keeping everything as it was) and only when it was reviewed it revealed certain production settings we don’t want in staging.

This relates to the talk Simple Made Easy.

Migrating from Distillery to mix release

Mix release became the offical way to release an Elixir project some years ago. Distillery had been the previous one.

Here are the steps needed to move across:

1. Move any config that uses environment variables into runtime exs.

2. Add a release section in your mix.exs

3. If you were using rel/config.exs to copy files into the release add this to a custom function in the mix.exs step

4. Remove distillery from your mix.exs and clean up the lock file.

5. Adjust your build process to call mix release instead of distillery.

This requires a lot of careful testing!

Learning New Languages

No matter how many ptogramming languages you know there is always another that you need.

Currently I am learning Elm with the next stop being Rust.

The Elm ecosystem is slightly broken on M1 Macs (including via Docker). My plan to reduce the pain is to use Storybook.

Github Actions vs Docker Compose

I have been migrating some tests to use github actions from Drone.
Locally we use docker-compose to run the app and tests.

There is one annoying difference. The networking setup is different for services. In docker-compose if you have a postgres service it has the network name of postgres. In gha services are all found at localhost.

This makes working across them a choice of either having a host of environment variables that you need to set in each case or having an entire config environment. Having fought with some environment variables for a while I found the distinct configs to be much cleaner. Env variables don’t propagate well through nested processes.

Elm In Action (Chapter 3)

I have finish working through chapter 3 of Elm In Action

https://github.com/chriseyre2000/PhotoGroove

I now can see the appeal of Elm to the Elixir developer.
There are a lot of language similarities.

It is opinionated, and which I may not agree with all the decisions I do understand them.

It would help if it were actively maintained as the mac dev tools seem to be lacking in certain areas.

Not having explored beyond the basics yet.

Learning Elm (attempt 2)

This is the second time that I have attempted to learn Elm.
The first time I was reading Seven More Languages
That time the chapter dedicated to Elm was highlighting a feature that have been removed from the language by the time I got to the chapter.

I am now working through Elm In Action.

Elm was the inspiration for some of the javascript libraries (redux) but seems to have a better theoretical basis.

However it does have it’s rough edges. It has strong opinions on use of commas, spacing (if I wanted to fight whitespace I’d be using python).

The language has also not been released much recently and the maintainer does not seem to both with mac support. This means that tools like elm format are broken.

On the positive side the error message do include suggestions on how to fix the current error. They don’t always solve the problem in one step, but can help to find the problem. Oddly the language talks to you in the first person!

I can see that the Elm Architecture could help simplify certain types of development.
The plumbing required to add it to a page does resemble Angular 1