This file contains 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
<snippet> | |
<content><![CDATA[ | |
/* ========================================================================== | |
${1:Section comment block} | |
========================================================================== */ | |
${2} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>/*=</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> |
This file contains 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 performance = { | |
map: {}, | |
start: function(key) { | |
this.map[key] = {}; | |
this.map[key].start = Date.now(); | |
}, | |
end: function(key) { | |
this.map[key].end = Date.now(); | |
}, | |
display: function(key) { |
This file contains 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
// params is serialized object | |
params.replace(/%5B([a-zA-Z]+)%5D/g, '.$1'); |
This file contains 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 analyze = function() { | |
var scriptData, | |
strings, | |
occurances; | |
/* | |
* Analyze a single script to determine | |
* how often a string is used. | |
* s: html script object. |
This file contains 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 hashUrl = window.location.hash; | |
if(hashUrl !== '') { | |
var url = hashUrl.replace('#',''); // remove # | |
var redirectUrl = window.location.protocol+'//'+window.location.host; | |
var path = window.location.pathname; | |
url = url.split('_suid')[0]; // remove everything after this | |
// if there are no vars, remove the ?& | |
if(url.indexOf('?') <= (url.length+2)) { |
This file contains 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
#bg-overlay { | |
position: absolute; | |
top: 0; | |
height: 100%; | |
width: 100%; | |
background-color: #444; /* What ever you want to the default background to look like before the image is displayed */ | |
z-index: -1; | |
} | |
.bg-img { | |
background-image: url('http://www.location/of/really/big/image.jpg'); |
This file contains 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 numf=0; var nump=0; | |
for(var p in this) { | |
if(typeof(this[p]) == "function" && this[p].toString().indexOf('[native code]') === -1 ){ | |
numf+=1; | |
console.log(p+"()"); | |
} else if(typeof this[p] != 'undefined' && this[p] && this[p].toString().indexOf('[native code]') === -1){ | |
var cont = false; | |
if(typeof this[p] === 'object') { | |
for(op in this[p]) { | |
if(p[op] && p[op].toString().indexOf('[native code]') === -1){ |
This file contains 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 perf(fo) { | |
var results = []; | |
// perform test | |
for(key in fo) { | |
var f = fo[key]; | |
var start = new Date().getTime(); | |
for(var j=0;j<10000;j++) { | |
f(); | |
} | |
var end = new Date().getTime(); |