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 09, 2014

    #5 楼 @llvm 好主意

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

    #3 楼 @lgn21st 目测以前会有 4 条都是的情况,到期的要及时下掉,这里我们以后要都主要调整一下

  • [有图] 女神奔着 Ruby 和我合租~ at May 09, 2014

    这么有意思的话题,应该加精鼓励!

  • 收藏能否把最新收藏放在前面? at May 09, 2014

    顺便贴一下我的解决方法

    之前没搞定是因为收藏的 topic_id 是放在 User 的一个 Array 字段里面

    class User
       include Mongoid::Document
       field :favorite_topic_ids, type: Array
    end
    

    每次查询的时候是用 Topic.where(:_id.in => current_user.favorite_topic_ids).paginate 来取的,由于有分页所以不好基于数组的顺序排序。

    今天想了想,其实 will_paginate 是可以直接分页 Array 类型的,于是改成了这样:

    @topic_ids = @user.favorite_topic_ids.reverse.paginate(:page => params[:page], :per_page => 30)
    @topics = Topic.where(:_id.in => @topic_ids)
    @topics = @topics.to_a.sort do |a, b|
      @topic_ids.index(a.id) <=> @topic_ids.index(b.id)
    end
    
  • 收藏能否把最新收藏放在前面? at May 09, 2014

    哦,我看错了,我看成收藏功能能否放到前面了... 是可以的,现在是 Bug

  • 收藏能否把最新收藏放在前面? at May 09, 2014

    Why?

  • 关于 jbuilder render 出来字符串,不能 render 出 json 对象 at May 07, 2014

    重点是 response 头里面的 context-type

  • 有没有使用 capistrano 的个人站长?有没有觉得这种部署方式很慢? at May 05, 2014

    cap 是针对复杂的部署场景而设计的,比如多个服务器,许多复杂的配置…

    如果你的环境简单,可以不用的,两年前我基本上是 git pull 过去的

  • 有谁在 CentOS 上布署过 RoR 么? at May 05, 2014
    rvm autolibs rvm_pkg
    rvm install 2.1.1
    

    直接 rvm autolibs rvm_pkg RVM 将自动处理 libyaml、readline 之类的库安装的问题

  • gem install nokogiri 失败: Error installing nokogiri at May 03, 2014

    #2 楼 @zicjin

    Mac 应该用:

    $ brew install libxml2 libxslt
    
  • Web Framework Benchmarks Round 9 at May 02, 2014

    https://github.com/TechEmpower/FrameworkBenchmarks/pull/847 给他提交了 Pull Request, Rails 4.1.0, Ruby 2.1.1

  • Web Framework Benchmarks Round 9 at May 02, 2014

    目前是 Ruby 2.0.0-p0 , Rails 3.2.13

  • 消息提示页面的异常 at May 02, 2014

    #5 楼 @PengEdy 修好了

  • 消息提示页面的异常 at May 02, 2014

    请楼主再次打开你的通知界面,以便能抓取到异常

  • 现在起,改用国内镜像服务器来装 Gem 吧 at May 02, 2014

    #84 楼 @armylau 你试试自己浏览器是否能打开那个文件

  • 消息提示页面的异常 at May 02, 2014

    #1 楼 @Rei newrelic 无法监控异常的,可以加个 ExceptionNotifier

  • jquery.qeditor 编辑器的 Bootstrap3 版本 at April 30, 2014

    :thumbsup:

  • Ruby on Rails 如何搭建分布式服务器? at April 28, 2014

    Rails 的 App Server 可以无限水平扩展的,简单来说是这样:

                                                  Nginx
                                                     |
                      |------------------------------|---------------------------|
                      |                              |                           |
    ________________Server 0______________     ______Server 1______    _Server N_ 
    |                                    |     |                  |
    | [app0] [app1] [app2] [app3] [app4] |     |  [app0]..[appN]  |
    ______________________________________     ____________________
    
    
  • ROR 网站千万级 at April 28, 2014

    等你遇到这类场景的时候,你就知道怎么查资料了,现在是空谈,没意义

  • Sidekiq 异常的监控 at April 25, 2014

    用 exception_notification 可以将异常写入到你的数据库里面,我们现在的项目就是这么做的。

    lib/exception_notifier/database_notifier.rb

    # coding: utf-8
    # 异常通知
    module ExceptionNotifier
      class DatabaseNotifier
        def initialize(options)
          # do something with the options...
        end
    
        def call(exception, options={})
          # send the notification
          @title = exception.message
          messages = []
          messages << exception.inspect
          if !exception.backtrace.blank?
            messages << "\n"
            messages << exception.backtrace[0,100]
          end
    
          if Rails.env.production?
            ExceptionLog.create(title: @title, body: messages.join("\n"))
          else
            puts "\n======================"
            puts messages.join("\n")
            puts "======================\n"
          end
        end
      end
    end
    

    config/initializes/exception_notification.rb

    require 'exception_notification/rails'
    require 'exception_notification/sidekiq'
    require "exception_notifier/database_notifier"
    
    ExceptionNotification.configure do |config|
      config.ignored_exceptions += %w{ActionView::TemplateError}
      config.add_notifier :database, {}
    end
    
  • 多人开发,database.yml 怎么管理? at April 25, 2014

    我们开发 database.yml 都不 ignore 的,统一到一个公共机器,test 环境是在各自的本机

  • haml slim 之流真的好吗? at April 24, 2014

    不喜欢这些,一直 ERB 不过话说回来,为何 SCSS 和 CoffeeScript 我能接受呢?!

  • 为什么 Ruby China 论坛上一直让大家不让用 Windows 开发? at April 24, 2014

    那个两年前的帖子你有看完么?

  • [西安] 途途科技招聘 Ruby/Rails 工程师 / 实习生 at April 24, 2014

    #2 楼 @tutu1234 没兴趣 😄

  • [西安] 途途科技招聘 Ruby/Rails 工程师 / 实习生 at April 24, 2014

    缺少联系方式,工作地点没写,请参考招聘节点的要求修改,然后 @ 我

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