Skip to content

Instantly share code, notes, and snippets.

@fevangelou
fevangelou / my.cnf
Last active April 26, 2024 09:12
Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers)
# === Optimized my.cnf configuration for MySQL/MariaDB (on Ubuntu, CentOS, Almalinux etc. servers) ===
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ Updated December 2021 ~
#
#
# The settings provided below are a starting point for a 8-16 GB RAM server with 4-8 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
#
@neilgee
neilgee / selective.php
Last active March 5, 2021 02:05
WooCommerce Conditionally Removing Scripts and Styles
<?php
add_action( 'template_redirect', 'bt_remove_woocommerce_styles_scripts', 999 );
/**
* Remove Woo Styles and Scripts from non-Woo Pages
* @link https://gist.github.com/DevinWalker/7621777#gistcomment-1980453
* @since 1.7.0
*/
function bt_remove_woocommerce_styles_scripts() {
// Skip Woo Pages
@DevinWalker
DevinWalker / woocommerce-optimize-scripts.php
Last active January 8, 2024 13:24
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );