Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
李华顺
@huacnlee
Admin
NO. 2 / 2011-10-28

[email protected]
长桥证券 (Longbridge)
成都
502 Topics / 9063 Replies
961 Followers
53 Following
105 Favorites
Reward
GitHub Public Repos
  • autocorrect 1483

    A linter and formatter to help you to improve copywriting, correct spaces, words, and punctuation...

  • rails-settings-cached 1114

    Global settings for your Rails application.

  • rucaptcha 698

    Captcha Gem for Rails, which generates captcha image by Rust.

  • zed-theme-macos-classic 112

    A macOS native style theme for Zed, let it same like native app in macOS.

  • zed-extension-action 24

    GitHub Action for automatically bump Zed Extensions version after a release.

  • vscode-macos-classic.t... 23

    macOS Classic theme for Visual Studio Code

  • color-lsp 23

    A document color language server.

  • autocorrect-action 12

    GitHub action for use AutoCorrect as lint

  • zed-csv 8

    CSV support for Zed

  • gpui-workspace 7

    Dock layout UI component for GPUI, that extracted from Zed project.

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • Rails 5.1 beta 发布了 - 关键词 Loving JavaScript at February 25, 2017

    😅

  • {今天: {Ruby: '24 岁', 我: '36 岁'}} at February 24, 2017

    09 年开始,收获颇多,庆幸当初选择这条路。

    当初可是冒险偷偷把产品改用 Ruby 来实现了… 😅

    Ruby 带来的不仅仅是一个语言、框架,还影响了我做事情方法、看问题的角度。

  • Rails 5.1 beta 发布了 - 关键词 Loving JavaScript at February 24, 2017

    Ruby China 的升级了一下,居然没错误,就多了些 warning

    有个主要的是 Warning 是 attribute_changed? 这种用法不能在 after_save 的 callbacks 里面做了(Rails 5.2 将会更改行为)需要改用 saved_change_to_attribute? 代替。

    而这类用法可能会大量存在,例如 Devise 里面,需要调整花不少时间。

  • 新增 “打赏” 功能 at February 24, 2017

    😄 😄

  • 新增 “打赏” 功能 at February 24, 2017

    不信的话,扫二维码试试 😌

  • 数组分页,除了 Kaminari.paginate_array 有更好的方法吗? at February 24, 2017

    整理好你的问题,标题不要那么长

  • Rails 5.1 beta 发布了 - 关键词 Loving JavaScript at February 24, 2017

    Change ActionView ERB Handler from Erubis to Erubi

    Erubi offers the following advantages for Rails:
    
    * Works with ruby's --enable-frozen-string-literal option
    * Has 88% smaller memory footprint
    * Does no freedom patching (Erubis adds a method to Kernel)
    * Has simpler internals (1 file, <150 lines of code)
    * Has an open development model (Erubis doesn't have a
      public source control repository or bug tracker)
    * Is not dead (Erubis hasn't been updated since 2011)
    
    Erubi is a simplified fork of Erubis that contains just the
    parts that are generally needed (which includes the parts
    that Rails uses).  The only intentional difference in
    behavior is that it does not include support for <%=== tags
    for debug output.  That could be added to the ActionView ERB
    handler if it is desired.
    
    The Erubis template handler remains in a deprecated state
    so that code that accesses it directly does not break.  It
    can be removed after Rails 5.1.
    

    https://github.com/rails/rails/commit/7da8d76206271bdf200ea201f7e5a49afb9bc9e7

  • Rails 5.1 beta 发布了 - 关键词 Loving JavaScript at February 24, 2017
    DEPRECATION WARNING: The behavior of `attribute_change` inside of after callbacks will be changing in the next version of Rails. The new return value will reflect the behavior of calling the method after `save` returned (e.g. the opposite of what it returns now). To maintain the current behavior, use `saved_change_to_attribute` instead. (called from block (3 levels) in <top (required)> at spec/models/user_spec.rb:30)
    

    大量的这种 Warnning,看了一下,要清理需要非一些功夫了... attribute_changed? 这种用法很多地方都在用。

  • Rails 5.1 beta 发布了 - 关键词 Loving JavaScript at February 24, 2017

    如何将 Rails 5.0 升级 5.1

    修改 Gemfile

    gem 'rails', '~> 5.1.0.beta' 
    

    and run bundle update rails

    执行 rails app:update 检查 Rails 标准的几个文件的改动

    Overwrite config/secrets.yml? (enter "h" for help) [Ynaqdh] 
    

    遇到这类提示的时候,选 d,查看 Diff,根据情况手工修改你的文件。

    看起来重要的是 config/environments/production.rb 里面新增了一个配置:

    # Attempt to read encrypted secrets from `config/secrets.yml.enc`.
    # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or
    # `config/secrets.yml.key`.
    config.read_encrypted_secrets = true
    
  • 来热闹热闹下……怎么看今日刷屏热点《就算老公一毛钱股份都没拿到,在我心里,他依然是最牛逼的创业者》 at February 23, 2017

    #科技八卦

  • 建议可以给节点增加自定义属性 at February 23, 2017

    实际上招聘需求目前来看,Ruby China 这样大段内容的作法能解决了。

    那么做会增加额外的复杂度,对于后期维护带来不便,权衡利弊,我觉得不应该那么做。

  • IT 人的辛苦,何来价值 at February 23, 2017

    居然还有功夫发帖,加班的事情也不是太急嘛

  • IT 人的辛苦,何来价值 at February 23, 2017

    😄 😄 😄 😄

  • 浅谈 ActiveRecord 的 N + 1 查询问题 at February 23, 2017

    开发的时候,多关注你的 Rails 控制台日志才是应该的

  • 社区里还有多少人在用 Emacs 做 Ruby 开发? at February 22, 2017

    贴图看看 Emacs 写 Ruby 是什么样子。或者说说你的感受啥的

  • crontab 执行 rake 遇到 cannot load such file -- bundler/setup at February 22, 2017

    Bash 的环境和你登陆 SSH 到服务器的环境(环境变量)不同。

    所以你最好要在 rebuild_index.sh 里面载入 ~/.bashrc 之类的东西

    执行 rake 命令,最好是用 bundle exec rake 来执行,以确保 Gem 环境也能正确加载。


    主要错误是这个:

    cannot load such file -- bundler/setup
    

    看起来应该是 RubyGems 路径没对应上,执行的 rake 认为 bundler 没有安装。

  • 请教大家关于使用 default_scope 遇到的一个问题 at February 22, 2017

    定义一个普通 scope 用的时候基于那个 scope,例如 Post.publish

  • 请教大家关于使用 default_scope 遇到的一个问题 at February 22, 2017

    其实最好不要用 default_scope

  • 基于 Rails 5 的 B2C 电商开源项目 at February 22, 2017

    👏

  • 过来解释一下 at February 22, 2017

    #7 楼 @miclle 不是监控的问题,提示了也没看,因为那一瞬间我搞别的事情去了。 😅

  • 基于 Rails 5 的 B2C 电商开源项目 at February 22, 2017

    部署起来看看呀

  • 过来解释一下 at February 21, 2017

    然后原因是我执行了发布脚本干别的去了,忘了看

  • ExceptionTrack - 捕捉 Rails 应用运行期的异常,并存储到数据库 at February 21, 2017

    #8 楼 @lifuzho 不冲突,可以同时用的,我才尝试过。

  • Data Service 设计分享 at February 20, 2017

    #7 楼 @zhongfox second_level_cache 是 Write Through 的,在数据 update 的时候重写 cache 的。

    https://github.com/hooopo/second_level_cache/blob/master/lib/second_level_cache/mixin.rb#L76

  • Data Service 设计分享 at February 20, 2017

    #2 楼 @zhongfox 我知道 Node.js 并发查询的意义。

    我的意思是:

    let data = yield {
      '商品':  dataService.fetch(...),
      '广告':  dataService.fetch(...),
      '友情链接': dataService.fetch(...),
    }
    

    这段代码 dataService.fetch 实际上后面是从 Redis,还是一个 Rails API + Nginx Proxy Cache(或 Haproxy 之类的 HTTP 缓存实现),效果看起来似乎是一样的。

    因为看起来整个核心效率提高的原因碍于 Redis 里面存储的数据缓存(实际上看起来像是 Model 的二级缓存)。


    看你们的场景也用法,我设想假如引入 @hooopo 的 second_level_cache,或许你那层 DataService 到 Redis 的复杂实现都不需要了,Node.js 稍微实现一下这样的流程:

    Direct fetch from Cache 
            |
        [Cache] -> <hit> -> Response
            |
          <miss>
            |
        [fetch API] -> Write cache
            |
          Response
    
  • Ruby 中如何获取图片的 alpha? at February 20, 2017

    Ruby 的标准库是没有包含图像相关的实现的,有关于图形、图像相关的工作,大多都依赖 ImageMagick 来实现。

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