Skip to content

Instantly share code, notes, and snippets.

View byronrode's full-sized avatar

Byron Rode byronrode

View GitHub Profile

Keybase proof

I hereby claim:

  • I am byronrode on github.
  • I am byronrode (https://keybase.io/byronrode) on keybase.
  • I have a public key whose fingerprint is D3BC F6AB A7F5 7A18 F532 ACD9 66DC A89E 5D46 E39A

To claim this, I am signing this object:

@byronrode
byronrode / add-sup-decimals.woocommerce.php
Created August 29, 2015 11:39
Add <sup></sup> wrapper around decimals for WooCommerce prices.
<?php
add_filter( 'woocommerce_get_price_html', 'themeprefix_add_sup_decimals_to_pricing' );
if(!function_exists( 'themeprefix_add_sup_decimals_to_pricing' )){
function themeprefix_add_sup_decimals_to_pricing( $price )
{
if(!is_admin()){ // Check that we're not in the admin
$price = strip_tags($price);
$price_exploded = explode('&ndash;', $price);
if(count($price_exploded) > 1) { // Variable Pricing
Verifying that +byronrode is my blockchain ID. https://onename.com/byronrode
@byronrode
byronrode / gist:a7a2c1b45d306a2edb3f
Last active August 29, 2015 14:03
Textmate 2 and Tabs (Admin Privileges)
set transmitCleanup to "/Users/byronrode/Library/Caches/Cleanup At Startup/Transmit/"
do shell script "mkdir -p '" & transmitCleanup & "' | touch '" & transmitCleanup & ".tm_properties'" with administrator privileges
do shell script "echo 'projectDirectory = \"$CWD\"' > '" & transmitCleanup & ".tm_properties'"
@byronrode
byronrode / gist:5753022
Created June 10, 2013 22:34
Allows developer/client only customization previews with WordPress.
<?php
/*
*
* @author: Byron Rode
* @description: Allows developer/client only customization previews with WordPress. Uses a simple
* cookie to handle previews, so don't go showing sensitive data. PS. I am NOT responsible
* if you do.
* @license: Free as in Beer
*
*/
@byronrode
byronrode / custom.css
Created April 10, 2013 07:48
How to overwrite CSS in a child theme or custom CSS file. Here I want to change the background colour and colour of an element with the class of "my_cool_css_class".
/* Parent CSS file*/
.my_cool_css_class {background:#fff;border-radius:5px;box-shadow:1px 1px 2px #000;color:#ff2361;padding:0px 10px;line-height:25px;height:25px;width:100%;}
/* This is WRONG. Very WRONG. */
/* Child Theme or Custom CSS file */
.my_cool_css_class {background:#2d2d2d;border-radius:5px;box-shadow:1px 1px 2px #000;color:#fff;padding:0px 10px;line-height:25px;height:25px;width:100%;}
/* This is RIGHT. Very RIGHT. */
/* Child Theme or Custom CSS file */
.my_cool_css_class {background:#2d2d2d;color:#fff;}
@byronrode
byronrode / update_product_variations.sql
Created June 28, 2012 14:38
Update product variations using MySQL.
UPDATE wp_postmeta as pm, wp_posts as p
SET pm.meta_value = 500 /* <new price> */
WHERE pm.post_id = p.ID
AND p.post_type = 'product_variation'
AND pm.meta_key = '_price'
AND pm.meta_value = 1000 /* <old price> */
AND p.post_status = 'publish';
@byronrode
byronrode / header.php
Created May 14, 2012 07:07
LESS for WP
<?php
require 'modules/lessphp/lessc.inc.php';
try {
lessc::ccompile(get_stylesheet_directory() . '/style.less', get_stylesheet_directory() . '/style.css');
} catch (exception $ex) {
exit('lessc fatal error:<br />'.$ex->getMessage());
}
?>
@byronrode
byronrode / SendToThings.scpt
Created April 28, 2012 01:12
Create To Do in Things
on perform_mail_action(info)
set selectedMessages to |SelectedMessages| of info
tell application "Mail"
repeat with eachMessage in selectedMessages
set theSubject to the subject of the eachMessage
set theContent to the content of the eachMessage
set tid to AppleScript's text item delimiters
@byronrode
byronrode / custom_field_shortcode.php
Created March 22, 2012 07:55
Adding this to your functions.php will allow you to use custom field values in your post via short code.
<?php
/*
@description: Adding this to your functions.php will allow you to use custom field values in
your post via shortcode. Useful for when you need to add javascript to a post.
@usage: [custom_field name="name_of_custom_field"]
@returns: Custom Field Value
@author: Byron Rode
@license: Free to use, modify, whatever.
*/