Skip to content

Instantly share code, notes, and snippets.

Avatar

Todd Heslin toddheslin

View GitHub Profile
View australian_states.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@toddheslin
toddheslin / shopifyAdditionalScripts.html
Created Feb 5, 2018
Shopify Checkout Additional Scripts
View shopifyAdditionalScripts.html
<script>
window.dataLayer = window.dataLayer || [];
function _ready(fn) {
if (document.readyState != 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
_ready(function() {
@toddheslin
toddheslin / additionalScripts.js
Created Feb 5, 2018
Shopify GA Additional Scripts
View additionalScripts.js
// Our custom GA additional scripts module
var additionalGA = {
host: window.location.hostname,
path: window.location.pathname.split('/'),
init: function() {
var isCheckout = this.isCheckout();
isCheckout ? this.loadSegment() : null;
//isCheckout ? null : this.ready(this.gaLinker);
},
isCheckout: function(){
@toddheslin
toddheslin / docker-compose.yml
Last active Dec 21, 2017
Wordpress Docker Compose
View docker-compose.yml
version: '3'
services:
db:
image: mariadb
volumes:
- db_data:/var/lib/mysql
restart: always
ports:
- "8081:3306"
View keybase.md

Keybase proof

I hereby claim:

  • I am toddheslin on github.
  • I am toddheslin (https://keybase.io/toddheslin) on keybase.
  • I have a public key ASAdXH-pml-gSwn1oTdKeugGf1ZYqCPdO_e3EZ2YZLsAvQo

To claim this, I am signing this object:

@toddheslin
toddheslin / find-unique-keys.js
Last active Aug 2, 2017
Discover which custom properties have been added to the global javascript scope
View find-unique-keys.js
(function() {
// Taken from Chrome. Can update this with your own browser/version by running Object.keys(window) on an empty HTML document
var vanilla = ["stop","open","alert","confirm","prompt","print","requestAnimationFrame","cancelAnimationFrame","requestIdleCallback","cancelIdleCallback","captureEvents","releaseEvents","getComputedStyle","matchMedia","moveTo","moveBy","resizeTo","resizeBy","getSelection","find","getMatchedCSSRules","webkitRequestAnimationFrame","webkitCancelAnimationFrame","btoa","atob","setTimeout","clearTimeout","setInterval","clearInterval","createImageBitmap","scroll","scrollTo","scrollBy","postMessage","fetch","blur","focus","close","webkitRequestFileSystem","webkitResolveLocalFileSystemURL","openDatabase","chrome","console","arr","frames","self","window","parent","opener","top","length","closed","location","document","origin","name","history","locationbar","menubar","personalbar","scrollbars","statusbar","toolbar","status","frameElement","navigator","applicationCache","external","sc
@toddheslin
toddheslin / gist:41d54f115f495efb29e9
Created Feb 27, 2015
Advanced handling of Wufoo url query params
View gist:41d54f115f495efb29e9
<div id="wufoo-m2oq9xw0yusu89"></div>
<script type="text/javascript">
var QueryString = function () {
/*
This function is anonymous, is executed immediately and
the return value is assigned to the variable 'QueryString'
*/
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
@toddheslin
toddheslin / wufooUrlParams.js
Last active Dec 22, 2016
Setting url params as variables in Wufoo embed form
View wufooUrlParams.js
/*
// The following code is from @dorward answering a stackoverflow question.
// Like the Wufoo embed, it doesn't rely on jQuery. Thanks @dorward!
*/
<div id="wufoo-m2oq9xw0yusu89"></div>
<script type="text/javascript">
var QueryString = function () {
/*
This function is anonymous, is executed immediately and
@toddheslin
toddheslin / wufooCookies.js
Created Nov 23, 2014
Setting url params as cookies for wufoo forms
View wufooCookies.js
// Requires cookies.js to be loaded globally, or added as part of the Wufoo script. Added here as part of script for convinence.
<script>
/*\
|*|
|*| :: cookies.js ::
|*|
|*| A complete cookies reader/writer framework with full unicode support.
|*|
|*| Revision #1 - September 4, 2014
|*|