Category: Tips & Tricks

  • Elixir and the Wall of Tests

    Here’s an experience I tend to have over and over: Generate a new Elixir / Phoenix project Use the super cool Phoenix generators to make a new model Change the model substantially Realize that the tests generated with the model are now super broken When I get into this situation running mix text produces a…

  • UUIDs for User IDs

    Integers By Default 🔢 Phoenix’s generators save a ton of time writing boilerplate code. Pow is an Elixir package and Phoenix extension that offers a great way to get user authentication up and running in very little time. But by default Phoenix’s generators use auto-incrementing integers for user IDs. What’s Wrong with Integer IDs 🤔?…

  • Don’t Make Me Tap Twice

    I’ve started rough work on a new app for digital “morning baskets“. While I just used Expo when starting Storytime (another app I have in-progress), I decided to give the famous Ignite boilerplate from Infinite Red a chance. In short, it’s fantastic. In just a few days of side-work time I’ve almost completed a fully-functioning…

  • Debugging tricky parameterized types

    Parameterized functions are fantastic. I’m talking about the functions that operate around some abstract piece of data, without doing anything that would require specific knowledge about that data. Take, for example, the following fictional function: Example The code above is designed to take an option of something, save it somewhere if the option contains data,…