This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if IEMobile 7 ]> <html dir="ltr" lang="en-US"class="no-js iem7"> <![endif]--> | |
<!--[if lt IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie6 lt-ie7 lt-ie8 lt-ie9 lt-ie10"> <![endif]--> | |
<!--[if IE 7 ]> <html dir="ltr" lang="en-US" class="no-js ie7 lt-ie8 lt-ie9 lt-ie10"> <![endif]--> | |
<!--[if IE 8 ]> <html dir="ltr" lang="en-US" class="no-js ie8 lt-ie9 lt-ie10"> <![endif]--> | |
<!--[if IE 9 ]> <html dir="ltr" lang="en-US" class="no-js ie9 lt-ie10"> <![endif]--> | |
<!--[if IE 10 ]> <html dir="ltr" lang="en-US" class="no-js ie10"> <![endif]--> | |
<!--[if (gte IE 9)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html dir="ltr" lang="en-US" class="no-js"><!--<![endif]--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var i = 0, j = $elements.length; i < j; i++) { | |
element = elements[i]; | |
// Bind events, do whatever here | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getPrevious(n, className) { | |
var y = n.previousSibling; | |
// Check if previous node is an element node with a specific class | |
while (y.nodeType != 1 || !y.classList.contains(className)) { | |
// If not, move on to previous node | |
y = y.previousSibling; | |
} | |
return y; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration> | |
<system.webServer> | |
<handlers> | |
<add name="Browser Link for HTML" path="*.html" verb="*" | |
type="System.Web.StaticFileHandler, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" | |
resourceType="File" preCondition="integratedMode" /> | |
</handlers> | |
</system.webServer> | |
</configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createGlobalVar(varName, varValue) { | |
this[varName] = varValue; | |
} | |
createGlobalVar('generatedVar', 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://jsperf.com/another-memoization-comparison | |
// underscore.js memoize | |
function memoize1(func) { | |
"use strict"; | |
var memo = {}; | |
var slice = Array.prototype.slice; | |
return function() { | |
var key = "" + slice.call(arguments); | |
return (key in memo) ? memo[key] : (memo[key] = func.apply(this, arguments)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var source = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gKgSUNDX1BST0ZJTEUAAQEAAAKQbGNtcwQwAABtbnRyUkdCIFhZWiAH3QAJABoAEgAKADFhY3NwQVBQTAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLWxjbXMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAtkZXNjAAABCAAAADhjcHJ0AAABQAAAAE53dHB0AAABkAAAABRjaGFkAAABpAAAACxyWFlaAAAB0AAAABRiWFlaAAAB5AAAABRnWFlaAAAB+AAAABRyVFJDAAACDAAAACBnVFJDAAACLAAAACBiVFJDAAACTAAAACBjaHJtAAACbAAAACRtbHVjAAAAAAAAAAEAAAAMZW5VUwAAABwAAAAcAHMAUgBHAEIAIABiAHUAaQBsAHQALQBpAG4AAG1sdWMAAAAAAAAAAQAAAAxlblVTAAAAMgAAABwATgBvACAAYwBvAHAAeQByAGkAZwBoAHQALAAgAHUAcwBlACAAZgByAGUAZQBsAHkAAAAAWFlaIAAAAAAAAPbWAAEAAAAA0y1zZjMyAAAAAAABDEoAAAXj///zKgAAB5sAAP2H///7ov///aMAAAPYAADAlFhZWiAAAAAAAABvlAAAOO4AAAOQWFlaIAAAAAAAACSdAAAPgwAAtr5YWVogAAAAAAAAYqUAALeQAAAY3nBhcmEAAAAAAAMAAAACZmYAAPKnAAANWQAAE9AAAApbcGFyYQAAAAAAAwAAAAJmZgAA8qcAAA1ZAAAT0AAACltwYXJhAAAAAAADAAAAAmZmAADypwAADVkAABPQAAAKW2Nocm0AAAAAAAMAAAAAo9cAAFR7AABMzQAAmZoAACZmAAAPXP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8RERMWHBcTFBo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[568,115,847,670,604,979,796,283,761,73,741,525,806,671,842,25,372,368,922,198,8,266,278,122,660,656,822,271,911,409,176,79,848,813,741,155,770,34,3,506,12,865,624,397,758,273,6,992,745,948,496,876,628,924,922,546,634,506,660,265,413,490,506,735,866,622,708,957,223,58,325,975,128,682,146,872,594,569,258,639,207,665,67,107,392,93,206,207,660,364,701,875,234,172,585,262,743,200,416,794] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From Tom Gruner @ http://stackoverflow.com/a/12034334/1660815 | |
var entityMap = { | |
"&": "&", | |
"<": "<", | |
">": ">", | |
'"': '"', | |
"'": ''', | |
"/": '/' | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var entityMap = { | |
"{{": "<span>{{</span>", | |
"}}": "<span>}}</span>" | |
}; | |
function escapeCurlyBrackets(source: string) { | |
return String(source).replace(/{{|}}/g, s => entityMap[s]); | |
} |