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
<!-- | |
________ _______ ______ ________ ___ ___ | |
|__ __| /\ | _ \| _ \ |__ __|\ \ / / | |
| | / \ | |_| | |_| | | | \ \/ / | |
| | / \ | ___/| ___/ | | \ / | |
| | / /\ \ | | | | | | \ / | |
|__|/__/ \__\|__| |__| |__| \/ | |
--> |
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
/** | |
* The Page Visibility API adds two new properties to the document object. | |
* | |
* document.hidden | |
* document.visibilityState | |
* | |
* The hidden property is a boolean representing the current visibility of the page. | |
* | |
* The visibilityState property is a string that gives more information about the current page state. This property has four possible values: | |
* |
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
// Most common | |
<script type="text/javascript"> | |
if (top != self) top.location.replace(location); | |
</script> | |
// Modern Framekiller | |
// http://seclab.stanford.edu/websec/framebusting/framebust.pdf | |
<style> html{display:none;} </style> | |
<script> | |
if (self == top) { |
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
// jQuery's each method | |
// https://github.com/jquery/jquery/blob/master/src/core.js#L279 | |
function each(obj, callback, args) { | |
var value, | |
i = 0, | |
length = obj.length, | |
isArray = isArraylike(obj); | |
if (args) { | |
if (isArray) { |
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 $template = $([ | |
'<div class="tappification tappification-dismissible" data-position="" role="alert">', | |
' <div class="container">', | |
' <div class="tappification-icon">', | |
' <i class="fa"></i>', | |
' </div>', | |
' <div class="tappification-message"></div>', | |
' <div class="tappification-link">', | |
' <a class="primary"></a>', | |
' </div>', |
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
// http://designpepper.com/blog/drips/using-dispatch-tables-to-avoid-conditionals-in-javascript | |
// avoid this, switch blah | |
function processUserInput(command) { | |
switch (command) { | |
case "north": | |
movePlayer("north"); | |
break; | |
case "east": | |
movePlayer("east"); |
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
// ------------------------------------------------------ | |
// set background image to fixed | |
parallax-bg { | |
background-image: url('...'); | |
background-size: cover; | |
background-attachment: fixed; | |
} | |
// ------------------------------------------------------ | |
// set whole container fixed or absolute and allow other content to go over it |
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
/** | |
* Paul Irish on RequestAnimFrame | |
* | |
* http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
*/ | |
// shim layer with setTimeout fallback | |
window.requestAnimFrame = (function(){ | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || |
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
Just go to this path delete all the files. Sublime will start working fresh. | |
cd ~/.config/sublime-text-3/Local | |
rm * |
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 transforms = ["transform", | |
"msTransform", | |
"webkitTransform", | |
"mozTransform", | |
"oTransform" | |
]; | |
var transformProperty = getSupportedPropertyName(transforms); | |
var imageContainer = document.querySelector(".featured__image"); |