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 add() { | |
const param = arguments[0]; | |
let sum = arguments[1] || 0; | |
if (!param) { | |
return sum; | |
} else { | |
sum += param; | |
return function (...args) { | |
return add.call(null, args[0], sum); | |
}; |
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
#### 以下为多个github 账户设置参考 #### | |
# first github user([email protected]),注意User项直接填git,不用填在github的用户名 | |
Host genedock.github.com | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_rsa_genedock | |
# gitlab | |
Host gitlab.com | |
HostName gitlab.com |
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 fileReader = new FileReader(); | |
fileReader.readAsText(file); | |
fileReader.onloadend = (fileEvent) => { | |
const result = fileEvent.target.result; | |
console.log(result); | |
}; |
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
handleOutSideClick(event) { | |
const {onRowUnSelected} = this.props; | |
const isDescendantOfRoot = ReactDOM.findDOMNode(this.tbody).contains(event.target); | |
if (!isDescendantOfRoot) { | |
event.stopPropagation(); | |
this.setState({ | |
selectedRowIndex: -1 | |
}, () => { |
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 {List, Map} from 'immutable'; | |
import {ActionTypes} from '../constants/Constants'; | |
const defaultState = new Map({ | |
dataList: new Map({ | |
currentAccount: '', | |
currentPath: new List(), | |
data: new List(), | |
isLoading: false |
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
.disable-select { | |
-webkit-touch-callout: none; | |
-webkit-user-select: none; | |
-khtml-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; | |
} |
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
React.Children.map(this.props.children, (child, index) => { | |
const props = child.props; | |
return Object.assign({}, child.props, {index}); | |
}); |
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
React.cloneElement(child, { | |
onSort: this.handleSort.bind(this, field), | |
orderStatus: this.state.orderStatus | |
}); |
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 _sort({array, sortField, order}) { | |
order = order.toLowerCase(); | |
const isAsc = order === Order.ASC; | |
return array.sort((a, b) => { | |
let valueA = a[sortField] === null ? '' : a[sortField]; | |
let valueB = b[sortField] === null ? '' : b[sortField]; | |
if(!isAsc) { | |
const temp = valueA; valueA = valueB; valueB = temp; |