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 resizeVideo() { | |
var videoEl = document.getElementsByTagName('video')[0]; | |
var videoOriginalWidth = 854; | |
var videoOriginalHeight = 480; | |
var videoRatio = videoOriginalWidth/videoOriginalHeight; | |
var winWidth = window.innerWidth; | |
var winHeight = window.innerHeight; | |
var videoWidth; | |
var videoHeight; | |
var videoDimensionMultiplier = 1.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 img = new Image(); | |
$(img).on('load', function(e){ | |
// Your code here | |
}).each(function() { | |
if(this.complete) $(this).load(); | |
}); | |
img.src = "http://dummyimage.com/600x400"; |
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
define( | |
[], | |
function() { | |
'use strict'; | |
var instance = null; | |
function Singie() { |
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 snippet requires PIXI and underscoreJS to work; | |
The good thing about this approach is that you don't have to manually set the number of total frames | |
used and file name references used in the animation to build up your texture data; and this technique | |
also makes it a lot easier to remove the BaseTextures from TextureCache once you no longer need them, | |
so that you can free up precious memory! | |
Use this snippet with caution, I quickly scribbled it in, so not sure if it breaks, please let me know | |
in the comments if you found it useful or found an error. Cheers! | |
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
.icon { | |
background-image: url("social-icons.png") 0 0 no-repeat; | |
} | |
/* 1.25 dpr and up - including retina devices */ | |
@media | |
(-webkit-min-device-pixel-ratio: 1.25), | |
(min-resolution: 120dpi){ | |
.icon { | |
background-image: url("social-icons@2x.png"); |
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
[ | |
{ "keys": ["super+shift+forward_slash"], "command": "toggle_comment", "args": { "block": true } } | |
] |
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 onVideoReady() { | |
video.play(); | |
} | |
/* Solution #1 | |
First check for the videos readyState, if not ready add an event | |
listener to 'canplaythrough' event | |
*/ | |
if(video.readyState < 4) { | |
video.addEventListener('canplaythrough', function() { |
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
define([ | |
'jquery', | |
'underscore', | |
'brewser' | |
], | |
function( | |
$, | |
_, | |
brewser |
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
/* Prevent overflow scroll bouncing on mac */ | |
/* http://stackoverflow.com/questions/12046315/prevent-overscrolling-of-web-page */ | |
html { | |
overflow: hidden; | |
height: 100%; | |
} | |
body { | |
height: 100%; |
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
# OS X | |
*.DS_Store | |
Icon | |
Iconr | |
Icon | |
*.log | |
# Python | |
*.pyc |
OlderNewer