Skip to content

Instantly share code, notes, and snippets.

View cjj25's full-sized avatar

cjj25

  • United Kingdom
View GitHub Profile
@cjj25
cjj25 / linked-clone.sh
Created October 10, 2021 13:49 — forked from aojea/linked-clone.sh
Script to create a linked clone with libvirt
#!/bin/bash
set -xe
# This script takes as a parameter the name of the VM
# and creates a linked clone
# Ref: https://unix.stackexchange.com/a/33584
# The scripts assumes that it runs from the same folder
# where the vm image is located and it coincides with the
# image name
@cjj25
cjj25 / gist:1e1525afa472994459ce2cc68fc98a90
Created September 22, 2021 12:31
2021 - Compile Microsoft Detours
1. Download Visual Studio 2019
2. Clone the Detours Git Repo https://github.com/microsoft/Detours
3. Open Command Prompt inside repo dir
4. “%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat” x64 <-- change arch
5. nmake
@cjj25
cjj25 / example.php
Created June 9, 2021 12:59
WORDPRESS_CONFIG_EXTRA page cache config
<?php
function pj_user_config() {
return [
'redis_host' => 'changeme',
'redis_port' => 'changeme',
'redis_auth' => 'changeme',
'redis_db' => 'changeme'
];
}
@cjj25
cjj25 / wp-disable-seo-framework-mu.php
Last active June 4, 2021 13:20
Disable SEO Framework from running on WooCommerce Checkout routes
<?php
# Place this file in the ROOT of wp-content/mu-plugins
# If the folder doesn't exist, create it.
$do_not_load_seo_framework_routes = [
'/checkout/',
'/basket/',
'/?wc-ajax=update_order_review',
'/?wc-ajax=add_to_cart',
'/?wc-ajax=checkout',
'/?wc-ajax=get_refreshed_fragments'
@cjj25
cjj25 / wp-disable-yoast-mu.php
Created June 4, 2021 08:48
Completely Disable Yoast SEO at WooCommerce checkout using mu-plugin
<?php
# Place this file in the ROOT of wp-content/mu-plugins
# If the folder doesn't exist, create it.
add_filter('option_active_plugins', 'custom_disable_plugins_1');
function custom_disable_plugins_1($plugins)
{
$remove_plugin = false;
$plugin_to_disable = "wordpress-seo/wp-seo.php";
@cjj25
cjj25 / functions.php
Last active September 9, 2022 11:39
Prevent Yoast SEO from adding indexes to WooCommerce order data for a performance increase at checkout
<?php
# Place this code in your theme's functions.php
# Tested with WooCommerce 5.3.0 and Yoast SEO 16.4
if(function_exists('YoastSEO')) {
# Hook directly at the start of the init tree (important)
add_action('init', "maybe_remove_yoast_seo_module", 0);
function maybe_remove_yoast_seo_module()
{