• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Archives for Draft

Draft Posts

Manually Trigger WordPress Heartbeat from Browser

Last updated on August 2, 2021 by Sal Ferrarello

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.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Programming, Solution Tagged With: WordPress, WordPress Heartbeat

Shampoo Bottle Protocol

Last updated on May 15, 2021 by Sal Ferrarello

One day I realized that the last 10% of the shampoo bottle lasted at least as long as the first 90%. I suspected this was because most of the time I was using too much shampoo but as I neared the end of the bottle I used a more appropriate amount. How could I trick my brain to always use the appropriate amount?

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Happy, Solution Tagged With: lifehack

Brady Bunch Achievement

Last updated on July 8, 2021 by Sal Ferrarello

The “Brady Bunch Achievement” is when you have exactly nine people on a video call. When this happens, viewing all participants in a grid looks like the intro to the Brady Bunch.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Funny

Remove newline at end of text file

Last updated on February 10, 2022 by Sal Ferrarello

Sometimes when I’m working with files in Git, I find myself with a change in a file that says “No newline at end of file”. This occurs when my editor adds the missing newline at the end of the file. While you should have a newline at the end of the file, you may have a reason for not wanting to add this change. In that case, you can remove the newline from the end of the file.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Solution Tagged With: command line, Git

phpunit.xml vs phpunit.xml.dist

Last updated on April 20, 2021 by Sal Ferrarello

As a PHP programmer I’ve seen projects with a phpunit.xml file or a phpunit.xml.dist file (or even both, which is a mistake). These are configuration files for PHPUnit but why the two different file names? PHPUnit first tries to use phpunit.xml and if that file does not exist, then it tries to use phpunit.xml.dist instead. PHPUnit only uses one of these files, never both.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Programming, Recommendations Tagged With: PHP, PHPUnit

JavaScript Or (||) Versus Nullish Coalescing Operator (??)

Last updated on November 3, 2022 by Sal Ferrarello

The “or” (||) operator and the “nullish coalescing operator” (??) can often be used in similar ways when reading a property from an object that may or may not exist. When dealing with strings you’re typically better off using “or” (||) and for numbers you’re typically better off using the “nullish coalescing operator” (??).

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Programming, Recommendations Tagged With: JavaScript

SemVer TLDR

Last updated on April 3, 2021 by Sal Ferrarello

Semantic versioning (SemVer) is a standard for defining the version numbers. A version number consists of three numbers separated by periods (X.Y.Z). The type of change being introduced (e.g. a new feature or a change that breaks backwards compatibility) determines which numbers are incremented.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Programming, Recommendations Tagged With: composer, npm, semver

Your edited hunk does not apply

Last updated on March 24, 2021 by Sal Ferrarello

When using git add -p and faced with a hunk that can not be split sufficiently for your purposes, you can use the e option (manually edit the current hunk). Unfortunately, after manually editing the current hunk it is common to get the message “Your edited hunk does not apply.” I’ve found there are some things I can do to avoid this failure.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Git

Writing Posts with CLI Commands

Last updated on March 1, 2021 by Sal Ferrarello

A lot of the posts I write include command-line interface (CLI) commands to type in. I’ve found over time there are things I can do to improve how these commands are communicated.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Presentation, Recommendations Tagged With: blogging, command line, website

Clue Board Game Exhibitionist Gambit

Last updated on March 1, 2021 by Sal Ferrarello

In the Clue Board Game (a.k.a. Cluedo), the Exhibitionist Gambit is when you suggest three cards in your own hand.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Game Theory Tagged With: Board Game

  • «Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Interim pages omitted …
  • Go to page 19
  • Next Page»

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in