Skip to content

Instantly share code, notes, and snippets.

View inspiredearth's full-sized avatar

Inspired Earth inspiredearth

View GitHub Profile
@ebetancourt
ebetancourt / wp-disable-plugin-update.php
Last active March 29, 2024 13:03 — forked from rniswonger/wp-disable-plugin-update.php
WordPress - Disable specific plugin update check
<?php
// have to add that opening tag to get syntax highlighting... ¯\_(ツ)_/¯
/**
* Prevent update notification for plugin
* http://www.thecreativedev.com/disable-updates-for-specific-plugin-in-wordpress/
* Place in theme functions.php or at bottom of wp-config.php
*/
function disable_plugin_updates( $value ) {
@erkobridee
erkobridee / 01__second-brain-system.md
Last active March 22, 2024 23:49
Second Brain System and productive useful references
@danielcompton
danielcompton / gist:6724333
Created September 27, 2013 04:53
Excel formula for calculating NZ tax paid on annual income.
=IF(B2<=14000,SUM(B2*10.5%),IF(B2<=48000,SUM(B2-14000)*17.5%+1470,IF(B2<=70000,SUM(B2-48000)*30%+7420,IF(B2>=70001,SUM(B2-70000)*33%+14020))))
@clayton
clayton / ffmpeg-install.sh
Created August 9, 2013 18:55
Install FFMPEG on OS X with HomeBrew to convert Mp4 to WebM
# Installation
brew install ffmpeg --with-vpx --with-vorbis --with-libvorbis --with-vpx --with-vorbis --with-theora --with-libogg --with-libvorbis --with-gpl --with-version3 --with-nonfree --with-postproc --with-libaacplus --with-libass --with-libcelt --with-libfaac --with-libfdk-aac --with-libfreetype --with-libmp3lame --with-libopencore-amrnb --with-libopencore-amrwb --with-libopenjpeg --with-openssl --with-libopus --with-libschroedinger --with-libspeex --with-libtheora --with-libvo-aacenc --with-libvorbis --with-libvpx --with-libx264 --with-libxvid
# Easy Peasy
ffmpeg -i video.mp4 video.webm
@lukecav
lukecav / Commands
Last active January 9, 2024 06:48
Speed up wp db export using WP-CLI
# Export site database using wp db export
wp db export /wp-content/wordpress-dump.sql --all-tablespaces --single-transaction --quick --lock-tables=false
# Gzip compress the recent database export
gzip wordpress-dump.sql
# Export sites database using wp db export and gzip compress
wp db export --all-tablespaces --single-transaction --quick --lock-tables=false - | gzip -9 - > wordpress-dump.sql.gz
@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' ) );
@ifamily
ifamily / wp-config.php
Last active January 8, 2024 05:06
A universal WordPress wp-config.php which works on local development to staging and production server environments.
<?php
/*
One wp-config for local development to staging to production.
*/
// Define Environments
$environments = array(
@pduchnovsky
pduchnovsky / optimize.sh
Last active December 11, 2023 11:40
Image size optimization for webpages jpg/png | https://duchnovsky.com/2020/11/images-optimization-for-web/
#!/bin/bash
# Script adapted by pduchnovsky
# https://duchnovsky.com/2020/11/images-optimization-for-web/
# Add list of folder names to ignore array here, separated by space
ignore=("./themes/*" "./resources/*" "./assets/*")
# Array of png optimizers with their arguments
optimizers=(
"optipng -nb -nc"
@hofmannsven
hofmannsven / README.md
Last active October 6, 2023 21:05
Storing WordPress files and database with WP-CLI on the server.

WordPress Backups with WP-CLI

@bjornjohansen
bjornjohansen / run-wp-cron.sh
Last active September 17, 2023 21:12
Run all due cron events for WordPress with WP-CLI. Works with both single sites and multisite networks.
#!/bin/bash
# Copyright © 2015 Bjørn Johansen
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
WP_PATH="/path/to/wp"
# Check if WP-CLI is available
if ! hash wp 2>/dev/null; then