Sometimes users accidentally drag an HTML element into an editable area. This can be prevented by adding draggable=”false” to the element.
Git Get Current Branch Name
I find there are two different times I want to get the current branch name: 1. When I’m at the command line, 2. Inside a Git alias function I’m writing. Interestingly, I find that my approach in these two situations are different.
phpcs no matches found ignore
When running phpcs with the –ignore option (because I don’t want to scan the /vendor nor /node_modules directories), I kept getting the error “zsh: no matches found: –ignore=/vendor/*,/node_modules/*”.
Git Branch Naming
There are lots of ways to name Git branches. These are my personal rules I’ve developed for naming Git branches.
Don’t Do It Now, Open an Issue Instead
When working on an issue, it is easy to get sidetracked by other unrelated changes that need to be made. I’ve found that instead of addressing other issues as I spot them, taking a moment to open an issue and then ignoring them allows me to stay focused on the task at hand.
Replace Local Git Branch with Remote Version
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.