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
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
import chai from 'chai'; | |
import sinon from 'sinon'; | |
import mock from 'mock-require'; | |
import moxios from 'moxios'; | |
mock('v2/models/globals/SessionState', { | |
currentUser: { | |
neoToken: '1234567890' | |
} | |
}); |
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
hackSetTitle = (title) => { | |
document.title = title; | |
const iframe = document.createElement('iframe'); | |
iframe.src = '/favicon.ico'; | |
iframe.style.visibility = 'hidden'; | |
const listener = () => { | |
setTimeout(() => { | |
iframe.removeEventListener('load', listener); |
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
<script type="text/javascript"> | |
$(document).ready(function(){ | |
alert($(window).height()); //浏览器时下窗口可视区域高度 | |
alert($(document).height()); //浏览器时下窗口文档的高度 | |
alert($(document.body).height());//浏览器时下窗口文档body的高度 | |
alert($(document.body).outerHeight(true));//浏览器时下窗口文档body的总高度 包括border padding margin | |
alert($(window).width()); //浏览器时下窗口可视区域宽度 | |
alert($(document).width());//浏览器时下窗口文档对于象宽度 | |
alert($(document.body).width());//浏览器时下窗口文档body的高度 |
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
.gray { | |
-webkit-filter: grayscale(100%); | |
-moz-filter: grayscale(100%); | |
-ms-filter: grayscale(100%); | |
-o-filter: grayscale(100%); | |
filter: grayscale(100%); | |
filter: gray; | |
} |
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 React, { Component } from 'react'; | |
import hoistStatics from 'hoist-non-react-statics'; | |
function withStyles(style) { | |
return function wrapWithStyles(ComposedComponent) { | |
class WithStyles extends Component { | |
componentWillMount() { | |
style.use(); | |
} |
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
<div> | |
<div id="preview" class="preview"> | |
<nav class="nav"> | |
<button class="close"> | |
返回 | |
</button> | |
</nav> | |
<div class="container"> | |
<button class="prev"><</button> | |
<button class="next">></button> |
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 { jsdom } from 'jsdom'; | |
import chai from 'chai'; | |
import chaiEnzyme from 'chai-enzyme'; | |
import { shallow, mount, render } from 'enzyme'; | |
chai.use(chaiEnzyme()); | |
global.should = chai.should(); | |
global.shallow = shallow; |
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>JS Bin</title> | |
</head> | |
<body> | |
<script src="https://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script> |