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.
JavaScript Unix Timestamp from String in Time Zone
Given a string like “2022-01-01 13:00:00”, which represents a time in the “Europe/Paris” timezone, how can we get the corresponding Unix Timestamp in JavaScript? This problem is sufficiently complex that in my opinion leveraging a third-party library is the best solution.
Local by Flywheel from Sub-Directory
I was recently working on a project that loaded WordPress from a sub-directory. The result of which is if I cloned the project into the “public” directory, the WordPress files and directories were one level deeper (in “public/wordpress”).
WordPress Gutenberg Notice in JavaScript
You can display four types of notices in the WordPress Block Editor (a.k.a. Gutenberg) using JavaScript: error, warning, info, and success. This blog post contains an example of each.
Disable Core WordPress Update Notice
When working on projects, I often want to strictly control the version of WordPress that is running. However sometimes one of the other administrators on the site sees the “WordPress 5.9 is available! Please update now.” message and clicks it, thereby prematurely updating to a newer version of WordPress core. This notice can be disabled.
git reset –hard vs git checkout -f
I recently had a conversation about “git reset –hard” vs “git checkout -f”, and it turns out they do the same thing. This is one of the tricky things about Git, there are often multiple ways to do the same thing.
git alias tab completion for functions
When creating a Git alias that points to a function, sometimes Git provides the wrong tab completion by default (e.g. filename completion instead of branch name completion). This is how we can tell Git, which type of completion to use.
git reset vs revert
Conceptually, “git reset” is erasing your last change while “git revert” is adding a new change that undoes your previous change.
Check CORS Value from Command Line
I was checking a number of URL endpoints for CORS restrictions today and I wondered if I could check from the command line. Here are some example curl statement that get me the information I’m looking for. I think there is an opportunity for a custom function here but for now, these notes will do.