Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
花错
@flowerwrong
会员
第 9442 位会员 / 2013-10-06

广州
47 篇帖子 / 1109 条回帖
36 关注者
35 正在关注
233 收藏
人生有如花错
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 关于 Gem 的几个问题 at 2016年01月18日

    #2 楼 @hooopo go, go, go 😄

  • 现在想做一个聊天室的页面,但是没有思路,请教下大家 at 2016年01月13日

    websocket+ 轮询 (不支持 websocket 的浏览器)

  • 使用 Ruby on Rails 开发与 Java 相比有何优势呢? at 2016年01月13日

    如果没有行业限制,前期用 ruby,后期改 java

  • 踏入程序猿圈子后,作息正常的还有多少? at 2016年01月12日

    #38 楼 @raecoo 今早跑完小丁丁差点冻掉了. . . 😪

  • [北京] 36kr 诚聘 Ruby on Rails 高级开发工程师 1 名 at 2016年01月11日

    五年!!! 好久

  • [已解决] 有人能安装 rails v5.0.0.beta1 吗? at 2016年01月08日

    建议 clone 下来 rails 的源代码

    http://blog.liveneeq.com/tech/2015/12/13/rails5-api.html

    https://github.com/FlowerWrong/srs_callback/blob/master/Gemfile#L4

  • [上海] CareerTalk 招聘 Ruby on Rails (+WebRTC) 全栈开发架构师 at 2016年01月04日

    #10 楼 @bhuztez 换句话说只是打了隧道,做了 p2p

  • 使用 passenger-install-nginx-module 安装 nginx 后无法使用 nginx at 2016年01月02日

    #7 楼 @kingwkb 我也想知道为什么不推荐。 thin/puma/unicorn等都是反代,而且脚本语言大多数都用反代。

  • 黑 C++ 黑的惨绝人寰啊,我都笑死了 at 2015年12月29日

    看完了,但没笑 😄

  • Ruby 中没有 “逻辑与” 的短路原则吗? at 2015年12月28日

    #6 楼 @msg7086 单身狗运算符…

  • 求一个类图的实现? at 2015年12月26日

    原理同楼上, http://blog.liveneeq.com/tech/2015/12/13/how-to-navigate-source-code-in-ruby.html

  • 最近 GitHub 是怎么了, 老是连不上, 又要被墙的节奏吗 at 2015年12月24日

    DNS 也非常蹦

  • 应届生求个实习职位,怎么就这么难啊?求支招! at 2015年12月23日

    Now, 你得用 github 或者代码说话。 PS: 这是我司的招聘文案,有兴趣请发简历到 [email protected].

  • 有推荐一下好用的 Rails editor 吗? at 2015年12月16日

    #1 楼 @317583395 一只用 tower,觉得它的编辑器并不好用 😪 ,ueditor虽然代码写得很烂,但还是比较符合国情的,但现在也不更新了。打算用ckeditor或者tinymce

  • leetcode:Count of Smaller Numbers After Self at 2015年12月14日

    上算法的时间复杂度一样,有更优解吗?

  • 新手选择 Ruby 还是 Python 学习? at 2015年12月13日

    erlang

  • 新手选择 Ruby 还是 Python 学习? at 2015年12月13日

    nodejs呢?😄
    ruby 和 python 哪个更好招人?

  • Grape Get 请求有 JSON 参数,请问怎么用 CURL 去模拟测试,或者还有别的方法测试 GET API 吗? at 2015年12月12日

    curl -X PUT -d "user[name]=yang" "http://localhost" | python -m json.tool

  • Grape Get 请求有 JSON 参数,请问怎么用 CURL 去模拟测试,或者还有别的方法测试 GET API 吗? at 2015年12月12日

    老老实实curl先,不过curl常用的就那么几个,十分钟足够了吧。

  • 本人自行删除 at 2015年12月08日

    #3 楼 @rubyist518 😄 aha. thanks

  • 本人自行删除 at 2015年12月08日

    全局 + 1

    # redis.rb
    # redis conig
    REDIS_CONFIG = YAML.load(File.open(Rails.root.join('config/redis.yml'))).symbolize_keys
    default_config = REDIS_CONFIG[:default].symbolize_keys
    redis_config = default_config.merge(REDIS_CONFIG[Rails.env.to_sym].symbolize_keys) if REDIS_CONFIG[Rails.env.to_sym]
    
    $redis = Redis.new(redis_config)
    # @see https://github.com/resque/redis-namespace
    $namespaced_redis = Redis::Namespace.new(redis_config[:namespace], redis: $redis) if redis_config[:namespace]
    
    # redis -> object
    # @see https://github.com/nateware/redis-objects
    # require 'connection_pool'
    # Redis::Objects.redis = ConnectionPool.new(size: 5, timeout: 5) { $redis }
    
    # To clear out the db before each test and development
    begin
      $redis.flushdb if Rails.env == 'test'
      $redis.flushdb if Rails.env == 'development'
    rescue Exception => e
      p '-' * 20
      p "Error trying with $redis.flushdb: #{e.message}"
      p 'You may need to start the redis-server with `sudo service redis-server start`'
      p 'If the redis-server is not installed, please `sudo apt-get install redis-server`.'
      p 'You are not using linux? See you.'
      p '-' * 20
      rails_pid = Process.pid # thanks @rubyist518
      cmd = "kill -SIGINT #{rails_pid}"
      `#{cmd}`
    end
    
    # config/redis.yml
    default:
      host: localhost
      port: 6379
      driver: hiredis
    
    development:
      db: 0
      namespace: app_development
    
    test:
      db: 1
      namespace: app_test
    
    production:
      db: 2
      host: 127.0.0.1
      namespace: app_production
    
  • 用 where 查找出来的类型为 ActiveRecord::Relation,但需要 model 实例,求帮助 at 2015年12月08日

    简单条件find_by(finds the first record matching some conditions),无order时等价于where().first,比较简单;复杂的where().take(retrieves a record without any implicit ordering) or where().first(finds the first record ordered by the primary key) or where().last(finds the last record ordered by the primary key). 具体参考 rails guides

  • Elixir 有人用吗? at 2015年12月05日

    更喜erlang

  • 该如何获取这种 params at 2015年11月27日

    params[:excel].tempfile 这个才是拿文件

  • 本人自行删除 at 2015年11月26日

    那得看你的协议,通常加长度是为了协议数据的完整性。TCP 不能保证。

  • 数据怎么查询才能优化查询速度 at 2015年11月18日

    joins or includes 不谢 😄

  • Rails 小项目的一些分享 at 2015年11月17日
    arr.sort { |a, b| a.better_v <=> b.better_v }.reverse
    arr.sort { |a, b| b.better_v <=> a.better_v }
    
  • 如何设计登录错三次之后才输入验证码? at 2015年11月16日

    大爱 redis ttl

  • 准备着手翻译出版《Rebuilding Rails》,有人愿意买吗? at 2015年11月16日

    书单里面,买买买

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