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
| /** | |
| * http://www.tudou.com/plcover/ah20h1-t4V4/ | |
| * 这个 React.js 教程的视频专辑竟然没有排序! | |
| * @Sigma | |
| */ | |
| JSON.stringify([].slice.call($('h6.caption>a'),0).map(function(a){ | |
| var title = $(a).text(); | |
| var _match = title.match(/\d+\./); | |
| if( _match && _match.length ){ | |
| var index = title.match(/(\d+)\./)[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
| (function ($) { | |
| function CustomSelectHandler( selectElem, optionSelector, clickHandler){ | |
| selectElem.data('click.status', 0 ); | |
| selectElem.on('click.option', function(e){ | |
| var status = selectElem.data('click.status'); | |
| if(status == 0){ | |
| selectElem.data('click.status', 1 );// unfold | |
| }else if( status == 1){ | |
| if( selectElem.find('option:selected').is(optionSelector) ){ | |
| clickHandler && clickHandler(e); |
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 parseParam( search ){ | |
| var params = {}; | |
| if( search.length > 2 ){ | |
| if( search[0] === '?' ){ | |
| var _search = search.slice(1); | |
| var keyVals = _search.split('&'); | |
| keyVals.forEach(function(pair){ | |
| var kv = pair.split('='); | |
| if( kv.length === 2 ){ | |
| params[kv[0]] = kv[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
| Sttdecode = function(rawData) { | |
| if (rawData == "") { | |
| return false | |
| } | |
| var kvs = rawData.split("/"); | |
| var obj = {}; | |
| kvs.forEach(function ( kv ) { | |
| if (kv.indexOf("@=") > -1) { | |
| var a = kv.split("@="); | |
| obj[ de_filter_str(a[0]) ] = de_filter_str(a[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
| // 生成单片机数码管显示数字对应的针脚16进制数值 | |
| var NumCodeMap = [ | |
| // 0 | |
| ['a', 'b', 'c', 'd', 'e', 'f'], | |
| // 1 | |
| ['b', 'c'], | |
| // 2 | |
| ['a', 'b', 'd', 'e', 'g'], | |
| // 3 | |
| ['a', 'b', 'c', 'd', 'g'], |
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 isType( type ){ | |
| return function( val ){ | |
| return toString.call( val ) === '[object ' + type + ']'; | |
| }; | |
| } | |
| ['Object', 'Array', 'Number', 'Window'].forEach(function( type ){ | |
| window['is'+ type ] = isType( type ); | |
| }); |
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 universalVersion = (ver) => { | |
| var vs = ver.split('.').map((v) => Number(v)); | |
| for (var i = 4 - vs.length; i > 0; i--) { | |
| vs.push(0); | |
| } | |
| return vs; | |
| }; | |
| var versionComp = (ver1, ver2) => { | |
| var v1 = universalVersion(ver1); |
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
| #!/usr/bin/env node | |
| /** | |
| * 自动向 XX-net 中导入备份的 IP | |
| * 环境:nodejs, `npm install node-fetch -g` | |
| * 安装:将此文件放置到 files 所在目录,命名为 import-ip.js | |
| * 执行:node import-ip.js | |
| */ | |
| var fs = require('fs'); | |
| var fetch = require('node-fetch'); |
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
| javascript:void( (function(){ | |
| /** | |
| * 将页面(http://douyu.shiniv.com/)中新增的火箭信息导入斗鱼叉叉(> V2.1.0) | |
| * @usage 需要[制作成 Chrome 书签](http://pan.baidu.com/s/1skgEosX) | |
| * @version 1.0.2 | |
| * @create 2016-09-29 00:37:42 | |
| */ | |
| var msg = document.querySelector('#message'); | |
| msg.removeEventListener('DOMNodeInserted', window.__xx__fishfork__hookRocket); | |
| function getRoomId( el ){ |
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
| javascript: void((function () { | |
| /** | |
| * 熊猫找福利 V1.0.1 | |
| * 日期:2016-12-19 22:59:24 | |
| * 用途:让熊猫 TV 房间列表页面按在线人数降序排列 | |
| * 需要[制作成 Chrome 书签](http://pan.baidu.com/s/1skgEosX)。 | |
| */ | |
| if (window.location.host.indexOf('panda') < 0) { | |
| window.location.href = 'http://www.panda.tv/cate/lol'; | |
| } |
OlderNewer