My Fizz Referral Code

👉 B1MCA 👈

Would anyone like to join Fizz? The new all-digital mobile service provider that lets its members rollover their unused data to the next month. It’s such a smarter alternative — you’ll love it. and we each get a $35 bonus. Get started: https://fizz.ca/en?ref=B1MCA

Uses

Here's a list of software & hardware I use on a daily basis as a freelance software developer.

Editor & Terminal

  • Whenever possible, I use tmux + Vim in iTerm2. Truthfully, it’s been so long that I don’t really remember what the benefits are. I use iTerm2 because it of the ability to move the tabs into the chrome.
  • I create a separate tmux session for each project I’m working on. Each window typically has a 70/30 horizontal split with code on the top pane and a command prompt on the bottom. I’ll further split the bottom pane vertically to add live logs, tests or any other temporary data.
  • For iOS development, I use Xcode 🤯
  • I use the Fira Code font in iTerm2 and Xcode because ligatures make me happy.

Software

  • I track my hours with Harvest.
  • I block apps from using data when tethering with TripMode. No, Xcode, you may not auto-upgrade while I’m on cellular data.
  • I create low-fidelity wireframes with Balsamiq.

Desk setup

  • I use a three monitor layout. The monitors themselves are nothing special. I’m looking to upgrade but 1) don’t want to settle for anything less than retina and 2) can’t afford 2 retina monitors 💸
  • My primary monitor contains my code editor and a browser for googling.
  • To my right is my 16-inch MacBook Pro. I use its retina screen to run whatever I’m coding, whether it be a web app or a mobile app.
  • My left monitor contains real-time, transient data: Slack, Tweetbot, YouTube, etc.
  • The two monitors are mounted on an AmazonBasics dual monitor arm and the laptop sits on a Rain Design mStand.
  • I swapped out my Ergodox EZ in favour of a Microsoft Sculpt Ergonomic Keyboard due to the negative tilt + wrist rest combo.
  • Apple Magic Trackpad 2, no mouse.
  • Everything sits atop my 78x30 Jarvis standing desk with a TR-1200 DT3 under desk treadmill underneath it.
  • Question: How do people sit when they have an under desk treadmill? It’s too heavy to move regularly and I always want to be at the centre of my desk. I currently move a PRÄSTHOLM over my treadmill when I want to sit. Not ideal.

6 Ways Ansible Makes docker-compose Better

Not everything is in a container, and not everything is easily containerized. Sure, in development you can hook your application up to a mocked-up database, but what if you've got an actual production database that requires authorization for your application to talk to it? Or what if you need to change Route 53 settings because you're doing a blue-green deployment of containers in AWS? What if you need to set up networking between two containers on different hosts, but the two hosts can't even talk to one another?

I was always thinking "Ansible vs. Docker" when the answer was "Ansible + Docker." 💜

An Introduction to HAProxy and Load Balancing Concepts

A high availability (HA) setup is an infrastructure without a single point of failure. It prevents a single server failure from being a downtime event by adding redundancy to every layer of your architecture.

Because, you know, my 5 MAU side-project really needs load balancing 😇.

How to Program by Justin Searls

Great talk by Justin Searls about working on a team with different programming personalities/perspectives, "outside-in development" and really helped put into words why I enjoy writing seemingly unnecessarily small units of code.

It's geared towards the Rails audience (being a Railsconf Keynote) but it's applicable to development in general.

That One Optional Property

A good technique for removing Optional properties.

class LocationViewController: UIViewController {
  var notificationMessage: String?

  // ...
}

vs.

class LocationViewController: UIViewController {
  enum Mode {
    case fromNotification(message: String)
    case normal
  }
  
  var mode: Mode

  // ...
}

This optional property doesn’t carry any semantic meaning. What does it mean about the state of this object if the type is nil?

Cocoa Autolayout: content hugging vs content compression resistance priority

Quick summary of the concepts:

  • Hugging: content does not want to grow
  • Compression Resistance: content does not want to shrink

New rule: if I need to Google a concept more than 5 times, I'll put it on this site.

Running iOS integration tests on Travis

When programming loses its elegance... Also, a great use case for GitHub's "squash and merge" button.

The biggest obstacle was understanding why Travis was complaining that it had no eligible devices to run my tests. Even though I could clearly see that it had iPhone SE simulators running iOS 10, it kept giving me this error:

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
    { platform:iOS Simulator, OS:10.0, name:iPhone SE }
  Ineligible destinations for the "FisherHallClientTests" scheme:
    { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Generic iOS Device }
    { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Generic iOS Simulator Device }

The reason was because my deployment target was iOS 10.1. Travis is using Xcode 8, which only has iOS 10.0 devices. Obvious in retrospect.

Making Travis CI see your Xcode schemes

One of the first things I do on any new project is hook up continuous integration. Tests that don't run continuously are not maintained and unmaintained tests are most likely failing.

If—like me—you have trouble getting Travis to see your test scheme from Xcode, make sure that you mark it was "Shared."

The root cause is that the default behavior of Schemes is to keep schemes 'private' until they are specifically marked as shared. In the case of a command-line initiated build, the Xcode UI never runs and the xcoderun tool doesn't have its own cache of Schemes to work with.

Setting the default tab size for your Github repository

As a new convert to tabs in the Tabs vs. Spaces war, my immediate concern was how my code would look in GitHub 👀. It turns out that GitHub respects the .editorconfig file used by JetBrains, allowing us to set up the default tab size with the following:

.editorconfig:

[*.swift]
indent_style = tab
indent_size = 2