Author: Steve
-
Git, list all branches with their last commit date
Explanation: git for-each-ref: Iterates over refs (branches, tags, etc.).–sort=-committerdate: Sorts by the last commit date in descending order (newest first).–format=’%(committerdate:short) %(refname:short)’: Formats the output to show the commit date and branch name.refs/heads/: Limits the output to local branches.
-
Responsive headline word-wraps
It always happens that a long headline wraps 1 word to a new line, but if you add a line break, then it wraps one word before the line break at certain screen sizes. Here is a solution I came up with to handle that problem. The html: The css: Resize your browser to see…
-
How a 500 error and max_questions caught a sql injection attack
Due to limitations at the client’s host we had to troubleshoot a server outage through the Access Log and found that the site was under active attack
-
One-line bash script to create WordPress plugin zip from plugin directory
How I make a zip and ignore .idea, .git and other directories as defined in the .gitignore file This should not be done on a production site since a zip of the plugin will be publicly available and could expose sensitive information about your WordPress site. cd into the plugin’s directory This command will create…
-
Test a site backup locally
Download the site Download the site and unzip it into public_html Set up the docker-compose.yml Download docker-compose.yml and adjust as needed or use the version below: docker-compose.yml Import the database Change the path to the sql file in the docker container Create a backup of the database This will generate a backup of the database
-
Node version switcher using NVM
Node Version Manager makes it easy to switch which version of Node you are running: https://github.com/nvm-sh/nvm Install a version of Node: Switch to an already installed version: Check which versions are installed:
-
WordPress Gutenberg block not showing up sometimes
@wordpress/scripts 28 requires WordPress 6.6 or higher as explained in this thread: https://github.com/WordPress/gutenberg/issues/62202 so if you are using the currently latest WP 6.5 the easiest way to fix it is to install v27 of the scripts.
-
Ubuntu Workspaces with multiple monitor support
Ubuntu only switches workspaces on the primary monitor, to get it to work on multiple monitors run this command I found the answer here: https://askubuntu.com/questions/1059479/dual-monitor-workspaces-in-ubuntu-18-04#answer-1076343
-
Razer Kiyo web cam control in Ubuntu
I used this snap to control webcam settings: https://snapcraft.io/cameractrls I wasn’t able to get a preview of my camera, but I was able to reset the camera settings when OBS saved some weird settings to my camera