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

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

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

  • rails-settings-cached 1104

    Global settings for your Rails application.

  • rucaptcha 697

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

  • zed-theme-macos-classic 97

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

  • vscode-macos-classic.t... 22

    macOS Classic theme for Visual Studio Code

  • zed-extension-action 19

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

  • autocorrect-action 11

    GitHub action for use AutoCorrect as lint

  • zed-autocorrect 6

    AutoCorrect for Zed

  • gpui-workspace 4

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

  • zed-lalrpop 3

    LALRPOP parser grammar support for Zed.

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 正则匹配网址问题 at May 15, 2014

    rails-autolink 的代码里面有的

  • 本地运行 ruby-china 报错 at May 15, 2014

    错误信息里面有 psych, mongoid 出现,貌似 mongoid.yml 文件那里有问题,检查一下

  • geetest ruby sdk at May 15, 2014

    拖不动,iOS 上面

  • 置顶好碍眼啊~ at May 13, 2014

    将过期的内容取消置顶了

  • 置顶好碍眼啊~ at May 13, 2014

    好吧,找时间换个别的方式

  • ruby.taobao.org 启用 SSL (非强制跳转) at May 12, 2014

    不喜欢 rails-assets

  • [已解决] 使用 CarrierWave-Upyun 上传图片时发生 RestClient::Unauthorized (401 Unauthorized) 错误 at May 12, 2014

    carrierwave.rb

    发来看看

  • 功能新调整,关于招聘的 at May 12, 2014

    #18 楼 @Rei 查一下,估计是上次升级 Rails 改错了

  • SelfStore,数字内容创作者的在线商店 at May 12, 2014

    除了书籍,还有什么可以在线出售呢?

  • 在 module 自定义 method_missing 方法 at May 12, 2014

    #7 楼 @karmue 对

  • Railsconf 2014 官方演讲录像集 at May 12, 2014

    两个地方都不方便

    http://www.confreaks.com/events/railsconf

  • 在 module 自定义 method_missing 方法 at May 12, 2014

    #1 楼 @karmue 很多时候 method_missing 方法是非常有用的,比如:

    https://github.com/ruby-china/ruby-china/blob/7becefa06ee24bbb3c3969dd26e831789b762e80/app/models/site_config.rb

    # coding: utf-8
    # 在数据库中的配置信息
    # 这里有存放首页,Wiki 等页面 HTML
    # 使用方法
    # SiteConfig.foo
    # SiteConfig.foo = "asdkglaksdg"
    class SiteConfig
      include Mongoid::Document
    
      field :key
      field :value
    
      index :key => 1
    
      validates_presence_of :key
      validates_uniqueness_of :key
    
      def self.method_missing(method, *args)
        method_name = method.to_s
        super(method, *args)
      rescue NoMethodError
        if method_name =~ /=$/
          var_name = method_name.gsub('=', '')
          value = args.first.to_s
          # save
          if item = find_by_key(var_name)
            item.update_attribute(:value, value)
          else
            SiteConfig.create(:key => var_name, :value => value)
          end
        else
          Rails.cache.fetch("site_config:#{method}") do
            if item = find_by_key(method)
              item.value
            else
              nil
            end
          end
        end
      end
    
      after_save :update_cache
      def update_cache
        Rails.cache.write("site_config:#{self.key}", self.value)
      end
    
      def self.find_by_key(key)
        where(:key => key.to_s).first
      end
    
      def self.save_default(key, value)
        create(:key => key, :value => value.to_s) unless find_by_key(key)
      end
    end
    
  • 抓到尝试攻击的 at May 12, 2014

    #14 楼 @palytoxin ExceptionNotifier

  • 关于中英文自动隔开的算法实现 at May 11, 2014

    #16 楼 @sdpfoue http://github.com/huacnlee/auto-space

  • 功能新调整,关于招聘的 at May 11, 2014

    #4 楼 @Rei 刚修正,在发布

  • 功能新调整,关于招聘的 at May 11, 2014

    #2 楼 @lgn21st 😄

  • 分享今天解决 Ruby China 某个性能问题发现的东西 at May 10, 2014

    #3 楼 @hooopo 其实我是每次 Rails 版本升级的时候,都是处理过其他 Gem,将它们升级到那个时间点的最新版本。

    只是每次升级 Rails 的时候,又很多复杂的依赖要处理、不兼容的代码要修改。为了让这个过程更加顺利,所以只是尽量升级影响到的东西。

    我应该算你说那种保守型的,一般跑好稳定的 Gem 说不会升级的,只是偶尔关注他们的更新,发现有性能改进或有用的新特性的时候,才会主动去升级他们。

  • 分享个又拍云表单上传的 gem at May 10, 2014

    额… 又拍云提供的 Form 上传主要是为了避免上传文件经过服务端。

    这样以来可以通过 Form 直接提交到又拍的服务器。减少 User -> App Server -> UpYun 中间多余的转发。

    而楼主这个实现又把这个功能做成了得通过服务端。

    那完全可以直接使用普通的 API 接口,而这种早已有了实现 https://github.com/nowa/carrierwave-upyun

  • 置顶功能翻到帖子顶部了 at May 10, 2014

    减少数量到 3 条,没记错的话,按历史情况来看 3 条应该够置顶近期的东西。 @lgn21st @Rei 我真的不希望弄回右侧,哪个区域几乎看不到(标题太长,导致内容太挤)。

  • 置顶功能翻到帖子顶部了 at May 10, 2014

    #13 楼 @Rei http://www.gentleface.com/free_icon_set.html 这个,微调过的

  • 置顶功能翻到帖子顶部了 at May 10, 2014

    #10 楼 @lgn21st 所以我说新的改动置顶要放那些更有参与讨论价值或热门的帖子

    甚至像 Ruby Rails 发布新版本之类的也是可以稍微置顶一两天的,可以集中讨论新特性,省的老是有人重复发帖

  • 置顶功能翻到帖子顶部了 at May 10, 2014

    #9 楼 @Rei #7 楼 @imlcl 主要是没现成的图标,得重新做

  • ruby-china 服务器异常?求直播解决过程! at May 09, 2014

    刚刚有个小 Bug,已修好,正在发布

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