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
#!/bin/bash | |
# Function to display usage information | |
usage() { | |
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]" | |
exit 1 | |
} | |
# Check if at least one argument (input file) is provided | |
if [ $# -lt 1 ]; then |
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
class Component { | |
static utils = { | |
log() { | |
} | |
} | |
static DEFAULTS = { | |
} | |
static Extension = { |
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
/** | |
* @desc OLOO(Objects linked to other objects) style delegation | |
* @see 《You Don't Know JS》 Chapter 6 | |
*/ | |
const Widget = { | |
width: 50, | |
height: 50, | |
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
/** | |
* @desc EventTarget | |
* @see 《JavaScript高级程序设计(第3版)》 p616 | |
*/ | |
function EventTarget(){ | |
this.handlers = {}; | |
} | |
EventTarget.prototype = { |
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
/** | |
* @desc Module Loader | |
* @see http://leechan.me/?p=1241 | |
*/ | |
;(function(global){ | |
var mapping = {}, cached = {}; | |
global.define = function(id, func){ | |
mapping[id] = func; | |
}; |
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() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { | |
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; | |
window.cancelRequestAnimationFrame = window[vendors[x]+ | |
'CancelRequestAnimationFrame']; | |
} |
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
/** | |
* @desc CSS 判断浏览器 | |
*/ | |
/* Target IE 10 */ | |
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { | |
p { | |
color: red; | |
} | |
} |
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
<header> | |
</header> <!-- / header --> | |
<div id="wrapper"> | |
</div> <!-- / #wrapper --> | |
<div class="module"> | |
</div> <!-- / .module --> |
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
/** | |
* @desc Media Queries Breakpoints | |
* @see http://getbootstrap.com/css/#grid | |
*/ | |
/* Extra small devices (phones, up to 480px) */ | |
/* No media query since this is the default. */ | |
/* Small devices (tablets, 768px and up) */ | |
@media (min-width: 768px) { ... } |
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
<script id="lazy"> | |
// Make sure you strip out (or replace) comment blocks in your JavaScript first. | |
/* JavaScript of lazy module */ | |
</script> | |
<script> | |
function lazyLoad() { | |
var lazyElement = document.getElementById('lazy'); | |
var lazyElementBody = lazyElement.innerHTML; | |
var jsCode = stripOutCommentBlock(lazyElementBody); | |
eval(jsCode); |
NewerOlder