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
/** | |
* 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 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 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 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 () { | |
/* | |
* 斗鱼找福利 V2.3.3 | |
* 日期:2017年2月3日 | |
* 用途:让斗鱼房间页面按访问量降序排列 | |
* 需要[制作成 Chrome 书签](http://pan.baidu.com/s/1skgEosX)。 | |
*/ | |
if( window.location.host.indexOf('douyu') < 0 ){ | |
window.location.href = 'https://www.douyu.com/directory/game/LOL'; | |
} |
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
javascript: void((function() { | |
/** | |
* @file 自动点击领取宝箱 v1.5 | |
* @author 死宅程序猿 | |
* @douyu http://douyu.com/duxing | |
* @remark 苟富贵,勿相忘~ | |
* @desc 在宝箱倒计时剩余1秒时自动点击,每秒点击1000次。 需要[制作成 Chrome 书签](http://pan.baidu.com/s/1skgEosX)。 | |
*/ | |
var peck = document.querySelector('.peck-cdn'); | |
if (!peck) { |
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
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 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 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 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 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'); |
OlderNewer