Skip to content

Instantly share code, notes, and snippets.

View saterus's full-sized avatar

Alex Burkhart saterus

View GitHub Profile
@nateberkopec
nateberkopec / 0.result.md
Last active January 18, 2024 11:20 — forked from tomfuertes/0.result.md
De-'Async Inject'ing Universal Analytics

De-'Async Inject' Universal Analytics

This gist applies the theory from Ilya Grigorik's Script-injected "async scripts" considered harmful on the default Universal Analytics snippet. TLDR place this above the CSS in the <head> of your document

<!-- Google Analytics Part 1: Creates window.ga, sets account, and queues pageview-->
<script>
  !function(n,t){n.GoogleAnalyticsObject=t,n[t]=n[t]||function(){(n[t].q=n[t].q||[]).push(arguments)},n[t].l=1*new Date}(window,"ga");
  ga('create', 'UA-XXXX-Y', 'auto'); // REPLACE UA-XXXX-Y w/ YOUR ACCOUNT
 ga('send', 'pageview');
@skord
skord / random_name_helper.rb
Last active May 18, 2016 16:29
Approved Random Name Generator
module RandomNameHelper
def generate_name(seperator = '_')
rnd = Random.rand(64)
"#{adjectives.sample}#{seperator}#{nouns.sample}#{seperator}#{rnd}"
end
private
def adjectives
[