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 (
Dev Tips
vim.keymap.set() coc
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.
Compare composer.json on Two Different Git Branches
I have composer.json files on two different branches and I want to compare their (non-dev) dependencies. This is the command I run to compare the “require” section of composer.json on my current branch to the “require” section of composer.json on another branch.
Check If We Can Do a Git Fast-Forward Merge
When I’m working with Git, there are times I want to check if I can do a fast-forward merge but I do NOT want to actually perform the merge.
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.
Revert Merge Commit
Typically a Git commit has exactly one parent, however a Git merge commit has two parents. The problem this creates with Git revert, is it is unclear which commit we want to revert to.
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.
Quickly Delete Large Directory from the Command line
When deleting a large directory from the command line, it can take a frustratingly long time for the task to complete. This is a trick I use to speed things up.
WordPress Gutenberg Trigger Autosave
Recently, I was documenting the steps to reproduce a certain bug and the bug required the presence of an autosave (along with the “There is an autosave of this post that is more recent than the version below.” message). Rather than wait for an autosave to occur naturally, I wanted to speed things up and manually trigger one. This is the command I use to do that.
Intermediate Git
I’ve been using Git for a number of years. When I was a Git beginner, I followed some prescribed steps and things worked – most of the time. This seems to be a pretty common experience for people starting out with Git. The magical part is when I started to understand Git, when I went from beginner to intermediate. These are some blog posts and videos that would have helped me with that transition.