Skip to content

Instantly share code, notes, and snippets.

View toddheslin's full-sized avatar

Todd Heslin toddheslin

View GitHub Profile
@toddheslin
toddheslin / ElementaryOS.md
Last active August 22, 2021 22:20
Setting up Elementary OS on my Mac

Follow this guide to setup the Mac and USB boot drive: https://www.makeuseof.com/tag/install-linux-macbook-pro/

Split newly created partition into:

  • 500 EFI FAT32 (Boot)
  • 4096 Swap EXT4 (Swap)
  • Rest as HDD EXT4 (Actual install for linux)

Get Network setup

  • Connect to Ethernet and restart
  • Go to AppCenter and let updates happen
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 February 5, 2018 03:31
Shopify Checkout Additional Scripts
<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 February 5, 2018 03:26
Shopify GA Additional Scripts
// 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 December 21, 2017 12:07
Wordpress Docker Compose
version: '3'
services:
db:
image: mariadb
volumes:
- db_data:/var/lib/mysql
restart: always
ports:
- "8081:3306"

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 August 2, 2017 02:43
Discover which custom properties have been added to the global javascript scope
(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 February 27, 2015 12:10
Advanced handling of Wufoo url query params
<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 December 22, 2016 15:27
Setting url params as variables in Wufoo embed form
/*
// 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 November 23, 2014 19:44
Setting url params as cookies for wufoo forms
// 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
|*|