I’m assuming Circle CI 2.0 (or higher).

In your .circle/config.yml file, add the following line to your build:

- image: stripemock/stripe-mock:latest

That will pull the latest docker image for your tests to run against.

If for whatever reason you want to test against an older docker tag (I wouldn’t ever do this) then you’ll find them listed here.

I’m using Elixir so my final CircleCI config basically (app name escaped) looks like:

version: 2
jobs:
build:
docker:
- image: circleci/elixir:1.8.1
environment:
MIX_ENV: test
- image: postgres:11
- image: stripemock/stripe-mock:latest
working_directory: ~/[APP PATH]
steps:
- checkout
- run: mix local.hex --force
- run: mix local.rebar --force
- run: mix deps.get
- run: mix ecto.create
- run: mix ecto.migrate
- store_test_results:
path: _build/test/lib/[APP PATH]

I love that Stripe Mock is a thing. I can write tests against a mock API that actually maintained by Stripe.

🍻

Originally published at https://nathanwillson.com.


August 29, 2018 · 2 min read

This post explains how to create an OptionSet in Swift that also implements the Hashable protocol. That way it can be used in a Dictionary, for example. Even though it’s super simple, I couldn’t find a documented example online so I thought I’d put one together.

Motivation

I’ve been recently working on a game using Apple’s SpriteKit and reached a point where I needed to implement and track in-game achievements. A user on reddit suggested using an OptionSet to store which achievements have been unlocked and a Dictionary as an “achievements encyclopedia” of sorts


July 23, 2018 · 6 min read

Difficulty level: Beginner to Intermediate
Languages: HTML, Javascript

This post covers the inner workings of Conway’s Webcam of Life. Check it out if you haven’t already.

The code is available here.

For the sake of simplicity, the entire project was written without any external libraries — just good ol’ Javascript (cringe).

Introduction

Conways Game of Life “is a cellular automaton devised by the British mathematician John Horton Conway in 1970.” Yep, I’m quoting wikipedia.

There are a lot of implementations of Conway’s Game of Life out there. I’d originally started by writing an implementation…


Difficulty Level: Intermediate-ish

If there’s one particle that’s always stumped me, it’s が. The way I’ve always used it is by memorizing set phrases like:

「 TOPIC 」が + あります。

「 TOPIC 」が + います。

There are just certain times you always use が right?

You’ll only get so far with that way of thinking. Principles over memorization!

It wasn’t until I read A Students’ Guide to Japanese Grammar, by Naomi Hanaoko McGloin, that it really clicked for me. It’s one of those books that sat on my shelf for a few years, and blew me away when I finally…


This post touches on what I did to convert an existing MySQL database to Postgres, which I eventually loaded onto Heroku. The hopes is that it’ll highlight some of the hiccups that I ran into.

As much as I can I’m going to use real examples and not just quote documentation.

Who is this article for?

For anyone migrating a relatively simple database from MySQL to Postgres. I didn’t get too deep into pgloader (and there’s seriously a lot you can customize), but I did run into a few snags.

Complexity?

For beginner programmers like myself. …

Nathan Willson

Developer and spoken language learner. Find me @nathanwillson or https://github.com/nbw

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store