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 | |
mongoexport -d <database> -c <collection> --type=json -f <field1>,<field2> -o </path/to/collection.json> | |
#import | |
mongoimport -d <database> -c <collection> --type=json -u <username> -p <password> --headerline --file </path/to/collection.json> |
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
Capitalized, short (50 chars or less) summary | |
More detailed explanatory text, if necessary. Wrap it to about 72 | |
characters or so. In some contexts, the first line is treated as the | |
subject of an email and the rest of the text as the body. The blank | |
line separating the summary from the body is critical (unless you omit | |
the body entirely); tools like rebase can get confused if you run the | |
two together. | |
Write your commit message in the imperative: "Fix bug" and not "Fixed bug" |
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.生成密钥 | |
ssh-keygen -t rsa | |
# 2.拷贝公钥id_rsa.pub到远程服务器的用户.ssh目录下(这里远程服务器是Mac OSX) | |
scp ~/.ssh/id_rsa.pub {remote_username}@{remote_ip}:~/{remote_username}/.ssh/ | |
# 3.重命名远程服务器上的id_rsa.pub为authorized_keys | |
mv id_rsa.pub authorized_keys | |
# 4.编辑本地配置文件 |
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
/*http://www.cnblogs.com/kaiye/archive/2012/06/06/3039041.html*/ | |
.select2{max-width:200px;*width: expression(function(el){el.style.width = el.offsetWidth > 200 ? '200px' : el.offsetWidth + 'px';counter('2');}(this));} |
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
sudo rm -rf /usr/local/bin/node | |
sudo rm -rf /usr/local/bin/npm | |
sudo rm -rf ~/.npm | |
sudo rm -rf ~/.node-gyp | |
sudo rm -rf /usr/local/share/man/man1/node.1 | |
sudo rm -rf /usr/local/share/systemtap/tapset/node.stp | |
sudo rm -rf /usr/local/lib/node |
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
# First: | |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
#go to /usr/local/lib and delete any node and node_modules | |
cd /usr/local/lib | |
sudo rm -rf node* |
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
// Add commas to numbers | |
function addCommas(n) { | |
return String(n).replace(/(\d)(?=(\d{3})+$)/g, '$1,') | |
} | |
//check the browser environment | |
function isWeiXinEnv(){ | |
var ua = window.navigator.userAgent.toLowerCase(); | |
return ua.match(/MicroMessenger/i) == 'micromessenger'; | |
} |
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
@mixin clear { | |
*zoom: 1; | |
&:after { | |
content: '\20'; | |
display: block; | |
clear: both; | |
height: 0; | |
} | |
} |
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
input[type='radio'] { | |
-webkit-appearance: none; | |
-webkit-user-select: none; | |
border-radius: 100%; | |
border: 1px solid #BABABA; | |
display: inline-block; | |
height: 16px; | |
position: relative; | |
top: 3px; | |
width: 16px; |
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
@charset "UTF-8"; | |
$font_name:'iconfont'; | |
$font_url: 'http://path/to/font/#{$font_name}'; | |
@font-face { | |
font-family: $font_name; | |
src: url('#{$font_url}.eot'); | |
src: url('#{$font_url}.eot?#iefix') format('embedded-opentype'), | |
url('#{$font_url}.svg##{$font_name}regular') format('svg'), |