Skip to content

Instantly share code, notes, and snippets.

View heathdutton's full-sized avatar
🕴️
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈

Heath Dutton ☕ heathdutton

🕴️
🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈🐈
  • ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
  • Tampa Florida
  • https://orcid.org/0009-0005-9397-422X
View GitHub Profile
@heathdutton
heathdutton / pagespeed-fix.js
Last active August 29, 2015 14:06
Simple resolution for when Google Pagespeed sharding is failing for some customers due to local DNS issues.
/*
* Fallback for Google Pagespeed sharding.
*
* Presumptions:
* Pagespeed sharding is on.
* This javascript is included at the bottom of the body (or there-abouts).
* The website in question includes jQuery on this page.
* Pagespeed is sharding the jQuery javascript (it isn't being loaded externally).
* If the user cannot get one of the shard subdomains, they cannot get them all.
*
@heathdutton
heathdutton / gist:943b59be9f3844a202c6
Last active August 29, 2015 14:07
Limit schools based on a state field in Hubspot.
if (typeof jQuery == 'undefined'){
console.log('Filterizer: Cannot be ran. jQuery is not loaded yet.');
} else {
(function($) {
$(document).ready(function(){
var attempt_time = 10, // amount of time to keep trying in seconds
interval_ms = 150, // how frequently to attempt in ms
elapsed_time = 0, // elapsed time in ms
interval = setInterval(function(){
elapsed_time += interval_ms;
@heathdutton
heathdutton / 50_purge_varnish.sh
Last active April 30, 2019 14:00
Acquia Cloud hook for flushing Varnish .com domains securely.
#!/bin/bash
#
# Cloud Hooks: code-deploy, code-update, db-copy, web-activate
# Essentially any time code or db changes are made.
#
# Purges Varnish cache for all .com domains assigned to the environment in Acquia Cloud.
site="$1"
target_env="$2"
drush_alias=$site'.'$target_env
@heathdutton
heathdutton / gist:cc29284de3934706acd1
Created April 26, 2015 03:19
Start an Acquia drush command, and wait for it to complete before continuing.
#!/bin/bash
# Runs an acquia task, and waits for the task to complete before continuing.
# This is a helper script, to be used in others as needed.
if [[ $1 = "" ]] || [[ $2 = "" ]]
then
echo "Runs an acquia drush command, waiting for the results before continuing."
echo "Can be used as a replacement for drush."
echo
echo " Usage: $0 <site-alias> <ac-drush-command>"
@heathdutton
heathdutton / gist:67148cddf2af3c56216d
Created June 18, 2015 22:23
jQuery 1.7.1 with two addressfields
Uncaught TypeError: Cannot read property 'fields' of undefined
$.fn.addressfield.apply
(anonymous function)
f.event.dispatch
f.event.add.h.handle.i
f.event.trigger
(anonymous function)
e.extend.each
e.fn.e.each
f.fn.extend.trigger
@heathdutton
heathdutton / outbound_links.js
Last active September 9, 2015 15:11
Catch outbound links in Google Analytics
@heathdutton
heathdutton / logs
Created November 3, 2015 20:05
Get Acquia enterprise logs from a quick command line shell
#!/bin/bash
# Retrieves past and present logs for a site in Acquia Enterprise
# Put this in your /usr/local/bin folder and chmod it 0755
# Then you can search/view logs quickly from any terminal
if [ "$1" = "" ] || [ "$2" = "" ]
then
echo "Retrieves past and present logs for a site in Acquia Enterprise"
echo "Usage: $0 <site-alias> <site-environment>"
echo "Example: $0 qrk test"
@heathdutton
heathdutton / linkedin_auto_connect.js
Last active November 9, 2016 02:38
Apparently, JavaScript CAN make you new friends.
/**
* Linkedin auto-connect thingy.
*
* Step 1) Log in to Linkedin and go to https://www.linkedin.com/people/pymk
* (This is the "People You May Know page")
* Step 2) Open your browser console and run this javascript.
*/
(function($) {
var processedCards = [];
var lih = function(){
@heathdutton
heathdutton / iterm-material-oh-my-fish.sh
Created February 22, 2017 20:28
Install iTerm2, Material, Menlo, Fish, Oh-my-fish, and Agnoster.
#!/usr/bin/env bash
# Installs:
# Iterm2
# Powerline fonts (for Menlo)
# Material Design (color scheme)
# Fish
# Oh-my-fish
# Agnoster theme (works well with Material)
@heathdutton
heathdutton / cf_cloud_all.sh
Created July 26, 2017 18:44
Enable Cloudflare on all CNAME records.
#! /bin/bash
cf_user=<inset your email address here>
cf_token=<inset your api token here>
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
if [ -z $1 ]