Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Diewin
@w7938940
高级会员
第 2192 位会员 / 2012-05-14

28 篇帖子 / 485 条回帖
4 关注者
3 正在关注
76 收藏
To Be A Coder.
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 个推微服务网关架构实践 at 2019年03月07日

    有关注一个开源 API 网关项目 GoKu API Gateway CE

  • 有用 VS Code 调试 Rails 的大神么?? at 2019年03月05日

    "args": [ "server", "-p", "3001" ] 如果是调试端口的话有个debuggerPort参数

  • 集合缓存优化实践 at 2019年01月29日

    我代码里面都用的 @articles,显示出来出错了

  • 集合缓存优化实践 at 2019年01月29日

    Rails 5 已经有 collection cache, jbuilder 也有 collection cache

    不使用 jbuilder_cache_multi,适用于增删改不频繁,缓存整个集合

    json.cache! @user1 do
      json.partial!  'article', collection: @user2, as: :article
    end
    

    使用 jbuilder_cache_multi,缓存每个对象

    json.cache_collection! @user3 do |article|
      json.partial! 'article', article: article
    end
    

    如果对象支持 cache_key 方法就用 cache_key 做缓存的 key,获取的时候使用 Rails.cache.fetch_multi

  • 集合缓存优化实践 at 2019年01月28日

    为什么不直接用 Rails.cache 的 cache_key_with_version

  • 一次性的倒计时任务 (由用户触发) 用 Sidekiq perform_in 是个好方法吗? at 2019年01月24日

    为什么不是直接使用 redis 来设置过期时间

  • 大佬们是喜欢 Erlang 这种变量不可以变的,还是 Clojure 这种变量可变的函数式语言? at 2019年01月15日

    不是大佬,喜欢可以赚很多钱的语言

  • 请问下 sidekiq 的 worker 中要用 client 和 server 连接池对象该怎么取? at 2018年12月29日

    https://github.com/mperham/sidekiq/wiki/Advanced-Options

    class HardWorker
      include Sidekiq::Worker
    
      MEMCACHED_POOL = ConnectionPool.new(size: 10, timeout: 3) { Dalli::Client.new }
      def perform(args)
        MEMCACHED_POOL.with do |dalli|
          dalli.set('foo', 'bar')
        end
      end
    end
    
  • 关于腾讯 API 拼 URL 的服务 at 2018年12月18日

    那你要说是那个 API 了,不知道具体需求

  • 关于腾讯 API 拼 URL 的服务 at 2018年12月16日
    params =  { foo: 'bar', baz: 'qux' }
    uri = URI('https://httpbin.org/post')
    uri.query = params.to_query
    url = uri.to_s
    RestClient.post url, {}
    
  • Ruby 2.6.0-rc1 已发布 at 2018年12月14日

    请保持对 Ruby 新时代性能的关注。

    我有一种错觉😂

  • Rails 使用 ActionCable 怎么才能实时监测用户在线情况? at 2018年12月12日

    https://github.com/rails/rails/pull/32828/commits/9082ed512a3f1bd65c725bfeb49ef59f9c992b7f 有人提交了 pull request 如果 ping 客户端超过 5 次没有回应就认为客户端掉线了

  • Docker 模式如何修改首页模板呢 at 2018年12月04日

    Rails caches Templates with the ActionView::Resolver::Cache. If you get the resolver you can then clear the context with clear_cache. In an ApplicationController you recieve the context via lookup_context.view_paths.paths.first. Just call clear_cache on the resolver and Rails will reload the cache at the next request.

    ActionView::Resolver.clear_cache 试试

  • 分享一个 MacOS 免费的解压缩软件。功能强大,界面简洁! at 2018年12月04日

    The Unarchiver 可以预览解压之后的文件名是不是乱码,对在 windows 上创建的压缩包很有用

  • 做个小小的调查,有多少用 Rails 做服务器后端 API 的? at 2018年11月19日

    工作五年一直用 Rails 写 API

  • 如何给 Rails 做 health check at 2018年11月09日

    刚好看到 okcomputer,内置了比较常见的一些检查

  • Ruby China iOS 12 原生应用 at 2018年09月30日

    在用 ruby-china 客户端回复

  • 更新至 RubyMine2018.2.2 版本,出现 GEM_HOME and/or GEM_PATH not set 问题 at 2018年09月26日

    https://youtrack.jetbrains.com/issue/RUBY-22254

  • 该如何理解符号作为实参传入方法呢? at 2018年09月23日
    puts :value # => value
    puts "#{:value}" # => value
    

    有什么不对吗?

  • 基于 Postgres 实现一个推荐系统 at 2018年09月21日

    看不太懂但很赞

  • 新人求教:终端不自动载入 RVM 环境 at 2018年09月20日

    .ruby-version

  • [分享] 纯 API 项目的路由书写方式 at 2018年09月07日

    我用 restful 的风格客户端都觉得不好,还说接口返回的最外层一会儿是数组一会儿是对象无法处理

  • 系统使用 Devise 做的登录,有个需求 [同一帐号被另一台机器登录,本机器被强制退出登录],求大神指点一下 at 2018年09月07日

    我用 jwt 可以把 token 的 iat 放在 token 里面,服务端保存最新的 iat,客户端请求的 iat 若小于服务端的 iat 就返回 401

  • [成都] 中邮速递易 招聘中高 Ruby 研发工程师 4 名,14-22k at 2018年08月24日

    顶,我都想去

  • 如何实现 “限制网页只在特定 APP 中打开”? at 2018年08月21日

    可以做成类型微信网页授权的,微信是用 JS 在 APP 和网页之间通信的,这个库貌似可以 jockeyjs

  • Sidekiq CPU 线程数量设置多少比较合适? at 2018年07月30日

    sidekiq 作者推荐最多不要超过 50,如果 worker 里有读写数据库操作,不要超过数据库的 pool 数

  • 使用 Rails 开发 API 引用,如何去掉 Rails 默认页面 at 2018年07月11日

    ruby on rails - How redirect to 404 page in routes.rb?

  • Rails3.2 为什么 production 下不能使用 zip 压缩 at 2018年05月23日

    不应该通过 nginx 来实现吗?

  • 大家后台管理除了 Vue/React 之外,都用什么做 UI 面板? at 2018年05月23日

    SB Admin

  • Mac os High Sierra 10.13.4 U 盘插上去毫无反应 at 2018年05月21日
    1. U 盘坏了
    2. USB 口坏了
    3. 系统坏了
  • 上一页
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 14
  • 15
  • 下一页
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English