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(global) { | |
var types = function(obj) { | |
throw new TypeError("fmap called on unregistered type: " + obj); | |
}; | |
// inefficient as hell, but as long as there aren't too many types.... | |
global.Functor = function(type, defs) { | |
var oldTypes = types; | |
types = function(obj) { | |
if (type.prototype.isPrototypeOf(obj)) { |
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
Module.contextTypes = {store: React.PropTypes.object}; |
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
export PATH=$PATH:/data/work/node/bin |
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
/** | |
via http://stackoverflow.com/questions/4998908/convert-data-uri-to-file-then-append-to-formdata/5100158 | |
via http://www.smartjava.org/content/face-detection-using-html5-javascript-webrtc-websockets-jetty-and-javacvopencv | |
**/ | |
function dataURItoBlob(dataURI) { | |
var binary = atob(dataURI.split(',')[1]); | |
var array = []; | |
for(var i = 0; i < binary.length; i++) { |
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
module.exports = { | |
'100000': '住宿服务;住宿服务相关;住宿服务相关', | |
'100100': '住宿服务;宾馆酒店;宾馆酒店', | |
'100101': '住宿服务;宾馆酒店;六星级及以上宾馆', | |
'100102': '住宿服务;宾馆酒店;五星级宾馆', | |
'100103': '住宿服务;宾馆酒店;四星级宾馆', | |
'100104': '住宿服务;宾馆酒店;三星级宾馆', | |
'100105': '住宿服务;宾馆酒店;经济型连锁酒店', | |
'100200': '住宿服务;旅馆招待所;旅馆招待所', | |
'100201': '住宿服务;旅馆招待所;青年旅舍', |
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 getRect (element) { | |
var rect = element.getBoundingClientRect(); | |
var top = document.documentElement.clientTop; | |
var left= document.documentElement.clientLeft; | |
return{ | |
top : rect.top - top, | |
bottom : rect.bottom - top, | |
left : rect.left - left, | |
right : rect.right - left | |
} |
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
var scrollTop = window.pageYOffset //用于FF | |
|| document.documentElement.scrollTop | |
|| document.body.scrollTop | |
|| 0; | |
see at: http://www.cnblogs.com/ckmouse/archive/2012/01/30/2332070.html |
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
var arr = []; | |
for(var i=0;i<256;i++) { | |
var char=String.fromCharCode(i); | |
if(encodeURI(char)!==encodeURIComponent(char)) { | |
arr.push({ | |
character:char, | |
encodeURI:encodeURI(char), | |
encodeURIComponent:encodeURIComponent(char) | |
}); | |
} |
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
#使用EPEL源 | |
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
#安装第三方依赖 | |
yum -y install gcc make gcc-c++ cpp kernel-headers.x86_64 \ | |
libxml2-devel openssl-devel bzip2-devel libjpeg-devel \ | |
libpng-devel freetype-devel openldap-devel postgresql-devel \ | |
aspell-devel net-snmp-devel libxslt-devel libc-client-devel \ |
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
DevTools性能分析文档 | |
=============================== | |
本文只谈性能,其它请参见[devTool][1]官方文档 | |
[email protected] | |
---------------- | |
###Timeline解读 |
NewerOlder