Skip to content

Instantly share code, notes, and snippets.

View chinacheng's full-sized avatar

chinacheng chinacheng

  • BeiJing,China
View GitHub Profile
vim使用笔记
### 1 首先 安装vim
安装vim很简单的命令
```shell
sudo apt-get install vim
```
@chinacheng
chinacheng / gist:5908195
Created July 2, 2013 10:17
删除github远程分支
git push remote(name) :branch_name(分支名称)
删除git远程分支
@chinacheng
chinacheng / gist:2171579
Created March 23, 2012 15:11
Can't install RMagick 2.13.1
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 2.13.1. Can't find Magick-config
----------------------
sudo apt-get install libmagickwand-dev
The hash of ruby1.9 is different from ruby1.8, it has new grammar, but also support the older grammar.
@chinacheng
chinacheng / gist:1978439
Created March 5, 2012 14:06
render collection
=render :partial=>"info",:collection=>@articles,:as=>:article
@chinacheng
chinacheng / gist:1941223
Created February 29, 2012 14:32
so bad english
I have lost it for a long time, when i pick it again, i find it's hard to remember all the things that i have hold in hand. when i see my chinese english, i feel unhapppy!
@chinacheng
chinacheng / gist:726759
Created December 3, 2010 09:21
zip压缩
require 'zip/zipfilesystem'
require 'zip/zip'
require 'uuidtools'
# 导出host中的所有附件到一个zip文件中
def export_attachments
zip_path = Dir::tmpdir + '/'+ UUID.random_create.to_s + ".zip"
zip = Zip::ZipFile.open(zip_path, Zip::ZipFile::CREATE)
self.attachments.each do |attachment|
zip.add("文件名","源文件路径")
end
今天客服来了电话,问我收到了么
@chinacheng
chinacheng / gist:716377
Created November 26, 2010 07:16
333333
333333
def hello
p "hello:"
end