Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Diewin
@w7938940
VIP
NO. 2192 / 2012-05-14

28 Topics / 479 Replies
4 Followers
2 Following
75 Favorites
To Be A Coder.
No GitHub.
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 一次性的倒计时任务 (由用户触发) 用 Sidekiq perform_in 是个好方法吗? at January 24, 2019

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

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

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

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

    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 December 18, 2018

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

  • 关于腾讯 API 拼 URL 的服务 at December 16, 2018
    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 December 14, 2018

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

    我有一种错觉😂

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

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

  • Docker 模式如何修改首页模板呢 at December 04, 2018

    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 December 04, 2018

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

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

    工作五年一直用 Rails 写 API

  • 如何给 Rails 做 health check at November 09, 2018

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

  • Ruby China iOS 12 原生应用 at September 30, 2018

    在用 ruby-china 客户端回复

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

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

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

    有什么不对吗?

  • 基于 Postgres 实现一个推荐系统 at September 21, 2018

    看不太懂但很赞

  • 新人求教:终端不自动载入 RVM 环境 at September 20, 2018

    .ruby-version

  • [分享] 纯 API 项目的路由书写方式 at September 07, 2018

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

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

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

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

    顶,我都想去

  • 如何实现 “限制网页只在特定 APP 中打开”? at August 21, 2018

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

  • Sidekiq CPU 线程数量设置多少比较合适? at July 30, 2018

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

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

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

  • Rails3.2 为什么 production 下不能使用 zip 压缩 at May 23, 2018

    不应该通过 nginx 来实现吗?

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

    SB Admin

  • Mac os High Sierra 10.13.4 U 盘插上去毫无反应 at May 21, 2018
    1. U 盘坏了
    2. USB 口坏了
    3. 系统坏了
  • Whenever 每 20 秒执行任务 at May 04, 2018

    用 sidekiq-scheduler 就不需要 whenever

    app/schedulers/product_scheduler.rb

    require 'sidekiq-scheduler'
    
    class ProductScheduler
      include Sidekiq::Worker
    
      def perform
        puts 'Hello world'
      end
    end
    

    config/sidekiq.yml

    .
    .
    .
    :schedule:
      ProductScheduler:
        every: '1m'
    
  • Whenever 每 20 秒执行任务 at May 04, 2018

    可以用sidekiq-scheduler,是结合了上面的rufus-scheduler和sidekiq,还在sidekiq的后台管理页面里面集成了循环定时任务的管理

  • 在 Rails5.2 中,secrets.yml 貌似又被弃用了,secret_key 在哪里设置啊? at April 23, 2018

    Rails 5.2.0 FINAL: Active Storage, Redis Cache Store, HTTP/2 Early Hints, CSP, Credentials

  • 新版本的感觉没有之前的 UI 好看一些啊 at April 20, 2018

    等改回去了,又有人说要改回来就尴尬了,可以自己改吧,然后加个主题功能,后台可以选择主题

  • 关于一个 model 的怪问题 at April 14, 2018

    model 也可以使用 namespace 吗,那对应的表名应该是什么样的?可以尝试指定表名

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