Rails tips
Saturday, October 11th, 2008rake log:clear
清扫log文件,这命令好用的地方是服务器启动了也可以清扫
select * from sidebars\G;
格式化输出。单纯的select * from sidebars;命令中有些字符串过长,会显示得很凌乱,加了\G会有所改善。
*::-moz-selection {
background-color:#222;
color:#FFF;
}
网页拖放的颜色的自定义,默认的蓝底白字太简陋了。
show create table tablename;
show full columns from tablename;
查看表结构,比看migration文件要直观一点。
或者直接打开schema.rb文件,查找
create_table “tablename”
这样来查看表的定义的方式,感觉也挺好用。
find . -name “*” | xargs grep “yourstring”
用来遍历文件夹查找包含yourstring的文档,如
find . -name “*” | xargs grep “def create”
exts = ['.rb']
if ARGV[0] =~ /^\.[a-zA-Z0-9]+$/
exts = []
while ARGV[0] =~ /^\.[a-zA-Z0-9]+$/
[...]
Tags: tips
Posted in Uncategorized | 1 Comment »>