Skip to content

Instantly share code, notes, and snippets.

View brianjbayer's full-sized avatar

Brian J. Bayer brianjbayer

View GitHub Profile
@brianjbayer
brianjbayer / gist-add-factorybot-to-rspec-project.md
Last active March 30, 2024 02:12
Add the testing utility FactoryBot to your Rails project

Add and Configure FactoryBot To Your Rails RSpec Project

This guides you through adding the test data fixture utility factory_bot to your Ruby on Rails RSpec project.

To install factory_bot you will need to...

  1. Add the factory_bot_rails gem to your Rails RSpec project
  2. Configure factory_bot_rails to be used by RSpec Rails

🙇 📖 I originally learned this from these posts...

@brianjbayer
brianjbayer / gist-add-shoulda-matchers-to-rspec-rails-project.md
Last active March 30, 2024 02:27
Add the testing utility shoulda-matchers to your Rails project

Add and Configure shoulda-matchers To Your Rails RSpec Project

This guides you through adding the test expectation-matching utility shoulda-matchers to your Ruby on Rails RSpec project.

To install shoulda-matchers you will need to...

  1. Add the shoulda-matchers gem to your Rails RSpec project
  2. Configure shoulda-matchers to integrate with RSpec Rails

@brianjbayer
brianjbayer / gist-dockerfile-the-right-machine-for-the-app.md
Created February 23, 2024 00:50
Craft your Dockerfile specifically for your application to reduce size, cost, and risk

Dockerfile: Build the Right Machine for Your App

Rusted Rail Car - Wendy Bayer

📷 Image: Rusted Rail Car by Wendy Bayer


In this post, you will learn how you can craft your Dockerfile specifically for your application to reduce size, cost, and risk. It covers Docker Best Practices, uses

@brianjbayer
brianjbayer / gist-equivalence-class-partitioning.md
Created January 28, 2024 21:07
Fundamentals of Testing 3: What values to test - Equivalence Class Partitioning

Fundamentals of Testing 3: What Values to Test - Equivalence Class Partitioning

In this third post in this series on the fundamentals of software testing, I finish the topic of which values to test as part of your Verification Testing which I started in my previous post on using Boundary-Value Analysis.

Even if you can test all possible values of what you are testing (also known as the system under test), you do not need to waste

@brianjbayer
brianjbayer / gist-boundary-value-analysis.md
Last active January 28, 2024 21:09
Fundamentals of Testing 2: What values to test - Boundary-Value Analysis

Fundamentals of Testing 2: What Values to Test - Boundary-Value Analysis

In my last post (and the first of this series), I covered the three items comprising the intent of your testing when adding new behavior or changing existing behavior of your software system. In this post, I cover the most basic concept of which values to test as part of your Verification Testing.

Basically, you want to test the boundaries of the possible values

@brianjbayer
brianjbayer / gist-the-three-things-to-prove-in-your-testing.md
Last active January 28, 2024 20:38
Fundamentals of Testing 1: The three things to prove in your verification testing

Fundamentals of Testing 1: The Three Things to Prove

I'll start with one of the most basic testing fundamentals. It is also one that you will likely find applies in your day-to-day software development.

When you make a software change like adding new behavior or changing existing behavior, you need your testing to prove 3 things:

  1. Your changes result in the desired new or changed behavior.
@brianjbayer
brianjbayer / gist-using-a-counter-for-simple-and-performant-jwt-revocation.md
Created December 29, 2023 22:03
How to use an integer-based counter as a simple and performant mechanism for revoking a user's JSON Web Token (JWT)

Using a Counter for Simple and Performant JWT Revocation

Pioneertown Jail, CA - Wendy Bayer

📷 Photo: Pioneertown Jail, CA by Wendy Bayer


One of the biggest challenges with JSON Web Tokens (JWTs) as an authentication and/or authorization mechanism is the ability to easily and quickly revoke the token if it becomes compromised.

@brianjbayer
brianjbayer / gist-mac-docker-desktop-multi-platform-images.md
Created December 5, 2023 00:40
How to enable and build multi-platform images in Docker Desktop for Mac

Enabling and Building Multi-Platform Images in Docker Desktop for Mac

🏫 To learn what multi-platform images are, see this post from Docker Multi-arch build and images, the simple way

You can use Docker Desktop for Mac to build and push multi-platform images to support your containers running on different CPU architectures like Intel/amd64 and Apple Silicon/arm64.

@brianjbayer
brianjbayer / gist-mac-setup-development-environment.md
Last active November 2, 2024 15:21
How to setup a basic development environment on Mac

Set Up a Mac Development Environment (Sonoma 14)

This guide helps you set up the fundamentals needed for software development on macOS. This enables you to install your own language/framework specific development environment (such as Ruby/Rails, Python etc.)

This guide is optimized by following the minimum critical path to get you up and running.

@brianjbayer
brianjbayer / gist-mac-install-dev-apps-with-homebrew.md
Created November 19, 2023 23:24
How to install Chrome, Firefox, Docker, and VS Code using Homebrew on Mac

Install Development Applications Using Homebrew

You can use homebrew --cask to more easily install and manage many of your binary applications like...

  • Google Chrome
  • Firefox
  • Docker Desktop for Mac
  • IDE's such as Microsoft Visual Studio (VS) Code

⚙️ You can use an automated script to install