Skip to content

Instantly share code, notes, and snippets.

@linus-young
linus-young / rails command
Created March 8, 2013 12:43
some rails command
rails g migration AddColumnToTable column:type
rails g scaffold MyModel --no-stylesheets
git config --global user.name "linus-young"
git config --global user.email "test@test.com"
git config --global color.ui true # 开启全部颜色效果
# 常用命令alias
git config --global alias.cm commit
git config --global alias.st status
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ps push
@linus-young
linus-young / ChangeSuffix.rb
Created September 26, 2013 15:13
Change all .txt file in one directory to .cpp file.
require 'fileutils'
Dir.glob('/path_to_file_directory/*.txt').each do |f|
FileUtils.mv f, "#{File.dirname(f)}/#{File.basename(f,'.*')}.cpp"
end
#
# description
# D_GNU_SOURCE is for GNU extension
#
all: project_name
clean:
rm -f exec_file
project_name: main.c