Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Chris Love docluv

🏠
Working from home
View GitHub Profile
@docluv
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.hasOwnProperty('defined')){
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 Kraken.io
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}',
View Object.observe.poly.js
/*
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
Core Site Redirect using feature detection
View gist:51ad2e57fc8a50997ee1
<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
MUSTACHE Template VS Code Snippet
View gist:2797a93eb6333346203a
<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>
View gist:3b39dfb01a2c1d132941
<?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 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"?>
<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>
View gist:7769267
(function (window, $, undefined) {
//actual module definition here
})(window, $);
@docluv
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="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 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">