This file contains hidden or 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> | |
<title>Page Visibility</title> | |
<meta name="viewport" content="width=device-width"> | |
<script> | |
var eventName = "visibilitychange"; | |
if (document.webkitHidden!=undefined) { | |
eventName = "webkitvisibilitychange"; | |
document.write("<h2>webkit prefix detected</h2>"); | |
} else if (document.mozHidden!=undefined) { |
This file contains hidden or 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> | |
<title>Page Visibility</title> | |
<meta name="viewport" content="width=device-width"> | |
<script> | |
// The time, in ms, that must be "missed" before we | |
// assume the app has been put to sleep. | |
var THRESHOLD = 10000; | |
var lastTick_; |
This file contains hidden or 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> | |
<title>Original title</title> | |
<meta http-equiv="refresh" content="1" id="metarefresh"> | |
<script> | |
// iPad background tab notification trick | |
var mr = document.getElementById("metarefresh"); | |
setInterval(function() { | |
mr.content=mr.content; // Shift the reload operation | |
}, parseInt(mr.content)/2); |
This file contains hidden or 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
/** | |
* Generates an image from a video at a given frame | |
* @param {object} $video - The $(video) from which to extract a frame. | |
* @param {object} $canvas - The $(canvas) target used for generating the image. | |
* @param {number} frame - The time at which the frame should be captured. | |
* @param {function} cb - A node-style callback function. | |
*/ | |
var getThumbnailAtFrame = function ($video, $canvas, frame, cb){ | |
var video, canvas; |
This file contains hidden or 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
#colorbox, | |
#colorbox *, | |
#colorbox *:before, | |
#colorbox *:after, | |
[id^="cbox"], | |
[id^="cbox"] *, | |
[id^="cbox"] *:before, | |
[id^="cbox"] *:after, { | |
@include box-sizing(content-box); | |
} |
This file contains hidden or 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 loadScript(url, callback){ | |
var script = document.createElement("script"); | |
script.type = "text/javascript"; | |
if (script.readyState){ | |
// IE | |
script.onreadystatechange = function(){ | |
if (script.readyState == "loaded" || script.readyState == "complete"){ | |
script.onreadystatechange = null; | |
callback(); |
This file contains hidden or 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
# assuming PWD == ${PROJECT_PATH}/app/bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap | |
PROJECT_PATH=~/Projects/espn/promo/disney/cheer | |
OUTPUT_PATH="${PROJECT_PATH}/app/scripts/vendor/bootstrap.js" | |
uglifyjs affix.js alert.js button.js carousel.js collapse.js dropdown.js tab.js transition.js scrollspy.js modal.js tooltip.js popover.js -o $OUTPUT_PATH |
This file contains hidden or 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 onsiteVotesByAthlete = {}; | |
votes.forEach(function (vote){ | |
if ( vote.athlete._id in onsiteVotesByAthlete ){ | |
onsiteVotesByAthlete[vote.athlete._id] += 1; | |
} else { | |
onsiteVotesByAthlete[vote.athlete._id] = 1; | |
} | |
}); |
This file contains hidden or 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
ffmpeg -i input.mp4 -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis output.webm |
This file contains hidden or 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
# -q 5 sets the desired quality. | |
ffmpeg -i input.mp4 -q 5 -pix_fmt yuv420p -acodec libvorbis -vcodec libtheora output.ogv |
OlderNewer