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 getSelection() { | |
return (!!document.getSelection) ? document.getSelection() : | |
(!!window.getSelection) ? window.getSelection() : | |
document.selection.createRange().text; | |
} |
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
/* | |
src: http://jsconsole.com/?v%20%3D%204%3B%20'0'.substr(v%20%3C%2010%20%3F%200%20%3A%201)%20%2B%20v%3B | |
via @rem | |
*/ | |
v = 4; '0'.substr(v < 10 ? 0 : 1) + v; |
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 logtime = (function() { | |
var ids = {}; | |
return function(id) { | |
if (!ids[id]) { | |
ids[id] = +new Date(); | |
return; | |
} | |
var time = +new Date() - ids[id]; |
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
/* | |
* Normalized hide address bar for iOS & Android | |
* (c) Scott Jehl, scottjehl.com | |
* MIT License | |
*/ | |
(function( win ){ | |
var doc = win.document; | |
// If there's a hash, or addEventListener is undefined, stop here | |
if( !location.hash && win.addEventListener ){ |
NewerOlder