Skip to content

Instantly share code, notes, and snippets.

Working from home

Jonathan Bossenger jonathanbossenger

Working from home
View GitHub Profile
View gist:96213f25ed85e662ddf92ad818ed582d
( function ( blocks, element, blockEditor ) {
var el = element.createElement;
var RichText = blockEditor.RichText;
var useBlockProps = blockEditor.useBlockProps;
var BlockControls = blockEditor.BlockControls;
var AlignmentControl = blockEditor.AlignmentControl;
blocks.registerBlockType( 'wp-learn-javascript/javascript-block', {
edit: function ( { attributes, setAttributes } ) {
View wp-presets.css
--wp--preset--color--black: #000000;
--wp--preset--color--cyan-bluish-gray: #abb8c3;
--wp--preset--color--white: #ffffff;
--wp--preset--color--pale-pink: #f78da7;
--wp--preset--color--vivid-red: #cf2e2e;
--wp--preset--color--luminous-vivid-orange: #ff6900;
--wp--preset--color--luminous-vivid-amber: #fcb900;
--wp--preset--color--light-green-cyan: #7bdcb5;
--wp--preset--color--vivid-green-cyan: #00d084;
View cloud-init-for-wp-multipass
# cloud-config
# See
- software-properties-common
- unzip
- zip
# Setting the hostname
- echo "Setting the hostname"
- echo "wp-local-env" > /etc/hostname
View times_table_tester.php
$limit = $_GET['limit'] ?? 10;
for ($i = 1; $i <= $limit; $i++) {
$numbers[] = $i;
$shuffled = $numbers;
$lines = '';
$line_number = 0;
foreach ($numbers as $key => $number) {
jonathanbossenger /
Created Apr 29, 2022
Script to update PHP alternatives after enabling a different PHP version
# Get the PHP version number passed as a variable
if [[ $PHP_VERSION == '' ]]
echo "Please pass a PHP version number."
# Installation:
## Download the script to your home directory
# Make sure it has execute permissions (`chmod +x`).
# Install the script in one of the folders in your PATH. (`mv wp-install-core /usr/local/bin/wp-install-core-sub-dir`)
View ubuntu_set_audio_devices
# Get list of possible audio outputs
pactl list short sinks
# Will output something like
# 1 alsa_output.usb-Samson_Technologies_Samson_Meteor_Mic-00.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
# 2 alsa_output.pci-0000_09_00.4.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
# set the default audio output (taking note of the number)
pactl set-default-sink alsa_output.pci-0000_09_00.4.analog-stereo # 2
View create_wp_site
wp core download
wp config create --dbname=wordpress-clean --dbuser=root --dbpass=password
wp core install --url=https://wordpress-clean.test --title="WordPress Clean" --admin_user=admin --admin_password=password
jonathanbossenger / custom_series_taxonomy.php
Last active Nov 17, 2020
Customise default series taxonomy for SSP
View custom_series_taxonomy.php
// Override the series slug, used by WordPress permalinks
// Replace my_ with a custom prefix relevant to your project
add_filter( 'ssp_series_slug', 'my_custom_ssp_series_slug' );
function my_custom_ssp_series_slug( $slug ) {
return 'podcast_series'
// Override the series taxonomy key, used to create the custom taxonomy
// Replace my_ with a custom prefix relevant to your project
add_filter( 'ssp_series_taxonomy', 'my_custom_ssp_series_taxonomy' );
# Set up project to use wp-scripts for asset compilation
npm init
# Install required packages
npm install --save-dev --save-exact @wordpress/scripts
# Build assets
npm run build
# Watch for changes and build
npm run start