Skip to content

Instantly share code, notes, and snippets.

View dawesi's full-sized avatar

Chris Dawes dawesi

View GitHub Profile
@dawesi
dawesi / Google Analytics.js Outbound Link Tracking.js
Created September 15, 2020 12:52 — forked from leighmcculloch/Google Analytics.js Outbound Link Tracking.js
This JavaScript will catch any outbound links and register them with Google Analytics before the browser loads the linked URL. This script works with Google's new analytics.js and not the older ga.js. This script ensures the attempt to register the page with Google Analytics is complete before continuing to load the next page. This capability is…
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active May 3, 2024 12:55
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@ediblecode
ediblecode / setup-site.ps1
Last active September 3, 2018 10:44
Creates a host entry, App Pool and Site in IIS and sets required permissions on the folder. Useful for local dev on a .NET app hosted within IIS.
#requires -version 5
$siteHost = "perflocal"
$siteName = "PerformanceDashboard"
$appPoolName = "PerformanceDashboard"
####################
# INSTALL AND IMPORT CARBON
if (Get-Module -ListAvailable -Name Carbon) {
@nickhough
nickhough / au-states.json
Last active October 20, 2021 19:20
JSON Australian States with Abbreviations
[
{
"name":"New South Wales",
"abbreviation":"NSW"
},
{
"name":"Victoria",
"abbreviation":"VIC"
},
{
@leighmcculloch
leighmcculloch / Google Analytics.js Outbound Link Tracking.js
Last active September 15, 2020 12:52
This JavaScript will catch any outbound links and register them with Google Analytics before the browser loads the linked URL. This script works with Google's new analytics.js and not the older ga.js. This script ensures the attempt to register the page with Google Analytics is complete before continuing to load the next page. This capability is…
@randomecho
randomecho / australian-postcodes.sql
Last active May 11, 2024 07:46
Australian postcodes (with states and suburb names) geocoded with latitude and longitude.
/*
Taken and cribbed from blog.datalicious.com/free-download-all-australian-postcodes-geocod
May contain errors where latitude and longitude are off. Use at own non-validated risk.
*/
SET NAMES utf8;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS postcodes_geo;
@mplacona
mplacona / sender.cfm
Created July 28, 2012 21:36
RabbitMQ ColdFusion "Add to queue example"
<cfscript>
QueueName = "QTransactions";
durable = true;
loadPaths = arrayNew(1);
loadPaths[1] = expandPath("lib/rabbitmq-java-client-bin-2.8.4/rabbitmq-client.jar");
// load jars
javaLoader = createObject("component", "lib.javaloader.JavaLoader").init(loadPaths);