Performing Bulk Updates with Ecto And Elixir

Updating one database row in Ecto is straightforward. But figuring out how to bulk update rows using Ecto without updating one record at a time? Now that is a pain. What if there were a way to bulk update rows of data in your database using only ONE update call? Well, there is, and in this post, I'll show you how you can do it using Ecto without having to write a single line of SQL. Ecto update/2...

How to Use IEx.pry in Elixir Tests

Elixir's IEx.pry is a great debugging tool. It allows you to stop time ("pry") in the middle of your application in order to inspect the conditions in which your app is currently running. However, if you've ever had to try and use IEx.pry while running your Elixir tests using mix test, you've probably encountered a problem. It won't actually work. You may have seen an error similar to this:...

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...

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...