移植自 Dant 的 FlvPatcher [http://danknest.org]
> https://github.com/dantmnf/FlvPatcher/blob/master/blacker.sh
于 Linux Mint 16 下测试通过。
sudo apt-get install libav-tools ffmsindex mkvtoolnix mediainfo nodejs && npm install sequence
移植自 Dant 的 FlvPatcher [http://danknest.org]
> https://github.com/dantmnf/FlvPatcher/blob/master/blacker.sh
于 Linux Mint 16 下测试通过。
sudo apt-get install libav-tools ffmsindex mkvtoolnix mediainfo nodejs && npm install sequence
| // Better interval | |
| var betterInterval = function (foo, timeout) { | |
| for (var i=2, extraArgs=[], that=this; i<arguments.length; i++) | |
| extraArgs.push (arguments[i]); | |
| var fooNext = function () { | |
| var args = extraArgs.slice(); | |
| args.splice(0, 0, fooNext); | |
| for (var i=0; i<arguments.length; i++) | |
| args.push (arguments[i]); |
| var IntervalLoop = function (arrData, looper, delay) { | |
| if (!(this instanceof IntervalLoop)) | |
| return new IntervalLoop (arrData, looper, delay); | |
| /** | |
| * Status | |
| * @type Number | |
| * 0: 循环未开始 | |
| * 1: 正在循环 | |
| * 2: 循环结束 |
| /** | |
| * ClassHooker | |
| * Hook original JavaScript class. | |
| */ | |
| var origionalClass = function (z, y) { | |
| console.group('Debug: origionalClass'); | |
| console.log ('arguments:'); | |
| console.log (arguments); | |
| this.arg1 = z; |
| // 清空之前的 timeout, 如果尚未执行 | |
| (function () { | |
| for (var i = setTimeout(function () {}, 0); --i; ) | |
| clearTimeout (i); | |
| }); | |
| // 添加到脚本声明可「强行启用旧版沙盒」模式,感谢 @坐怀则乱 指正。 | |
| // @grant unsafeWindow |
| var 中文 = (function () { | |
| var _ = window; | |
| _.真 = true; | |
| _.假 = false; | |
| [{ | |
| 源: document, | |
| 中文: '文档', | |
| 映射: { | |
| createTextNode: '创建文本节点', |
| /* | |
| Usage: | |
| node fixName.js | |
| --dir Dir to search, or `pwd` | |
| --rule Custom Search RegExp Rule | |
| --mod RegExp Modifier, default to i; | |
| --replace What to replace? | |
| --doRename Comfirm to rename | |
| */ | |
| var fs = require ('fs'), |
| // 网易音乐 NEJ 内核 | |
| (function() { | |
| window.NEJ = window.NEJ || {}; | |
| NEJ.O = {}; | |
| NEJ.R = []; | |
| NEJ.F = NEJ.emptyFunction = function() { | |
| return false; | |
| }; |
| (function (window, location, document) { | |
| if (!window.history || (location.hash && location.hash[1] != '#')) | |
| return ; | |
| var np = 'hitokoto_' + + new Date; | |
| window[np] = function (hitokoto) { | |
| history.replaceState(null, null, '##' + hitokoto.hitokoto + ' <-- ' + hitokoto.source); | |
| }; | |
| var keepUpdate = function () { |
| (function (str) { | |
| // 过滤注释 | |
| console.info (str.split('\n') | |
| .filter(function (s) { return ! /^\s*\/\//.test(s); }) | |
| .join('\n')); | |
| // 空行也会保留 | |
| })(require('fs').readFileSync(__filename).toString()) |