How to Solve Elixir’s “Module Is Not Available” Error

Elixir's "module is not available" error can drive you nuts. But fear not: After writing a lot of Elixir and seeing this error often, I'll developed a few quick tricks that you can use to solve why your module is not available in seconds instead of minutes. Here's 4 quick things you can check. Check Your Module Definition This almost goes without saying, but every time I don't check the module...

How To Test Asynchronous Text Changes with Hound and Phoenix

Writing asynchronous acceptance tests in Hound for Elixir and Phoenix can be difficult, especially if you are using a JavaScript framework like React, Vue.js, or Angular. If you have ever used end-to-end testing in your web application’s test suite, you have undoubtedly come across the issue of “flapping” tests. In many of the Ruby on Rails projects that I get asked to work on, I come...

How to Count Specific Items in a Collection with Elixir

So, I was working on this exercise over at Exercism.io, when I stumbled up an interesting function. To make a long story short, I needed a count of a specific character (codepoint) in a character list i.e. 'hello' contains two ls. However, this solution could apply to any collection which implements the Enumerable protocol in Elixir. I have been reading Programming in Elixir. The author, Dave...

Fluid Layouts with Auto Layout, Size Classes, Spacer Views, and Constraint Priorities

I came across a problem the other day with the "compact x any" size class in iOS 8 & Xcode 6. I was creating a layout for the size class which is supposed to cover the iPhone 4S 3.5-inch screen all the way up to the iPhone 6 4.7-inch screen. However, this became difficult to do well because what looked good on a small screen (like the 3.5-inch) did not look good on the large screen (4.7-inch...

How to Use Swift Computed Properties to Create a Simple Goal Tracker Class

This is the fourth Swift tutorial and video in a series I'm doing on Swift development. Source code examples are available on GitHub In this tutorial, we’re going to take a look at Swift computed properties and how they work. We’re going to create a very simple GoalTracker class. All our GoalTracker class is going to do is track our progress through something, i.e. how many miles or...