个人在平时使用google.com是总结出来的常见google搜索技巧:
1,简单数学计算
1.23 * 20
2,查看天气预报
beijing weather
3,查看时间
beijing time
4,搜索文件,指定格式
rails filetype:ppt
5,查找指定站点
rails site:blog.wxianfeng.com
6,排除站点查找
rails -site:blog.wxianfeng.com
7,查找外链
link:www.dhgate.com
8,查找相似网站
related:www.dhgate.com
9,查看google收录数
site:blog.wxianfeng.com
10,搜索手机号码归属地(g.cn)
13888888888
11,搜索指定的词组
"ruby on rails"
12,排除关键字搜索
-rails site:blog.wxianfeng.com
13,指定多个关键字
ruby || rails
ruby OR rails
14,查询汇率
1 dollars in RMB
15,查询网站title中含有指定关键字
intitle:wxianfeng
16,查询url含有指定关键字的
inurl:wxianfeng
17,网页内容包含的关键词
intext:wxianfeng
go on ………….
SEE:
http://dongxi.net/b00rT
http://www.williamlong.info/archives/728.html
Rails社区核心人物之一Katz今天离开了engineyard,离开了rails社区,有点遗憾,这个人我想rails社区的fans都应该知道,katz在kungfurails的时候来过中国,并且作了rails3的演讲,视频见此:
http://v.youku.com/v_show/id_XMTI4NDQ2OTIw.html,katz做过很多我们耳熟能详的项目,Rails,Merb,jQuery,datamapper 等等,并且最近刚发布的rails3主要贡献者就是katz,把merb的想法带入了rails,Yehuda Katz 在blog里说明离开的原因和去向,并且说明了未来三年的计划,他的去向是去开发 sproutcore了,sproutcore是apple公司开源出来的,然而sproutcore的创造者在今年7月8日离开了apple公司,创办了自己的公司,依据sproutcore开发更好的桌面体验般的webapp,sproutcore创始人准备将sproutcore打造为html5的框架,为移动互联网,IPAD等提供良好的应用体验,看来HTML5也是大势所趋啊….
无论怎样,Good luck Katz,必定你为rails社区贡献了很多,katz承诺虽然离开了engineyard,但是rails3.1的开发工作还将由他主导,说不定也因为他rails+sproutcore会很好的结合起来呢,over。。。
叽歪一下祝贺Katz进入HTML5 team
See:
http://www.javaeye.com/news/17731-yehuda-kats-leave-engine-yard
最近blog换了皮肤,以前是最大宽度,现在宽度限制死了,有的图片超过了宽度,很丑陋,于是用minimagick对所有的图片统一缩放了下,这下图片的大小刚刚好,缩放比resize的效果要好,图片不会扭曲难看,
minimagick和rmagick都是调用imagemagick的ruby接口,使用起来很方便。。。。
1,缩放 (也就是我用来处理我blog里图片的脚本)
require 'rubygems' require 'mini_magick' # path = "E:/Rubyproject/blog.wxianfeng.com/public/files/" # windows路径 path = "/usr/local/system/www/blog.wxianfeng.com/shared/public/files/" files = Dir.open(path).to_a.select{|x| x != '.' && x!= '..' && x != '.svn' && x != 'Thumbs.db'} imgs = files.select { |f| f !~ /^(thumb_|middle_)/ } imgs.each do |ele| p ele img_path = path + ele img = MiniMagick::Image.from_file(img_path) w,h = img[:width],img[:height] percent = ((480/w.to_f) * 100).to_i img.combine_options do |c| c.sample "#{percent}%" # 缩放 end img.write(img_path) end
2,resize
image = MiniMagick::Image.from_file("input.jpg") # or MiniMagick::Image.new("input.jpg") image.resize "100x100" # or image.thumbnail "100x100" image.write("output.jpg")
3,裁剪
require ‘mini_magick’ img = MiniMagick::Image.from_file “1.jpg” #取得宽度和高度 w,h = img[:width],img[:height] #=> [2048, 1536] shaved_off = ((w-h)/2).round #=> 256 img.shave “#{shaved_off}x0″ #此处表示宽度上左右各截取256个像素,高度上截取0像素 img.write “2.jpg”
4,旋转
image = MiniMagick::Image.from_file("input.jpg") image.combine_options do |c| c.rotate "-90>" # 旋转 90 度 end image.write("input.jpg") # 同名 替换掉原来的
SEE:
http://github.com/probablycorey/mini_magick
http://www.blogkid.net/archives/2154.html