Add a Resize Handle for WordPress Post and Page Edit Sidebar

I was converting some ACF fields to Gutenberg ACF fields and put together some options for how/where content can be edited. The acf_register_block_type() function has the mode option. The allowed values are: – auto: Preview is shown by default but changes to edit form when block is selected. – preview: Preview is always shown. Edit … Continued

Workaday Reading

Stop mocking about: Event Dispatcher

“I don’t like mocks in unit testing (I use them, but don’t like them). It often results in tests that only assure some specific method was called with certain parameters. It is this approach that may lead some to think that writing tests is writing the code twice, and therefore a waste of time.”


read »

Workaday Reading

COUNT(*) vs COUNT(id) in MySQL

“TL;DR: Use COUNT(), not COUNT(id), when you want to count rows. You have probably read in a bunch of different places that you shouldn’t use SELECT() in MySQL when you don’t need all the data. SELECT(*) selects all the columns in the table, not just the ones that you might need.”


read »

Workaday Reading

How technology literally changes our brains

“Nicholas Carr on deep reading and digital thinking. In 1964, the Canadian philosopher Marshall McLuhan published his opus Understanding Media: The Extensions of Man. In it he writes, “In the long run, a medium’s content matters less than the medium itself in influencing how we think and act.”


read »

How to Set the Default Terminal on Mac OS X

I was testing out a bash script on my Mac and the script had some code to switch the shell from /bin/zsh to /bin/bash so that I would have similar shell to the servers the code would run on. There was also code to switch it back to /bin/zsh but I think with the script … Continued

Workaday Reading

Upgrading Bash on macOS

“One thing that many macOS users don’t know is that they are using a completely outdated version of the Bash shell. However, it is highly recommended to use a newer version of Bash on macOS, because it enables you to use useful new features. This article explains how to do this.”


read »

Workaday Reading

Accessibility Check #1

“Today I’m starting my very first accessibility check. I’ll be auditing websites to see how well they implement accessibility and pointing out the problems and items that need improvement.”


read »

Workaday Reading

The Slotted Counter Pattern

“It is a common database pattern to increment an INT column when an event happens, such as a download or page view. You can go far with this pattern until bursts of these types of events happen in parallel and you experience contention on a single row.”


read »

Workaday Reading

Traits

“PHP implements a way to reuse code called Traits. Traits are a mechanism for code reuse in single inheritance languages such as PHP.”


read »