A Git commit, represented by a single building block in my Git mental model, is a frozen moment in time for your project (sometimes referred to as a snapshot). Along with this snapshot Git stores metadata about the commit (e.g. the author of the commit). Each commit has a unique identifier called the commit hash (a.k.a. SHA), a 40 character long alphanumeric string that is often abbreviated to just the first seven characters (e.g. “2b3a38b”).
Programming
Git Rebase with Blocks
We can’t do a fast-forward merge when the most recent commit on the receiving branch does not appear in the branch we are merging in. One of our options in this situation is to rebase the branch we want to merge in.
Promise and Async / Await
Making fetch calls with Promises vs async/await.
Enable, Read, and Write Post Meta in WordPress Gutenberg
The WordPress block editor (a.k.a. Gutenberg) communicates with the database via the WordPress REST API. We can read and write post meta from within the Gutenberg editor after we enable the specific post meta field in the WordPress REST API.
Join Strings with Commas and “And” in JavaScript
In English the rules we use for joining a list of items involves more work than a standard join in JavaScript. Here is JavaScript code to join an array of elements with commas and an “and”.
Add WordPress Posts Column
Code to add a custom column to the WP Admin Posts listing page.
Why __() needs a hardcoded string in WordPress
When using a WordPress translation function, e.g. __(), you need to use a hardcoded string (not a variable).
JavaScript get Date in YYYYMMDD Format
Recently, I was working in JavaScript and I need to transform a date into the format YYYYMMDD, this is how I did it.
Code Standards Naming Styles
There are lots of ways to write variable names when programming. This is the list of ones I find myself using.
Add Gutenberg JavaScript Filter
WordPress PHP filters allow you make a value modifiable from outside of your code. With the WordPress Block Editor (a.k.a. Gutenberg), you can now do the same thing in JavaScript.