Skip to content

Instantly share code, notes, and snippets.

View docluv's full-sized avatar
🏠
Working from home

Chris Love docluv

🏠
Working from home
View GitHub Profile
@docluv
docluv / SPA.js
Created September 24, 2016 21:36 — forked from simonhearne/SPA.js
Custom metric for WebPageTest to detect single page application frameworks
var SPA="none";
if (typeof(app)=="object") SPA = "unknown";
if (window.hasOwnProperty('require')) {
if(window.require.hasOwnProperty('defined')){
if(window.require.defined('troopjs-compose/decorator')) SPA = "troop";
if(window.require.defined('flight/lib/component')) SPA = "flight";
}
}
var fs = require('fs'),
path = require("path"),
sizeOf = require('image-size'),
request = require('request').defaults({ proxy: process.env.HTTP_PROXY || process.env.http_proxy, jar: false }),
Kraken = require('kraken');
//If you do not have a Kraken Account visit http://bit.ly/1Vnvnmr
var kraken = new Kraken({
api_key: '{Your Kraken Key Goes Here}',
/*
Migrated to: https://github.com/jdarling/Object.observe
Tested against Chromium build with Object.observe and acts EXACTLY the same,
though Chromium build is MUCH faster
Trying to stay as close to the spec as possible,
this is a work in progress, feel free to comment/update
http://wiki.ecmascript.org/doku.php?id=harmony:observe
@docluv
docluv / gist:51ad2e57fc8a50997ee1
Created May 15, 2014 13:20
Core Site Redirect using feature detection
<script>
var ef = "?_escaped_fragment_=";
if (!('querySelector' in document)
|| !('localStorage' in window)
|| !('addEventListener' in window)
|| !('matchMedia' in window)) {
if (window.location.href.indexOf("#!") > 0) {
@docluv
docluv / gist:2797a93eb6333346203a
Created May 15, 2014 12:25
MUSTACHE Template VS Code Snippet
<CodeSnippet Format="1.1.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<Header>
<Title>MUSTACHE Template</Title>
<Author>Love2Dev</Author>
<Shortcut>musttemp</Shortcut>
<AlternativeShortcuts>
<Shortcut Value="musttemp">must:temp</Shortcut>
</AlternativeShortcuts>
<Description>Markup snippet for a MUSTACHE Template</Description>
<SnippetTypes>
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>SPA JavaScript View</Title>
<Author>Chris Love</Author>
<Description>Creates the Base Code for a SPA JavaScript View</Description>
<Shortcut>view</Shortcut>
<SnippetTypes>
@docluv
docluv / gist:9958620
Last active August 29, 2015 13:58
This is a Visual Studio code snippet to generate an extensible JavaScript module based on the 'jQuery Pattern'
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Custom JavaScript Module</Title>
<Author>Chris Love</Author>
<Description>Creates the Base Code for a Stand Alone JavaScript Module</Description>
<Shortcut>module</Shortcut>
<SnippetTypes>
@docluv
docluv / gist:7769267
Created December 3, 2013 13:40
A SEAF
(function (window, $, undefined) {
//actual module definition here
})(window, $);
@docluv
docluv / gist:6661473
Created September 22, 2013 16:19
Internet Explorer Meta Tags
<meta name="msapplication-allowDomainMetaTags" content="true">
<meta name="msapplication-config" content="http://love2dev.com/livetile.xml" />
<meta name="msapplication-navbutton-color" content="#990000">
<meta name="msapplication-TileColor" content="#000000" />
<meta name="msapplication-TileImage" content="img/love2devlogo.png" />
<meta name="msapplication-square70x70logo" content="img/tinylove2devlogo.png" />
@docluv
docluv / gist:6661454
Created September 22, 2013 16:17
Apple iOS META tags
<link href="img/h/apple-touch-icon.png" rel="apple-touch-icon-precomposed" sizes="114x114">
<link href="img/m/apple-touch-icon.png" rel="apple-touch-icon-precomposed" sizes="72x72">
<link href="img/l/apple-touch-icon-precomposed.png" rel="apple-touch-icon-precomposed">
<link href="img/l/apple-touch-icon.png" rel="shortcut icon">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<link href="img/l/splash.png" rel="apple-touch-startup-image">