I use Git in both my personal and professional life. Depending on the context, I want to use different contact information. This is how I set this up on my machine.
Git Change Default Branch to Main
In Git 2.28 you can change the default branch name from ‘master’ to whatever you want (the name ‘main’ seems to be a popular choice). This is the command to run to add this to your configuration.
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”.
Git alias to open Jira URL
As a developer, I spend a lot of time going back and forth between the command line and Jira tickets. I realized that since I always include the Jira ticket identifier (e.g. `sf-123`) in the branch name (in a reliable position), I could write a git alias to open the corresponding URL. This is how I implemented this behavior.
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.