Skip to content

Instantly share code, notes, and snippets.

View peterhartree's full-sized avatar

Peter Hartree peterhartree

View GitHub Profile
@peterhartree
peterhartree / textstroke.js
Created June 10, 2013 13:12
Text-stroke feature detect for use with Modernizr.js
/*!
{
"name": "CSS text-stroke",
"property": "text-stroke",
"caniuse": "css-text-stroke",
"tags": ["css"],
"knownBugs": ["None"]
}
!*/
@peterhartree
peterhartree / _header.less
Last active August 29, 2015 14:09
Compensate for the Bootstrap fixed top navigation bar, and offset if WordPress admin bar is visible.
// Compensate for the Bootstrap fixed top navigation bar.
//
// No styleguide reference.
body {
padding-top: @navbar-height;
}
// Offset fixed top navigation bar if WordPress admin bar is
// visible.
<?php
/*
Plugin Name: Disable plugins when doing local dev
Description: If the WP_LOCAL_DEV constant is true, disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Mark Jaquith
Author URI: http://coveredwebservices.com/
*/
@peterhartree
peterhartree / wp-capitalise-term-title.php
Created August 10, 2014 14:24
WordPress: Capitalise term title
/**
* Capitalises the first letter of term title for display.
*/
function capitalise_term_titles( $term_obj ) {
$term_obj->name = ucfirst($term_obj->name);
return $term_obj;
}
add_filter( 'get_term', 'capitalise_term_titles' );
/**
* @extends \WC_Email
*/
class WC_Custom_Order_Email extends WC_Email {
/**
* Set email defaults
*/
public function __construct() {