Skip to content

Instantly share code, notes, and snippets.

@shermozle
shermozle / weird user-agent
Created March 25, 2013 05:13
What is this weird User-Agent?
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; IWSS25:ZjabE3sZzW3jJ9tDQU8CN8VcmuBg 8deLSK0U6F8s7Y=; IWSS25:ZjabE3sZzW3yOSB9B2ovDi8PPvafeBoEsdyHC7U8Tvs=; IWSS25:ZjabE3sZzW0Lv3bN3CgaUqaxfm6at1qvXIup5gvJi40=; IWSS25:ZjabE3sZzW3yOSB9B2ovDiMsfiyeK95i7zg9i/ r qE=; IWSS25:ZjabE3sZzW3GjMRW5YvEKeSLotEc5WCSH37IkhlrSB0=; IWSS25:ZjabE3sZzW3GjMRW5YvEKWE27Ir2W4dvFAHhMyYSkos=; IWSS25:ZjabE3sZzW1/ RNDn1o08x2hCoQoas413vhj1YrApSI=; IWSS25:ZjabE3sZzW3vz6yolbCPEwOjHwb8caW HBh4FPxKL1M=; IWSS25:ZjabE3sZzW3yOSB9B2ovDkzd73Ds2et VB8SzU2biEs=; IWSS25:ZjabE3sZzW3yOSB9B2ovDnXkL6RYI/U2huMtP0a3b38=; IWSS25:ZjabE3sZzW1/ RNDn1o08 sS0X5fzd7Np mPPOZa6IQ=; IWSS25:ZjabE3sZzW3sK9iyggyAldAfnPwJLaUbWShTRHmS/eg=; IWSS25:ZjabE3sZzW26G3aMMZUg jYhGOgX11sFkei vCBKQQ=; IWSS25:ZjabE3sZzW2cD6K/awXj2HmB/y2zBMIdTAJNRa7BDnQ=; IWSS25:ZjabE3sZzW132OcZ1cx7TN8GhxWwsqxZz/AQKTux44c=; IWSS25:ZjabE3sZzW3jJ9tDQU8CN4NvFxRFLWSEqLQJutxcrA4=; IWSS25:ZjabE3sZzW0LYxdn6DcbVK8tzg7iRWzxSP68iTefDwQ=; IWSS25:ZjabE3sZzW1F4KSJvjRDGXWPUM69lGzmDnDAHB/5TXw=;
@shermozle
shermozle / Timezone conversion in Snowplow
Created April 16, 2013 02:40
Let the database do the work of timezone conversion. Mainly because Tableau isn't great at this. This is Postgres. Timezone names from http://en.wikipedia.org/wiki/Zone.tab
"events"."collector_tstamp" AT TIME ZONE 'Australia/Sydney' AS "collector_tstamp AEST"
/*
* SuperTag v3.5.9
* http://supert.ag
*
* Copyright (c) 2016 SuperTag Pty Ltd.
*
* Date: 27-06-2016 11:29:51 +1000 (Mon, 27 Jun 2016)
*/
(function(e, t, n, r) {
n.version = 4;
dataLayer.push( {
'event' : 'share_event',
'service' : 'Facebook',
'share_action' : 'Like'
} );
dataLayer.push( {
'event' : 'user_identified'
'user_id' : 'cec805ef162d386d2ea07bf4de9821877d3e699d9a47159d630f7e1134ce1f07', // Email address trimmed of whitespace, lowercased and passed through SHA256
'age_yob' : '1975', // Year of birth
'user_gender' : 'm', // "m" or "f"
'user_location' : 'Marrickville',
'user_postcode' : '2204' // Note this is a string to account for postcodes that start with zero
} );
dataLayer.push( {
'event' : 'competition_entry',
'comp_name' : 'ACME Birthday competition'
} );

Keybase proof

I hereby claim:

  • I am shermozle on github.
  • I am shermozle (https://keybase.io/shermozle) on keybase.
  • I have a public key ASDZMIUAkOingssadeSlk1TeNDKW7kiL4Zpi1dMbNa7s1Qo

To claim this, I am signing this object:

@shermozle
shermozle / prototype-automated-analytics-testing.js
Last active July 16, 2018 03:47
Prototype showing how to use Selenium Webdriver to test web analytics. It's very rough. You need a local install of Selenium. You can download the standalone server jar which has no dependencies beyond Java: https://code.google.com/p/selenium/downloads/list
// PROXY
var url = require('url'),
http = require('http'),
colors = require('colors');
http.createServer().listen(9000).on('request', function(request, response) {
try {
var options = url.parse(request.url);
options.headers = request.headers;

Keybase proof

I hereby claim:

  • I am shermozle on github.
  • I am shermozle (https://keybase.io/shermozle) on keybase.
  • I have a public key ASCdV7bTpWuvsnUAXwuPmHJJ8oTCtVUj_hpk4-XgXcQlbwo

To claim this, I am signing this object:

! function o(n, u, s) {
function l(r, e) {
if (!u[r]) {
if (!n[r]) {
var t = "function" == typeof require && require;
if (!e && t) return t(r, !0);
if (d) return d(r, !0);
var a = new Error("Cannot find module '" + r + "'");
throw a.code = "MODULE_NOT_FOUND", a
}