Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
zzzhc
@zzzhc
VIP
NO. 303 / 2011-11-28

北京
1 Topics / 4 Replies
0 Followers
0 Following
0 Favorites
GitHub Public Repos
  • zheng 1

    基于Spring+SpringMVC+Mybatis分布式敏捷开发系统架构,提供整套公共微服务服务模块:集中权限管理(单点登录)、内容管理、支付中心、用户管理(支持第三方登录)、微信平台、存储系...

  • awesome-cheatsheets 0

    超级速查表 - 编程语言、框架和开发工具的速查表,单个文件包含一切你需要知道的东西 :zap:

  • transgateway 0

  • Transformers-Tutorials 0

    This repository contains demos I made with the Transformers library by HuggingFace.

  • gitstars 0

    Github Starred Repositories Manager

  • gfiles 0

    Collection of HTML5 and flash games, plus webretro

  • makemeahanzi 0

    Free, open-source Chinese character data

  • vue-project 0

  • super-resolution-js 0

    SOTA image super-resolution in JavaScript/Wasm using an ONNX-ported SwinIR model

  • AccessibilityTool 0

    基于Android无障碍服务实现跳过软件启动广告,音量键切换歌曲,记录通知栏消息,调节屏幕色彩亮度等功能,基于Android的设备管理器实现双击状态栏锁屏等功能。

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 我的 slide: 最佳實踐如何變成了最慢實踐 at November 22, 2012

    另外,erb 并不是通过 eval 执行的。Rails 现在用 Erubis 来处理 erb, eruby 生成的 ruby 代码会 compile 成一个 ruby method 再执行,相关代码见: https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/action_view/template.rb#L265, https://github.com/rails/rails/blob/3-2-stable/actionpack/lib/action_view/template/handlers/erb.rb#L69)

    require 'erubis'
    input = <<'END'
     <ul>
      <% for item in @list %>
       <li><%= item %></li>
      <% end %>
     </ul>
    END
    list = ['<aaa>', 'b&b', '"ccc"']
    eruby = Erubis::Eruby.new(input)
    puts eruby.src
    
    # result:
    _buf = ''; _buf << ' <ul>
    ';   for item in @list 
     _buf << '   <li>'; _buf << ( item ).to_s; _buf << '</li>
    ';   end 
     _buf << ' </ul>
    ';
    _buf.to_s
    
  • 我的 slide: 最佳實踐如何變成了最慢實踐 at November 22, 2012

    @xdite, 你是在 rails 代码里看到 activerecord 在不同环境下有不同的缓存策略吗? model 上对 association 的缓存跟代码运行的环境应该无关啊,association 是保存在 record 的实例方法上的,在 view 里 post.user 十次不会执行十次查询 (除非 user 不是用 association 定义的). 见 ActiveRecord::Associations::Builder::Association

  • unicorn 使用简介 at August 06, 2012

    unicorn 现在是主流了,github 在 09 年就开始在用:https://github.com/blog/517-unicorn

  • ruby-china 项目启动太慢 at December 03, 2011

    @hooopo, 在 config.ru 里加了几行记录时间 $ cat config.ru

    This file is used by Rack-based servers to start the application.

    app_start_init_time = Time.now

    require ::File.expand_path('../config/environment', FILE)

    app_init_finish_time = Time.now if Rails.env.development? puts "=> boot app used #{app_init_finish_time - app_start_init_time} seconds" end

    run RubyChina::Application

关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English