Why is my file ignored by Git? Somewhere something is telling Git to ignore your file… but where? Is it in a .gitignore file in your current directory, is it in a .gitignore file in a parent directory, or is it in your global Git ignore file? There are many places it could be. The good news is we can ask Git why it is ignoring the file.
WP CLI Find in Post
Sometimes I want a list of blog posts that contain a certain string. For example, I might want a list of all blog posts that contain the word “kazoo” using WP CLI. My favorite tool for this is “wp post list”.
GitHub Bypass Failed Status Check
Sometimes a GitHub status check fails and you want to override it so you can still merge your PR.
PHP class_exists() check without the Fully Qualified Class Name
Sometimes you need to write PHP code that includes a check that the class you want to use exists. Because you need to provide the fully qualified class name (the namespace and the classname) our code can end up looking a little messy – but there is a better way.
Loop Through WordPress Multisite Blogs with WP CLI
When working on a WordPress multisite with WP CLI, it can be helpful to loop through all of the individual sites.
Pure Functions – The Secret to Writing Easily Testable Code
Unit tests are a wonderful tool for programmers. They allow you to ensure an individual part of your code base performs exactly the way you intend. Unit tests are ideal for testing pure functions and therefore it is beneficial to write pure functions.
Completing Batman
We watched half of the 1989 Michael Keaton Batman with our boys the other night.
Replace Local Git Branch with Branch on GitHub
There are times when I want to dispose of my local branch and replace it with the version on GitHub (the upstream version). For example, when I’m reviewing a teammate’s pull request and they rewrite history (e.g. perform a rebase or amend a commit), I don’t have any work on that branch and I only want their updated version.
Is Git Branch Up to Date
I often want to determine if my current Git branch is up to date with some other branch. One specific scenario is when I want to check if my current “feat/” branch is up to date with “main” (i.e. no new commits have been introduced in “main” that aren’t in “feat/”).
Get Jira Issue Title via REST API
I wanted to programmatically retrieve the title of a Jira issue in a script I was working on. These are my notes on how I did it.