This file contains hidden or 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
!window.isDebugging && (window.isDebugging = false); | |
isDebugging ? disableDebugger() : enableDebugger(); | |
function enableDebugger() { | |
document.querySelectorAll("*").forEach((elm) => { | |
elm.style.outline = | |
"1px solid #" + (~~(Math.random() * (1 << 24))).toString(16); | |
}); | |
isDebugging = true; | |
} |
This file contains hidden or 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
import fetch from "node-fetch"; | |
const api = "https://jsonbase.com/"; | |
export default class Bucket { | |
constructor(name) { | |
this.name = name; | |
} | |
async get(key) { |
This file contains hidden or 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 stateMachine = Machine({ | |
initial: 'idle', | |
states: { | |
idle: { | |
on: { | |
SUBMIT: 'loading', | |
}, | |
}, | |
loading: { | |
on: { |
This file contains hidden or 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
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/ | |
registry=https://registry.npm.taobao.org |
This file contains hidden or 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
# 安装 | |
$ brew install gifsicle | |
# 使用 | |
$ gifsicle -O3 --lossy=80 -o output.gif input.gif | |
# 文档 | |
$ gifsicle --help |
This file contains hidden or 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
# 设置快捷方式 保存到 ~/.zshrc | |
$ alias ts2mp4="ffmpeg -i ./*.ts -c:v libx264 -c:a copy output.mp4" |
This file contains hidden or 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 MyObject = (() => { | |
let id = 0; | |
return class MyObject { | |
constructor() { | |
this.id = id++; | |
} | |
}; | |
})(); |
This file contains hidden or 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.prototype.after = function(afterFn) { | |
const __this = this; | |
return function() { | |
const ret = __this.apply(this, arguments); | |
afterFn.apply(this, arguments); | |
return ret; | |
} | |
} | |
let showLogin = function() { |
This file contains hidden or 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
// eslint-disable-next-line no-extend-native | |
Function.prototype.after = function(fn) { | |
const _this = this; | |
return function() { | |
const ret = _this.apply(this, arguments); | |
if (ret === 'nextSuccessor') { | |
return fn.apply(this, arguments); | |
} | |
return ret; | |
} |
This file contains hidden or 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
// Data Set | |
// One top level comment | |
const comments = [ | |
{ | |
id: 1, | |
parent_id: null | |
}, | |
{ | |
id: 2, | |
parent_id: 1 |