Skip to content

Instantly share code, notes, and snippets.

(1234622225).toLocaleString("zh-Hans-CN-u-nu-hanidec")//firefox下输出 "1,234,622,225" IE与chrome下输出 "一,二三四,六二二,二二五"
@loufq
loufq / memory_clean.sh
Last active August 29, 2015 14:00
sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"
sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"
@loufq
loufq / nodejs_request_gbk.sh
Last active August 29, 2015 14:00
nodejs request gbk
var request = require('request');
var Iconv = require('iconv').Iconv;
var iconv = new Iconv('GBK', 'UTF-8//TRANSLIT//IGNORE');
request.get('http://foo.bar', {encoding:null}, function(e, r, body)
{
console.log(iconv.convert(body).toString());
});
@loufq
loufq / mongodb_tropdb.sh
Last active August 29, 2015 14:00
mongodb 删除数据库&删除表
bin/mongo
use test;
db.dropDatabase();
db.mytable.drop();
@loufq
loufq / removefolder.sh
Last active August 29, 2015 14:00
Shell文件操作
rm --recursive <foldername> -f
@loufq
loufq / gist:11342653
Created April 27, 2014 10:45
install xcode plugin sheel
#https://github.com/supermarin/Alcatraz/blob/master/Scripts/install.sh
#!/bin/sh
DOWNLOAD_URI=https://github.com/supermarin/Alcatraz/releases/download/1.0.4/Alcatraz.tar.gz
PLUGINS_DIR="${HOME}/Library/Application Support/Developer/Shared/Xcode/Plug-ins"
mkdir -p "${PLUGINS_DIR}"
curl -L $DOWNLOAD_URI | tar xvz -C "${PLUGINS_DIR}"
echo "Alcatraz successfuly installed!!1!🍻 Please restart your Xcode."
@loufq
loufq / kill.sh
Last active August 29, 2015 14:00
查杀PID
fuser -n tcp 12004
sudo kill 9358
@loufq
loufq / addLink.sh
Created May 1, 2014 00:06
给终端增加软链接
@loufq
loufq / change_Permission.sh
Created May 4, 2014 00:17
change permission macos
sudo chown -R $USER /usr/local
@loufq
loufq / gm_install.sh
Created May 4, 2014 00:44
nodejs gm install about
//macos
brew update
brew doctor
sudo chown -R $USER /usr/local
brew install ImageMagick
//ubuntu
apt-get install ImageMagick
brew link libtool
//liunx