Skip to content

Instantly share code, notes, and snippets.

@clayb
clayb / countdown-clock.html
Created December 27, 2018 19:09 — forked from peternatewood/countdown-clock.html
A simple, efficient countdown clock. No jQuery required.
<!DOCTYPE html>
<html>
<head>
<title>Countdown Clock</title>
<meta charset="utf-8"/>
<style type="text/css">
#countdown-container {
display: -ms-flex;
display: -moz-flex;
display: -webkit-flex;
<?php
/**
* Render dataLayer on a WooCommerce thank you page.
* This file should be added at the end of Theme Functions (functions.php)
*
* Official Class descriptions:
* https://docs.woocommerce.com/wc-apidocs/class-WC_Abstract_Order.html
* https://docs.woocommerce.com/wc-apidocs/class-WC_Order.html
* https://docs.woocommerce.com/wc-apidocs/class-WC_Order_Item.html
* https://docs.woocommerce.com/wc-apidocs/class-WC_Abstract_Legacy_Order.html
@clayb
clayb / classes.js
Created December 8, 2016 21:10
pure javascript add class and remove class functions
var els = document.getElementsByClassName('current-class-name');
removeClass(els, 'current-class-name');
addClass(els, 'new-class-name');
var el = document.getElementById('current-class-name');
removeClass([el], 'current-class-name');
addClass([el], 'new-class-name');
function addClass(elements, className) {
for (var i = 0; i < elements.length; i++) {
[[E130:"[[S8]]" "https://secure2.edf.org/site/" "" replaceall "http://support.edf.org/site/" "" replaceall "/" "-" replaceall ".html" "" replaceall "SPageServer?" "" replaceall "PageServer?" "" replaceall "SPageNavigator?" "" replaceall "PageNavigator?" "" replaceall "Donation2?" "" replaceall "Advocacy?" "" replaceall "SSurvey?" "" replaceall "Survey?" "" replaceall "MessageViewer?" "" replaceall "?" "-" replaceall "&" "_" replaceall]]
@clayb
clayb / gist:bd51fcdc74bd857db655
Created October 30, 2014 15:51 — forked from equijada001/gist:4204524
Convio strip out $ from gift amount
[[E130:"[[S120:dc:giftAmount]]" "$" "" replaceall]]
<script type="application/ld+json">// <![CDATA[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"publisher": {
"@type": "Organization",
"name": "African Wildlife Foundation",
"url": "http://www.awf.org",
"url/googlePlus": "https://plus.google.com/+AfricanWildlifeFoundation"
},
@clayb
clayb / main.scss
Created July 23, 2014 20:58 — forked from rattlion/main.scss
Compass sprite for loop example
@import "compass";
@import "compass/reset";
@import "icon/*.png";
@include all-icon-sprites;
@import "logo/*.png";
@include all-logo-sprites;
@import "pencil/*.png";
@include all-pencil-sprites;
$('a').each(function() {
if (location.search.substr(1) !== '') {
query = location.search.substr(1);
symbol = $(this).attr('href').indexOf("?") == -1 ? '?' : '&';
$(this).attr('href', $(this).attr('href') + symbol + query);
}
});