A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
// jQuery Bounce Effect on click no jQuery UI -- <http://stackoverflow.com/a/10363828/4494083> | |
// Require jQuery | |
function doBounce(element, times, distance, speed) { | |
for(var i = 0; i < times; i++) { | |
element.animate({marginTop: '-='+distance}, speed) | |
.animate({marginTop: '+='+distance}, speed); | |
} | |
} | |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
var isArrayLike = function (arg) { | |
return arg && typeof arg.length === 'number' && arg.length > -1 && arg.length % 1 === 0 && typeof arg !== 'function' | |
} | |
var filter = (function () { | |
if (Array.prototype.filter) { | |
return function (arrayLikeList, filter, thisArg) { | |
return Array.prototype.filter.call(arrayLikeList, filter, thisArg) | |
} | |
} else { // Array.prototype.filter fallback |
{"lastUpload":"2017-08-20T13:05:44.793Z","extensionVersion":"v2.8.3"} |
%YAML 1.2 | |
--- | |
name: HTML | |
file_extensions: | |
- html | |
- htm | |
- shtml | |
- xhtml | |
- inc | |
- tmpl |
const codeMessage = { | |
200: '服务器成功返回请求的数据', | |
201: '新建或修改数据成功。', | |
202: '一个请求已经进入后台排队(异步任务)', | |
204: '删除数据成功。', | |
400: '发出的请求有错误,服务器没有进行新建或修改数据,的操作。', | |
401: '用户没有权限(令牌、用户名、密码错误)。', | |
403: '用户得到授权,但是访问是被禁止的。', | |
404: '发出的请求针对的是不存在的记录,服务器没有进行操作', | |
406: '请求的格式不可得。', |
const { CreateView, CreateComponent } = Buz | |
const data = { | |
account: { | |
userId: 000001, | |
username: 'Bob', | |
email: 'Bob@', | |
avatar: 'https://avatars.com/a-handsome-man', | |
isLogin: true, | |
services: ['calendar', 'mailbox', 'game-center'] |
class Refs extends React.PureComponent<IProps> { | |
private references: React.ReactInstance[] = [] | |
componentDidMount () { | |
console.log('references', this.references) | |
} | |
setRef = (ref: React.ReactInstance) => { | |
this.references.push(ref) | |
} |