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
// ==UserScript== | |
// @name auto-run-script-for-every-task | |
// @namespace https://x181.cn/ | |
// @version 0.35.16 | |
// @author TT | |
// @description Hello world! | |
// @icon https://img.artproglobal.com/c/21736720685ad57d4fb8362b70f62f8d?width=512&height=512&hTag=d7a495871ba01409369e6c2231ad49f0 | |
// @homepage https://x181.cn | |
// @downloadURL https://gist.github.com/zhanhongtao/198e58075d4b3415c2f0f5e394204c6a/raw/task.user.js | |
// @updateURL https://gist.github.com/zhanhongtao/198e58075d4b3415c2f0f5e394204c6a/raw/task.user.js |
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
/* | |
参考: | |
https://saisumit.wordpress.com/2016/01/26/suffix-automaton/ | |
https://ksmeow.moe/suffix_automaton/ | |
https://www.cnblogs.com/meowww/p/6394960.html | |
https://codeforces.com/blog/entry/20861 | |
https://yeah.moe/p/a8e74947/ | |
*/ | |
// prefix |
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 TreeNode(val) { | |
this.val = val | |
this.left = this.right = null | |
} | |
module.exports = function list2tree(list) { | |
let tree = null | |
let length = list.length | |
let padding = 0 | |
let nodes = [] |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>cross</title> | |
</head> | |
<body> | |
<script> |
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
// ==UserScript== | |
// @name x181-fixed-zhihu-rewrite | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author tt | |
// @match https://*.zhihu.com/* | |
// @match https://www.google.com/* | |
// @match https://www.google.com.hk/* | |
// @match https://www.so.com/* |
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 walk(root, handle) { | |
if (!root) return; | |
if (root.nodeType !=1 && root.nodeType != 11) return; | |
for (var node = root.firstChild; node; node = node.nextSibling) { | |
walk(node, handle); | |
handle(node); | |
} | |
} |
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(root, factory) { | |
if(typeof define === 'function' && define.amd) { | |
define([], factory); | |
} else if(typeof exports === 'object') { | |
module.exports = factory(); | |
} else { | |
root.imageLoader = factory(); | |
} | |
})(this, function() { | |
'use strict'; |
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
// Promise | |
// 1. p1 | |
function p1(value) { | |
return new Promise(function(resolve, reject) { | |
setTimeout(function() { | |
resolve(value); | |
}, 200); | |
}); | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
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
// arguments 类数组和形参 | |
function $( selector, context ) { | |
// default | |
console.log( arguments ); // 'div' | |
console.log( selector, context ); // 'div', undefined | |
// 更新 selector | |
selector = 'p'; | |
console.log( arguments ); // 'p' | |
console.log( selector ); // 'p' |
NewerOlder