.num {
mso-number-format:General;
}
.text{
mso-number-format:"\@";/*force text*/
}
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
class PromiseSimple { | |
constructor(executionFunction) { | |
this.promiseChain = []; | |
this.handleError = () => {}; | |
this.onResolve = this.onResolve.bind(this); | |
this.onReject = this.onReject.bind(this); | |
executionFunction(this.onResolve, this.onReject); | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>使用代理合并 http 请求</title> | |
</head> | |
<body> | |
<input type="checkbox" id="1"/> | |
<input type="checkbox" id="2"/> |
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
1.Javascript中的String是没有trim方法,为String加上trim方法 | |
//自定义函数 | |
if (!String.trim) { | |
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/g,''); | |
} | |
} | |
//YUI | |
2.YAHOO.lang.trim(s) | |
参数 字符串 , 返回值 字符串 |
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
#!/bin/bash | |
# usage: auto-switch-node-version.sh v8.11.1 'npm install&&npm run build:qa' | |
# you can also use nvm run 8.11.1 app.js or nvm exec 8.11.1 node app.js | |
newNodeVersion=$1 | |
oldNodeVersion=`node -v` | |
source ~/.nvm/nvm.sh |
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 disallowedMethods = ['log', 'info', 'warn', 'error', 'dir'] | |
module.exports = { | |
create(context) { | |
return { | |
Identifier(node) { | |
if ( | |
!looksLike(node, { | |
name: 'console', | |
parent: { |
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
/* | |
* Open the console | |
* to see the state log. | |
*/ | |
const todo = (state, action) => { | |
if (action.type === 'ADD_TODO') { | |
return { | |
id: action.id, | |
text: action.text, |
- npm 本地依赖
"dependencies": {
"@ys/components": "file:./components",
"@ys/domain": "file:./domain",
- qs 库处理 queryString 非常强大
HTTP 协议应当在以下属性中取得可接受的均衡
- 性能 Performance 影响高可用的关键性
- 可伸缩性 Scalability 支持部署可以相互交互的大量组件
- 简单性 Simplicity 易理解,易实现,易验证
- 可见性 Visiable 对两个组件的交互进行监视或仲裁能力 如缓存,分层设计等
- 可移植性 Portability 在不同环境下的运行能力
- 可靠性 Reliability 出现问题时,对整体影响程度
- 可修改性 Modifiability 对系统做出修改的难易程度,由可进化性,可定制性,可扩展性,可配置性,可重用性构成
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 addComments(arg, name) { | |
// 当参数前的注释不存在的情况, 加入 webpackChunkName 注释 | |
if (!arg.leadingComments) { | |
arg.leadingComments = [ | |
{ | |
type: 'CommentBlock', | |
value: ` webpackChunkName: '${name}' `, | |
}, | |
] | |
} |