Skip to content

Instantly share code, notes, and snippets.

View danielmcclure's full-sized avatar

Daniel McClure danielmcclure

View GitHub Profile
@mikejolley
mikejolley / gist:1733834
Created February 3, 2012 23:53
WooCommerce - Make address fields wider
add_filter('woocommerce_billing_fields', 'custom_woocommerce_billing_fields');
function custom_woocommerce_billing_fields( $fields ) {
$fields['billing_address_1']['class'] = array( 'form-row-wide' );
$fields['billing_address_2']['class'] = array( 'form-row-wide' );
return $fields;
}
@clawfire
clawfire / functions.php
Created August 7, 2012 13:18
Don't display placeholder and image if there's no picture defined for a category
<?php
// unload the original one
remove_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail');
// load mine
add_action( 'woocommerce_before_subcategory_title', 'woocommerce_subcategory_thumbnail_custom', 10);
if ( ! function_exists( 'woocommerce_subcategory_thumbnail_custom' ) ) {
function woocommerce_subcategory_thumbnail_custom( $category ) {
global $woocommerce;
@kloon
kloon / gist:4239771
Created December 8, 2012 10:48
WooCommerce Name Your Price, show minimum price on archive pages
add_filter( 'woocommerce_get_price_html', 'woocommerce_nyp_min_price', 11, 2 );
function woocommerce_nyp_min_price( $price, $product ) {
if ( !$product->nyp )
return $price;
if( is_shop() || is_product_category() || is_product_tag() ) {
$price = woocommerce_price( $product->minimum );
}
return $price;
@growdev
growdev / gist:5210074
Last active December 15, 2015 05:39
WooCommerce 2.0.4 - Change number of columns of thumbnails for Up Sells on product page.
<?php
// first remove the action defined in woocommerce-hooks.php
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
// modeled off of the woocommerce_upsell_display() function in woocommerce-template.php
// change $columns to desired number of columns
function my_woocommerce_upsell_display( $posts_per_page = '-1', $columns = 5, $orderby = 'rand' ) {
woocommerce_get_template( 'single-product/up-sells.php', array(
'posts_per_page' => $posts_per_page,
function add_genesis_before_entry () {
echo '<div class="before-entry">genesis_before_entry </div>';
};
add_action('genesis_before_entry ', 'add_genesis_before_entry ');
function add_genesis_entry_header () {
echo '<div class="entry-header">genesis_entry_header</div>';
contract WillManager {
address public willOwner;
bytes32 public hashOfWill;
function WillManager(){
willOwner = msg.sender;
}
function newWill(string will) {
if (msg.sender != willOwner) throw;
hashOfWill = sha3(will);
contract ethExchange {
address public public ethClassicWithdrawer;
address public public ethForkWithdrawer;
bool public accepted;
address public refundContract = '0xbf4ed7b27f1d666546e30d74d50d173d20bca754';
function ethExchange(uint amountToExchange) {
ethClassicWithdrawer = msg.sender;
}
@JeffreyBPetersen
JeffreyBPetersen / PermanentDAOHardforkConditionalTransfer.sol
Created July 17, 2016 20:38
Contract to protect against replay attacks after the current Ethereum fork
contract PermanentDAOHardforkConditionalTransfer {
/* whether this contract is currently being used on the forked chain, it defaults to false */
bool public forked;
/* whether the value of "forked" has been set and locked yet, it defaults to false */
bool public readyAndLocked;
/* record the status of the fork and mark this contract ready to be used for transfers */
@quasel
quasel / gist:37c61aeb933bb8956745
Created November 7, 2015 09:21 — forked from BurlesonBrad/gist:de5b1ca4644d2b58a10f
Full Potential of Schema and WooCommerce
<div itemscope itemtype="http://schema.org/Product">
<span itemprop="name">Kenmore White 17" Microwave</span>
<img src="kenmore-microwave-17in.jpg" alt='Kenmore 17" Microwave' />
<div itemprop="aggregateRating"
itemscope itemtype="http://schema.org/AggregateRating">
Rated <span itemprop="ratingValue">3.5</span>/5
based on <span itemprop="reviewCount">11</span> customer reviews
</div>
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
<!--price is 1000, a number, with locale-specific thousands separator
@MrChrisJ
MrChrisJ / Installing_on_Jessie_Bitcoin_Core_0.12.md
Last active February 24, 2017 20:46
Installing_on_Jessie_Bitcoin_Core_0.12.md

Installing the Bitcoin #Fullnode to turn it in to a Freedom Machine

This is mashup of two instructions:

Raspnode & Tutorials & Technicalities - Compile Bitcoin Core on Raspberry Pi and forms part of the Bitcoin Fullnode Project.

You will need:

  1. 8Gb Micro SD Card (preferably Class 10 or above with wear protection)
  2. Download Raspian Jessie https://www.raspberrypi.org/downloads/raspbian / or your favourite distro

The new version of Raspbian Jessie is out: 2016-02-09-raspbian-jessie.img, at the time of writing includes bundled software which takes up extra room on the disk. To remove these packages see instructions on Strip Down Raspian.