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
# for clash | |
git config --global http.proxy http://127.0.0.1:7890 | |
# reset | |
git config --global --unset http.proxy |
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
require('./lib/bin/index.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
function debounce(fn, ms, immediate) { | |
let id = null | |
return function(...args) { | |
id && clearTimeout(id) | |
if (immediate) { | |
const callNow = id === null | |
id = setTimeout(() => id = null, ms) | |
callNow && fn.apply(this, args) | |
} else { | |
id = setTimeout(() => { |
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 PENDING = 'pending' | |
const RESOLVED = 'resolved' | |
const REJECTED = 'rejected' | |
class MyPromise { | |
static resolve(value) { | |
return new Promise(resolve) { | |
resolve(value) | |
} | |
} |
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
Array.prototype.forEach1 = function(fn) { | |
const arr = this | |
for (let i = 0; i < arr.length; i++) { | |
fn.call(this, arr[i], i, arr) | |
} | |
} | |
Array.prototype.map1 = function(fn) { | |
const arr = [...this] | |
for (let i = 0; i < arr.length; i++) { | |
arr[i] = fn.call(this, arr[i], i, arr) |
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 curry = fn => | |
judge = (...args) => | |
args.length === fn.length | |
? fn(...args) | |
: (arg) => judge(...args, arg) |
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 arr = [3, 1, 2, 10, 4, 6, 5, 9, 8] | |
// quick sort | |
function quickSort(arr) { | |
if (arr.length <= 1) { | |
return arr | |
} | |
var midIdx = Math.floor(arr.length/2) | |
var midVal = arr[midIdx] | |
var left = [] |
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
{ | |
"湖南省": [ | |
"湘潭大学", | |
"吉首大学", | |
"湖南大学", | |
"中南大学", | |
"湖南科技大学", | |
"长沙理工大学", | |
"湖南农业大学", | |
"中南林业科技大学", |
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.npm.taobao.org | |
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ | |
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/ | |
electron_mirror=https://npm.taobao.org/mirrors/electron/ |
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
{ | |
"extends": "standard", | |
"rules": { | |
"space-before-function-paren": ["error", { | |
"anonymous": "never", | |
"named": "never", | |
"asyncArrow": "always" | |
}] | |
} | |
} |
NewerOlder