Update.
This commit is contained in:
parent
3022606545
commit
0afa45b3c2
|
@ -36,6 +36,7 @@ layout: default
|
||||||
|
|
||||||
ffmpeg -i input.mov -vcodec h264 -acodec aac -strict -2 output.mp4
|
ffmpeg -i input.mov -vcodec h264 -acodec aac -strict -2 output.mp4
|
||||||
ffmpeg -i input.mov -vcodec libvpx -acodec libvorbis output.webm
|
ffmpeg -i input.mov -vcodec libvpx -acodec libvorbis output.webm
|
||||||
|
# -acodec null
|
||||||
|
|
||||||
<video width="320" height="240" controls>
|
<video width="320" height="240" controls>
|
||||||
<source src="movie.mp4"></source>
|
<source src="movie.mp4"></source>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
---
|
||||||
|
title: applicationCache
|
||||||
|
layout: default
|
||||||
|
---
|
||||||
|
|
||||||
|
### applicationCache checking
|
||||||
|
|
||||||
|
if (window.applicationCache){
|
||||||
|
// "Naturally" reload when an update is available
|
||||||
|
var reload = false;
|
||||||
|
window.applicationCache.addEventListener('updateready', function(){
|
||||||
|
if (window.applicationCache.status == window.applicationCache.UPDATEREADY){
|
||||||
|
window.applicationCache.swapCache();
|
||||||
|
reload = true;
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
|
||||||
|
setInterval(function(){
|
||||||
|
try { // There's nothing to update for first-time load, browser freaks out :/
|
||||||
|
window.applicationCache.update();
|
||||||
|
} catch (e){}
|
||||||
|
}, 1000*60*60); // Every hour
|
||||||
|
}
|
||||||
|
|
||||||
|
### Reference
|
||||||
|
|
||||||
|
* https://developer.mozilla.org/en-US/docs/HTML/Using_the_application_cache
|
|
@ -1,28 +1,27 @@
|
||||||
---
|
---
|
||||||
title: Setting up jscoverage
|
title: jscoverage
|
||||||
layout: default
|
layout: default
|
||||||
---
|
---
|
||||||
|
|
||||||
### Install
|
### Install
|
||||||
|
|
||||||
npm i --save-dev jscoverage
|
npm install --save-dev jscoverage
|
||||||
|
|
||||||
|
### Ignore output
|
||||||
|
|
||||||
|
echo coverage.html >> .gitignore
|
||||||
|
|
||||||
### package.json
|
### package.json
|
||||||
|
|
||||||
Set up the `coverage` task so you can do `npm run coverage` later.
|
The `coverage` task injects your source files (`lib`) with jscoverage hooks, runs `mocha -R html-cov`, then restores later.
|
||||||
|
|
||||||
"coverage": "./node_modules/.bin/jscoverage YOURFILE.js && env COVERAGE=true ./node_modules/.bin/mocha -R html-cov > coverage.html; rm YOURFILE-cov.js",
|
"coverage": "./node_modules/.bin/jscoverage lib && (mv lib lib~; mv lib-cov lib; ./node_modules/.bin/mocha -R html-cov > coverage.html; mv -f lib~ lib)"
|
||||||
|
|
||||||
### test/setup.js
|
|
||||||
|
|
||||||
Instead of requiring `YOURFILE.js`, use `-cov.js` when it's necessary. It's
|
|
||||||
preferred to do this in the test files (rather than the main entry points) so
|
|
||||||
not to mess with browserify.
|
|
||||||
|
|
||||||
var cov = (!! process.env.COVERAGE);
|
|
||||||
global.Mylib = require(cov ? 'mylib' : 'mylib-cov');
|
|
||||||
|
|
||||||
### Run
|
### Run
|
||||||
|
|
||||||
npm run coverage
|
npm run coverage
|
||||||
open coverage.html
|
open coverage.html
|
||||||
|
|
||||||
|
### Caveats
|
||||||
|
|
||||||
|
If you're using jsdom, be sure to expose the `window._$jscoverage` variable into the `global` scope.
|
||||||
|
|
31
jshint.md
31
jshint.md
|
@ -5,8 +5,35 @@ layout: default
|
||||||
|
|
||||||
### Relaxing
|
### Relaxing
|
||||||
|
|
||||||
// expr: true
|
/* expr: true */
|
||||||
production && a = b;
|
production && minify = true;
|
||||||
|
|
||||||
|
/* loopfunc: true */
|
||||||
|
for (i=0; i<10; x++) {
|
||||||
|
(function(i) {
|
||||||
|
})(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* sub: true */
|
||||||
|
process.env['name_here'];
|
||||||
|
|
||||||
|
### Enforcement
|
||||||
|
|
||||||
|
/* es3: true (legacy IE compatibility) */
|
||||||
|
a.default = function() { ... };
|
||||||
|
array = [ 1, 2, 3, ];
|
||||||
|
|
||||||
|
### Environments
|
||||||
|
|
||||||
|
browser /* window, document, ... */
|
||||||
|
node /* module, exports, console, process, ... */
|
||||||
|
jquery /* jQuery, $ */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Also see
|
||||||
|
|
||||||
|
* www.jshint.com/docs/options/
|
||||||
|
* https://gist.github.com/haschek/2595796
|
||||||
|
|
||||||
|
|
2
sh.md
2
sh.md
|
@ -171,7 +171,7 @@ Misc crap
|
||||||
set -o nullglob # Non-matching globs are removed ('*.foo' => '')
|
set -o nullglob # Non-matching globs are removed ('*.foo' => '')
|
||||||
set -o failglob # Non-matching globs throw errors
|
set -o failglob # Non-matching globs throw errors
|
||||||
set -o nocaseglob # Case insensitive globs
|
set -o nocaseglob # Case insensitive globs
|
||||||
set -o dotglob # Wildcards match dotfiles ("*.sh" => ".foo.sh")
|
set -o globdots # Wildcards match dotfiles ("*.sh" => ".foo.sh")
|
||||||
set -o globstar # Allow ** for recursive matches ('lib/**/*.rb' => 'lib/a/b/c.rb')
|
set -o globstar # Allow ** for recursive matches ('lib/**/*.rb' => 'lib/a/b/c.rb')
|
||||||
|
|
||||||
set GLOBIGNORE as a colon-separated list of patterns to be removed from glob
|
set GLOBIGNORE as a colon-separated list of patterns to be removed from glob
|
||||||
|
|
23
webpack.md
23
webpack.md
|
@ -21,4 +21,27 @@ layout: default
|
||||||
filename: '[name].js'
|
filename: '[name].js'
|
||||||
/* also: [id] [hash] */
|
/* also: [id] [hash] */
|
||||||
chunkFilename: "[id].chunk.js"
|
chunkFilename: "[id].chunk.js"
|
||||||
|
|
||||||
|
libraryTarget: 'var' | 'this' | 'commonjs' | 'commonjs2' | 'amd' | 'umd'
|
||||||
|
}
|
||||||
|
|
||||||
|
### Module
|
||||||
|
|
||||||
|
module: {
|
||||||
|
loaders: [ ... ]
|
||||||
|
preLoaders: [ ... ]
|
||||||
|
postLoaders: [ ... ]
|
||||||
|
}
|
||||||
|
|
||||||
|
### Resolve
|
||||||
|
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'xyz': './foo.js'
|
||||||
|
}
|
||||||
|
modulesDirectories: [
|
||||||
|
'node_modules',
|
||||||
|
'web_modules' ]
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue