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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- prevent Internet Explorer from using compatibility mode --> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
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
/* add the .peel-br or .peel-tr class to a link and wrap its contents with a span */ | |
/* example: | |
<a class="peel-br" href="javascript:;"><span>My bookmarklet</span></a> | |
*/ | |
a.peel-br, a.peel-tr { | |
position:relative; | |
z-index:0; | |
} |
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 createFunctionWithTimeout(callback, opt_timeout){ | |
var called, timer; | |
//if the function *isn't* called within the timeout, execute callback() anyway | |
timer = setTimeout(function (){ | |
called = true; | |
callback(); | |
}, opt_timeout || 1000); | |
//if the function *is* called within the timeout, cancel the timer and execute callback() |
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 cloneEventObj(eventObj, overrides){ | |
var p, eventInit = {}, clone; | |
overrides = overrides || {}; | |
for(p in eventObj){ | |
eventInit[p] = eventObj[p]; | |
} | |
for(p in overrides){ | |
eventInit[p] = overrides[p]; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Ellipsis Box</title> | |
<style> |
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
/* <div class="ratio-box"><div class="ratio-content">content</div></div> */ | |
.ratio-box { | |
position:relative; | |
width:100%; /*set the width here*/ | |
} | |
.ratio-box::before { | |
content:""; | |
display:block; | |
padding-top:75%; /*4:3 ratio*/ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Go To Line/Character</title> | |
</head> |
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 removeClass(elem){ | |
var classes, rxp; | |
if(!elem){ | |
throw new Error("Missing parameter: elem"); | |
} | |
classes = Array.prototype.slice.call(arguments, 1).join(" ").trim(); | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- to prevent IE from using compatibility mode --> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta charset="UTF-8"> | |