Skip to content

Instantly share code, notes, and snippets.

Working from home

Chris Love docluv

Working from home
View GitHub Profile
docluv / SPA.js
Created Sep 24, 2016 — forked from simonhearne/SPA.js
Custom metric for WebPageTest to detect single page application frameworks
View SPA.js
var SPA="none";
if (typeof(app)=="object") SPA = "unknown";
if (window.hasOwnProperty('require')) {
if(window.require.defined('troopjs-compose/decorator')) SPA = "troop";
if(window.require.defined('flight/lib/component')) SPA = "flight";
View Optimize Image and upload to Azure Blob Storage Using
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
var kraken = new Kraken({
api_key: '{Your Kraken Key Goes Here}',
View Object.observe.poly.js
Migrated to:
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
docluv / gist:51ad2e57fc8a50997ee1
Created May 15, 2014
Core Site Redirect using feature detection
View gist:51ad2e57fc8a50997ee1
var ef = "?_escaped_fragment_=";
if (!('querySelector' in document)
|| !('localStorage' in window)
|| !('addEventListener' in window)
|| !('matchMedia' in window)) {
if (window.location.href.indexOf("#!") > 0) {
docluv / gist:2797a93eb6333346203a
Created May 15, 2014
MUSTACHE Template VS Code Snippet
View gist:2797a93eb6333346203a
<CodeSnippet Format="1.1.0" xmlns="">
<Title>MUSTACHE Template</Title>
<Shortcut Value="musttemp">must:temp</Shortcut>
<Description>Markup snippet for a MUSTACHE Template</Description>
View gist:3b39dfb01a2c1d132941
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0">
<Title>SPA JavaScript View</Title>
<Author>Chris Love</Author>
<Description>Creates the Base Code for a SPA JavaScript View</Description>
docluv / gist:9958620
Last active Aug 29, 2015
This is a Visual Studio code snippet to generate an extensible JavaScript module based on the 'jQuery Pattern'
View gist:9958620
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0">
<Title>Custom JavaScript Module</Title>
<Author>Chris Love</Author>
<Description>Creates the Base Code for a Stand Alone JavaScript Module</Description>
View gist:7769267
(function (window, $, undefined) {
//actual module definition here
})(window, $);
docluv / gist:6661473
Created Sep 22, 2013
Internet Explorer Meta Tags
View gist:6661473
<meta name="msapplication-allowDomainMetaTags" content="true">
<meta name="msapplication-config" content="" />
<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 / gist:6661454
Created Sep 22, 2013
Apple iOS META tags
View gist:6661454
<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">