`
yang_kunlun
  • 浏览: 74629 次
  • 性别: Icon_minigender_1
  • 来自: 地球
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表

查看系统信息

内存信息 $ cat /proc/meminfo $ free -M CPU信息 $cat /proc/cpuinfo 硬盘信息 $df
在user controller中加入 filter_parameter_logging "password"  如果想完全禁止POST logging,则可以在production.rb中修改:config.log_level = :warn
google go: 入门 参考: http://www.infoq.com/articles/google-go-primer 特点: simple, fast, safe and concurrent Variable Declarations var sum int // Just a declaration var total int = 42 // A declaration with initialization name := "Samuel" Conditionals if result := someFunc(); result > 0 ...

radiantcms

    博客分类:
  • ROR
http://radiantcms.org/overview/ 支持动态页面布局

net

IP 命令行配置如下 sudo gedit /etc/network/interfaces 然后重启 sudo /etc/init.d/networking restart

file copy

    博客分类:
  • ROR
require 'ftools' namespace :ae do task :symlink_assets => :environment do vender_dir = 'vendor/plugins/activeext/public/assets/activeext' new_dir = 'public/assets/activeext' d=Dir.open(vender_dir) for dir in d if dir != '..' && dir != '.' dirname = ...
namespace :ae do desc "Copies the ActiveExt javascripts, images and css to public. HINT: use rake ae:symlink if you are unix based systems" task :copy_assets do puts "1. Creating /public/assets/activeext if it doesn't exist" FileUtils.mkdir_p(RAILS_ROOT + '/pu ...
rails action def get_gallery_type data = [] gallery_type = GalleryType.find:all gallery_type.each do |t| data << {:gallery_type_id => t.id, :name => t.name} end render :json => {:gallery_type => data } end store var store = new Ex ...

Git merge失败后处理

    博客分类:
  • Git
git fetch git rebase origin then git push
配置 environment -- development.rb # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = true #set delivery method to :smtp, :sendmail or :test config.action_mailer.delivery_method = :smtp #these options are only needed if you choose smtp delivery config.action_mailer.smt ...
1,建立xhtml的目的就是实现html向xml的过渡。 2,真正符合标准的网页设计是指能够灵活使用web标准对web内容进行结构、表现、与行为的分离。 3,xhtml是一门面向结构的语言。表格的职能不在于进行网页布局,而是用来显示数据。 4,CSS代码一般放置位于head标签之中。 5,Transitional类型是xhtml文档类型的过渡类型,strct类型是严格类型,不允许使用任何表现样式的标识和属性。 6,对于每一个页面上,同样的id名称只能使用一次。 7,xhtml规范提出,使用id作为统一的名称标记,不推荐使用html中的name属性。 8,类型选择符例如:body{};包含选择符例 ...
task :import_projects => :environment do o_projects = T4uproject.find(:all) for o_project in o_projects unless TimeTree.find_by_original_id(o_project.id) new_object = o_project.attributes new_object['original_id'] = new_object['id'] new_object['task'] = false ...

Mini_magick

    博客分类:
  • ROR
 
MiniMagick中Image对象有一个shave方法,正好可以满足这个需求。在irb中运行: 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” 在使用shave方法处理后 ...

SQL example 2

    博客分类:
  • DB
SELECT root_proj.r_proj AS root_project_name , great_proj.g_proj AS great_project_name , parent_proj.p_proj AS parent_project_name , proj.project AS project_name, task.task_name AS task_name, root_proj.Time AS root_time, great_proj.Time AS great_time , parent_pro ...

SQL example

    博客分类:
  • DB
SELECT  items.Name AS Name , Work_Items AS '#no Workitems', sec_to_time(Project_Time) AS 'Client/Project Total Time', sec_to_time(Ticket_project_Time) AS 'Client/Project Time (With Ticket)', sec_to_time(Total_Hours) AS 'Total Time (not inc breaks)', Research_Time AS ...
Global site tag (gtag.js) - Google Analytics