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
const middleware = [] | |
let mw1 = async function (ctx, next) { | |
console.log("next前,第一个中间件", new Date().getTime()) | |
await next() | |
console.log("next后,第一个中间件", new Date().getTime()) | |
} | |
let mw2 = async function (ctx, next) { | |
console.log("next前,第二个中间件", new Date().getTime()) | |
await next() | |
console.log("next后,第二个中间件", new Date().getTime()) |
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
const asyncFun = (i, cb) => { | |
setTimeout(() => { | |
let result = 2 * i | |
cb(result) | |
}, Math.random() * 1000); | |
} | |
const results = [] | |
var rIndex = 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
var removeNthFromEnd = function(head, n) { | |
let target = head, | |
cur = head; | |
while (n--) { | |
cur = cur.next; | |
} | |
while (cur && cur.next) { | |
cur = cur.next; | |
target = target.next; | |
} |
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
class TrieNode{ | |
TrieNode[] child;//记录孩子节点 | |
boolean is_end;//记录当前节点是不是一个单词的结束字母 | |
public TrieNode(){// | |
child = new TrieNode[26];//子节点数组长度26,0:‘a’,1:‘b’..... | |
is_end = false; | |
} | |
} | |
class Trie { |
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
// if (window.location.hostname === 'localhost') { | |
// // 测试环境 | |
// let el = document.querySelectorAll('[data-sdkdom=phone]')[0]; | |
// el.value = '18515904047'; | |
// var e = document.createEvent('HTMLEvents'); | |
// e.initEvent('input', false, true); | |
// el.dispatchEvent(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
Registered Name: https://zhile.io | |
License Key: 48891cf209c6d32bf4 |
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 string10to62(number) { | |
var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ'.split(''), | |
radix = chars.length, | |
qutient = +number, | |
arr = []; | |
do { | |
mod = qutient % radix; | |
qutient = (qutient - mod) / radix; | |
arr.unshift(chars[mod]); | |
} while (qutient); |
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
void PrintNodeByLevel(Node *root) | |
{ | |
int parentSize = 1, childSize = 0; | |
Node * temp; | |
queue<Node *> q; | |
q.push(root); | |
do | |
{ | |
temp = q.front(); |
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
/* set the width and height */ | |
::-webkit-scrollbar { | |
width: 14px; | |
height: 6px; | |
} | |
/* turn on the buttons at the top */ | |
::-webkit-scrollbar-button:start{ | |
display: block; | |
} |
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
<ul> | |
<li ne-repeat="item in list" id="{{'type_two_' + __i}}"> | |
{{item.title}} | |
</li> | |
</ul> |
NewerOlder