Skip to content

Instantly share code, notes, and snippets.

View summerblue's full-sized avatar

Summer summerblue

View GitHub Profile
中文输入法:
我用的是QQ五笔,但在编辑模式中输入中文时,常常会触发MacVim的命令,原因是输是输入法没有完全截获按键;
解决方法:在命令行输入以下命令,
defaults write org.vim.MacVim MMUseInlineIm 0
git clone https://github.com/fivesheep/chnroutes.git
python chnroutes.py -p mac
sudo cp ip-up /etc/ppp
sudo cp ip-down /etc/ppp
sudo chmod a+x ip-up ip-down
@summerblue
summerblue / gist:7130165
Created October 24, 2013 02:11
checkout all the remote branches
for remote in `git branch -r `; do git branch --track $remote; done
git remote update
git pull --all
@summerblue
summerblue / gist:7128586
Last active December 26, 2015 09:19
命令行上的 Git, DEMO 初始化 git , 以及 branching

命令行上的 Git, DEMO 初始化 git , 以及 branching

创建 blog 项目, 并初始化 git

# 创建项目, 会在当前目录下创建 blog 文件夹
composer create-project laravel/laravel blog

# 进入项目文件夹
cd blog 
@summerblue
summerblue / gist:6962476
Created October 13, 2013 13:38
laravel start
git clone git://github.com/andrew13/Laravel-4-Bootstrap-Starter-Site.git $1 cd $1
composer install --dev
php artisan migrate
php artisan db:seed
php artisan serve
open http://localhost:8000
@summerblue
summerblue / gist:6928558
Created October 11, 2013 02:04
命令行查看 curl 代理是否起作用
curl ipinfo.io
@summerblue
summerblue / gist:6928540
Created October 11, 2013 02:01
修改默认 rails new project 后 gemfile 的 sources 为 ruby.taobao.org
# 切换到 rvm 的目录
cd $rvm_path/gems
# 查找 gemfile
find . -type f -name "Gemfile"
# 类似于
vi $rvm_path/gems/ruby-2.0.0-p247/gems/railties-4.0.0/lib/rails/generators/rails/app/templates/Gemfile
$gem server
会启动一个gem服务器。在我电脑上是找个提示:
$ gem server
Server started at http://0.0.0.0:8808
Server started at http://[::ffff:0.0.0.0]:8808
假设其IP为192.168.10.1然后在其他机器上,(注意绑定的IP是0.0.0.0,也就是这台机器上的所有IP都绑定上了,包括192.168.10.1 和回环地址 127.0.0.1 ),用如下命令安装
@summerblue
summerblue / gist:6504759
Created September 10, 2013 03:53
Test connection between your machine and APNS server
$ telnet gateway.sandbox.push.apple.com 2195
Trying 17.149.34.135...
Connected to gateway.sandbox.push-apple.com.akadns.net.
Escape character is '^]'.
@summerblue
summerblue / gist:6461437
Created September 6, 2013 09:14
使用PHP生成带LOGO的个性化二维码图像
$data = 'http://www.putclub.com';
$size = '200x200';
$logo = './1.jpg'; // 中间那logo图
// 通过google api生成未加logo前的QR图,也可以自己使用RQcode类生成
$png = 'http://chart.googleapis.com/chart?chs=' . $size . '&cht=qr&chl=' . urlencode($data) . '&chld=L|1&choe=UTF-8';
$QR = imagecreatefrompng($png);
if($logo !== FALSE)
{