Skip to content

Instantly share code, notes, and snippets.

Avatar

Ron Rennick rrennick

  • https://automattic.com
  • Fredericton, New Brunswick, Canada
  • Twitter @sillygrampy
View GitHub Profile
@rrennick
rrennick / round.log
Created July 2, 2020 22:57
WooCommerce Round log
View round.log
// Tax rate 1 was 8.5%
// Tax rate 2 between 3% and 10% on .5% increments
price: 10.10, rate 2: 9.00, wc tax: 1.84, round tax: 1.85
price: 10.20, rate 2: 3.50, wc tax: 1.25, round tax: 1.26
price: 10.30, rate 2: 3.00, wc tax: 1.21, round tax: 1.22
price: 10.40, rate 2: 3.50, wc tax: 1.28, round tax: 1.27
price: 10.50, rate 2: 4.50, wc tax: 1.41, round tax: 1.40
price: 10.80, rate 2: 5.00, wc tax: 1.50, round tax: 1.51
price: 10.90, rate 2: 7.00, wc tax: 1.75, round tax: 1.76
@rrennick
rrennick / fix-as-action-ids.php
Last active October 3, 2020 14:04
Address fatal error in Action Scheduler when identity field was not correctly set on migration
View fix-as-action-ids.php
<?php
/*
Plugin Name: Fix Action Scheduler Action IDs
Version: 0.2
Author: Automattic
Author URI: https://automattic.com/
Description: This is a one time use plugin designed to address a fatal error during AS migration where the identity field in the actionscheduler_actions table did not get set before actions were migrated.
License: GNU General Public License v3.0 (or later)
License URI: http://www.opensource.org/licenses/gpl-license.php
@rrennick
rrennick / gist:5171259
Last active December 31, 2018 15:21
Linux/Mac command line for reverting file modification changes that have not been committed. Does not include removing files that were added to the repo.Originally posted at https://gist.github.com/anonymous/5171214 because I didn't know you had to re-login into the gist site when already logged into github.
View gist:5171259
for F in `git status | grep modified | cut -f4 -d' '` ; do git checkout -- $F ; done
@rrennick
rrennick / gist:4651331
Last active July 11, 2016 21:04
Add global menu using network-wide-menu
View gist:4651331
<?php
/*
register the menu across the network
*/
register_nav_menu( 'global', 'Global Navigation Menu' );
/*
remove the menu from the menu screen on sub sites to avoid confusing users
*/
add_action( 'admin_init', 'global_nav_menu_init' );