Sometimes users accidentally drag an HTML element into an editable area. This can be prevented by adding draggable=”false” to the element.
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/*”.
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.
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.
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.
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 (
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.
How to Disable beforeunload Event Listeners
I was doing some troubleshooting and wanted to disable the “beforeunload” event listeners on a page. This is how I accomplished it with the Chrome browser.
Always Bring Your Pull Requests Up to Date
A Pull Request (PR) should always be up to date with the branch into which it is being merged. Another way of saying this is you should be able to merge your PR as a fast-forward merge (even if you decide not to do a fast-forward merge). In this post we’ll look at how a safe looking PR that is out of date can be catastrophic to merge.