The nvm command allows you to switch between versions of node. Often a project will include a .nvmrc file to specify the version of node to use. Even if a project does not contain an .nvmrc file, you may be able to read the preferred node version from package.json and use that value with nvm.
I wanted to render a ReactJS component for a limited amount of time every time (think of a notification that pops up and then goes away). Ideally, we would like to be able to apply this limited time rendering to any component, so this was an excellent candidate for a Higher Order Component (HOC).
I was interested in the percent of U.S. Doctors who have been vaccinated against COVID-19 and the results I found online were surprising. While the American Medical Association (AMA) reports “96% physicians have been fully vaccinated for COVID-19”. The Association of American Physicians and Surgeons (AAPS), reported nearly 60 percent said they were not fully vaccinated against COVID. Why are these numbers so different? As a former AP Statistics teacher, I wanted to find out.
A common programming pattern when using WordPress filters is the early return pattern (also know as the “short-circuit” pattern). This pattern is useful when you want to allow a filter to override a value that is “expensive” to calculate.
When I downsized to a 65% keyboard I knew I was giving up function keys and a number pad but what caught me off-guard was the loss of my backtick (a.k.a. grave accent(`)) key. Because my keyboard runs QMK firmware, I’ve tried a number of modifications.
I replaced my keyboard of many years with a Drop.com Alt keyboard. This keyboard uses QMK firmware, which allows you to create modified firmware and run it on your keyboard. These are my notes about how I built a copy of the firmware locally and pushed it to my keyboard.
In my zsh configuration I define a number of aliases. One particular zsh alias maps gl to my custom Git alias “git lg”. Since my zsh configuration is portable, I want to define a fallback if my custom Git alias does not exist on the machine.
When developing code related to the WordPress heartbeat, it is frustrating to make your code changes and then wait for the next heartbeat to occur. You can trigger the WordPress heartbeat in the browser manually to eliminate this delay.
When two functions (or classes) have the same name, it triggers a fatal error in PHP. Namespaces are used to avoid these naming collisions.
While PHP namespaces allow you to refer to a function in file without using the fully qualified name, there is a catch when adding a WordPress hook or filter. The PHP __NAMESPACE__ magic constant can be helpful in this situation.