This situation often arises for me when I’m reviewing a teammate’s Pull Request and they make changes by rewriting history. In this situation, I want to discard my local copy of the Pull Request branch and replace it with the version on GitHub (or wherever the remote branch is being stored).
WordPress View Block Attributes
When developing a WordPress plugin that creates a Gutenberg block, it is invaluable to be able to view the attributes on the block. Here are some tricks I use to view this information.
I Want to Get a Cow and Name it Jagger
I want to get a cow and name it Jagger. Then I’m going to walk around mooing and when people ask me what I’m doing…
Automatically Switch Node Version in Zsh from package.json
Add this code to $HOME/.zshrc to automatically set the node version to match the version in package.json.
Getting Started with LuaSnip
This article assumes you are using Neovim (version 0.8.0 or higher) and packer.nvim to manage your plugins. Adding the following loads the LuaSnip plugin, creates a snippet for “func”, and maps “Ctrl + p” to expand the snippet and jump through the fields.
Git autoSetupRemote Prevents “no tracking information” Error
After creating a pushing a new branch to GitHub (or any remote), when I do “git pull” I often get an error that says “There is no tracking information for the current branch”. The Git config value “autoSetupRemote”, introduced in Git version 2.38, lets us avoid this entirely error.
vim.keymap.set() coc to confirm completion with lua
I’m currently rewriting my Neovim configuration using lua rather than using vimscript. I’m using the coc.nvim plugin and want to map return (
Beginner Mastodon Intro
As a Mastodon beginner I wanted to document what I’ve learned while everything is still new and fresh to me. You can find me on Mastodon at phpc.social/@salcode.
Moving to a Different Mastodon Server
When I first signed up for Mastodon, I created my account salcode on https://mastodon.social/. Eventually I decided I wanted to be on a smaller server, specifically https://phpc.social/. These are my notes on how I made this move.
trailingslashit() vs untrailingslashit()
WordPress has two functions that can be helpful when dealing with the final character of a URL, trailingslashit() and untrailingslashit(). I find it preferable to use untrailingslashit() for two reasons: 1. It does not break empty checks and 2. It makes my sprintf() statements more readable.