How To Pretty Print JSON in PHP

Author: , June 11th, 2020

If you ever want to view your JSON as a human ;-} $pretty_json = json_encode($data, JSON_PRETTY_PRINT); https://www.php.net/manual/en/function.json-encode.php

How To Vertically Align Blocks Using CSS

Author: , June 4th, 2020

Outer Block – set the line-height: {some value} Inner Block – set the line-height: normal, along with display: inline-block; vertical-align: middle; Also works if you set OUTER height instead of the line-height (or together with the same value as the height).

How To Prevent Automatic HTML Line Breaks

Author: , May 14th, 2020

Recently, I had a list of command-line options in a table, and my browser was automatically inserting a line-break in-between the hyphen and the option character.

To prevent this, I simply added a little CSS:

NOTE: Never use the

HTML directive – it is obsolete!

How To Change the Destination Admin Email Address for User-Meta Pro Notifications

Author: , May 11th, 2020

How To Empty the Cache in Prometheus Using Curl

Author: , May 7th, 2020

I wanted to empty the time series data cache from the Prometheus server to start clean. The best practice is to use the administrative HTTP API via curl. For example, to clear all data for job mysqld as defined in the prometheus.yml configuration file:

If you want to delete ALL data from Prometheus, then […]

How To Upgrade Certbot, Python and PIP on AWS Linux 1

Author: , May 6th, 2020

I ran letsencrypt-auto renew and got the following error:

The solution in this article gave me the answer:

Turns out Python was old at version 2.7, so did the following also:

Also had to change the cron job script to call certbot directly instead of letsencrypt-auto : vi /root/letsencrypt-cron.sh

How To Install MySQL on MacOS Using Brew

Author: , April 5th, 2020

As a non-root user:

Make sure your PATH contains /usr/local/bin

How to Remove Skype for Mac

Author: , March 27th, 2020

Quit Skype From your Applications folder, drag the Skype icon into the Trash In the top Finder menu, select Go -> Go to Folder… or press Shift-Command-G to bring up the “Go to the folder” prompt Open ~/Library/Application Support and drag “Skype Helper” to the Trash Open ~/Library/Application Support/Microsoft and drag “Skype for Desktop” to […]

How To Downgrade PIP After Upgrade on Amazon Linux

Author: , March 25th, 2020

I tried upgrading pip when prompted to do so: sudo pip install –upgrade pip This worked, but removed the system install in /usr/bin/pip and replaced it with /usr/local/bin/pip – NOT GOOD! The solution is as follows:

How To Calculate CSS Height On The Fly Using Calc

Author: , March 25th, 2020

I needed to use an iframe between a pre-defined header and footer that would auto-fill the full height on any size screen. On a desktop, the combined height of the header + footer was 223px and for mobile was 157px, so below find the CSS example: calc(100vh – 223px) – for desktop calc(100vh – 157px) […]