Skip to content

Instantly share code, notes, and snippets.

View teodragovic's full-sized avatar

Teo Dragovic teodragovic

View GitHub Profile
// relies on Date.now() which has been supported everywhere modern for years.
// as Safari 6 doesn't have support for NavigationTiming, we use a Date.now() timestamp for relative values
// if you want values similar to what you'd get with real perf.now, place this towards the head of the page
// but in reality, you're just getting the delta between now() calls, so it's not terribly important where it's placed
(function(){
// prepare base perf object
@teodragovic
teodragovic / gist:7945309
Last active December 31, 2015 06:09 — forked from getify/gist:670840
some modifications to original script...
// JQuery /w fallback + main.js
function loadJquery(scripts,idx) {
function fallback() {
clearTimeout(timeout);
if (typeof jQuery === 'undefined') {
if (idx < scripts.length-1) loadJquery(scripts,idx+1);
} else {
//load scripts that depend on jquery or just return
$LAB.script("javascripts/main.js");
}