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
registry=https://registry.npmmirror.com/ | |
disturl=https://registry.npmmirror.com/dist | |
chromedriver-cdnurl=https://registry.npmmirror.com/mirrors/chromedriver | |
couchbase-binary-host-mirror=https://registry.npmmirror.com/mirrors/couchbase/v{version} | |
debug-binary-host-mirror=https://registry.npmmirror.com/mirrors/node-inspector | |
flow-bin-binary-host-mirror=https://registry.npmmirror.com/mirrors/flow/v{version} | |
fse-binary-host-mirror=https://registry.npmmirror.com/mirrors/fsevents | |
fuse-bindings-binary-host-mirror=https://registry.npmmirror.com/mirrors/fuse-bindings/v{version} | |
git4win-mirror=https://registry.npmmirror.com/mirrors/git-for-windows | |
gl-binary-host-mirror=https://registry.npmmirror.com/mirrors/gl/v{version} |
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 topK (n, k, arr1) { | |
let x1 = n - 1 | |
let y1 = n - 1 | |
let x2 = n - 1 | |
let y2 = n - 1 | |
let endX = x1 | |
let endY = y1 | |
let arr = [arr1[y1][x1]] | |
// 1 2 3 4 |
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
body { | |
font-family: PingFangSC, "simsun", "Hiragino Sans GB", "TIBch", "Classic Grotesque W01","Helvetica Neue", Arial, "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, sans-serif !important; | |
font-size: 1.1em; | |
color:rgb(96,62,36); | |
background-color: rgb(250,244, 233); | |
text-align:justify; | |
text-indent:2em; | |
line-height: 1.8em !important; |
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
/** | |
* 凯撒加解密 | |
*/ | |
// 这里的 26 是必须的,否则导致解密溢出 | |
const num = ~~(Math.random() * 100) % 26 | |
const event = "simple world!" | |
const MIN = "A".charCodeAt(0) |
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
/* | |
* 1 , 1 , 2 , 3 , 5 , 8 , 13 , 21 , 34 , 55 , 89 , 144 | |
*/ | |
function fibonacci(n) { | |
if (n < 2) return 1 | |
return fibonacci(n-1) + fibonacci(n-2) | |
} |
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://gist.github.com/yantze/c428dd022c0c85db2d14c37da4c1dec0 | |
* https://github.com/pvorb/clone/blob/master/clone.js#L74:8 | |
* author: yantze | |
* typeoof | |
* 对象为 function ,可能是 Function, class, Symbol, 不复制,因为这些是非结构化对象,但可以生成实例 | |
* 对象为 object, 可能是 Date 实例, class 实例,{}, [], Regex 实例, Buffer 实例, 错误实例 | |
*/ |
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"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.spinner { | |
height: 50px; | |
width: 50px; |
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 bash | |
# author: yantze | |
# date: 2017-10-30 | |
VULTR_API_KEY=KEYKEYKEYKEYKEYKEYKEYKEYKEY | |
snapshot_id="get snapshot_id from end" | |
subid=$(vultr server create -n "vultr-cli" -r 7 -p 201 --snapshot=$snapshot_id | tail -n 1 | awk '{print $1}') | |
sleep 30 |
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
### Keybase proof | |
I hereby claim: | |
* I am yantze on github. | |
* I am yantze (https://keybase.io/yantze) on keybase. | |
* I have a public key ASCp9eP7ivUZs7_AovNqQS3CJKyDrTI17SPObayJmlr96Qo | |
To claim this, I am signing this object: |
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"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.img { | |
width:40px; | |
height: 40px; |
NewerOlder