Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
屎丸
@lithium4010
会员
第 8744 位会员 / 2013-08-19

上海
38 篇帖子 / 613 条回帖
11 关注者
47 正在关注
35 收藏
GitHub Public Repos
More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 推荐大家使用 ruby:2.5.1-alpine 镜像 at 2018年05月18日

    相比于 ruby:alpine-2.4.1 提升明显

  • 如何使用 Sidekiq 进行异步处理 at 2018年05月18日

    后来好像又加上了。。。

  • 请教一个 each_with_object / inject /tap 相关 更优雅的写法 at 2018年05月17日

    https://github.com/JuanitoFatas/Ruby-Functional-Programming/blob/master/README-zhCN.md#empty--each--accumulate--push---scan

  • 近两年来 Web 开发有什么革命性的进展么? at 2018年05月14日

    https://webassembly.org/roadmap/

  • 50 行 Ruby 代码写一个区块链 at 2018年05月11日

    每块间隔十分钟这个怎么做到的?

  • Ruby 用 jemalloc 有什么坑么? at 2018年05月08日

    使用 slim 镜像的情况下,jemalloc 确实可以很大的改进内存占用情况

    下图前半部分是 arwineap/docker-ruby-nokogiri-phantomjs 没有使用 jemalloc

    后半部分是同一个镜像开启了 jemalloc

    我发现 alpine 镜像的内存情况比 使用 jemalloc 的 slim 镜像要好很多

    下图前半部分是 hoteltonight/ruby-jemalloc:2.5.1-stretch-slim

    后半部分是 ruby:2.5.1-alpine


    • docker ruby:2.5.1-alpine 用不了 jemalloc
    • docker ruby:2.4.1-alpine 用不了 jemalloc

    测试方法 (参考楼上):

    1. Dockerfile 中增加 RUN apk add --no-cache jemalloc
    2. docker_compose.yml 中增加
    environment:
      LD_PRELOAD: '/usr/lib/libjemalloc.so.2'
    

    https://github.com/docker-library/ruby/pull/198 在这里可以找到 alpine 不行的相关信息

  • 消息队列的推送,一般如何保证安全呢? at 2018年05月07日

    http://self-issued.info/docs/draft-ietf-jose-json-web-signature.html

  • 消息队列的推送,一般如何保证安全呢? at 2018年05月07日

    把消息内容算到 auth_token 里面

  • 消息队列的推送,一般如何保证安全呢? at 2018年05月07日

    消息里面带 auth token

  • ==, eql? , === 核心类 Override 一览表 at 2018年05月06日

    申请+精

  • Whenever 每 20 秒执行任务 at 2018年05月03日

    这样不准

  • 论坛里面杠精很多,有没有人有同感? at 2018年05月03日

    一个扎克特梨

  • 如何实现实时的并行处理 at 2018年04月29日

    parallel 了解一下

  • Rails 5.2 中的 Credentials 和 Active Storage at 2018年04月29日

    感谢分享

  • 安利一个活动 Ludum dare,顺便记一下这次参加 GameJam 的经历 at 2018年04月29日

    玩了一下不好玩。。。

  • 谈谈我对 Python 的看法 at 2018年04月29日

    不过有时候这样写容易改变本来逻辑的形式使得逻辑和实现之间的对应不直观。

    就是本来我可以简单描述的事物由于语言的限制我只能绕着说,这样就导致了不方便。

  • 谈谈我对 Python 的看法 at 2018年04月28日

    楼主喷的蛮有道理,实际出发最好,讨厌教条。

  • 大佬帮忙看下 小弟初学 rails 使用 gem devise 报错 at 2018年04月27日

    你的 Admin::BaseController 里面有 before_action :authenticate_user!, 程序进来会先跑 authenticate_user! 这个方法,而你的 controller 里面没有这个方法,所以会报错。

  • 大佬帮忙看下 小弟初学 rails 使用 gem devise 报错 at 2018年04月26日

    贴下你的 routes.rb application_controller.rb

  • Rails 在用 redis 作为缓存的时候,使用 chrome 浏览器的时候每次请求都会创建一个新的 session,导致无法登陆网站 at 2018年04月26日

    https://github.com/roidrage/redis-session-store

    帮楼主找点线索

    But why, you ask, when there's redis-store? 
    redis-store is a one-size-fits-all solution, 
    and I found it not to work properly with Rails,
    mostly due to a problem that seemed to lie in Rack's Abstract::ID class. 
    
  • 知识管理疑问,如何对好的网页和文章进行管理呢? at 2018年04月17日

    看完,记住,下一篇

  • Ruby 应用服务器的新选择 - Nginx Unit at 2018年04月14日

    有没有 benchmark? 和 midori.rb 比怎么样?

  • 方法中有块,块中有 break 和 next,这种情况应该怎么理解? at 2018年04月14日

    帖子可以修改,麻烦加上高亮

  • 方法中有块,块中有 break 和 next,这种情况应该怎么理解? at 2018年04月14日

    你在这个 block 里面用 return 应该是会报错的

  • 方法中有块,块中有 break 和 next,这种情况应该怎么理解? at 2018年04月14日

    他说的方法是 total 方法,在这个代码上下文确实是会结束 total 方法的。

  • define_singleton_method 时调用自身原来方法 at 2018年04月13日
    str = "focus"
    
    p str.upcase
    
    str.define_singleton_method(:upcase) do
      "singleton:" + super()
    end
    
    p str.singleton_methods
    p str.upcase
    
    # "FOCUS"
    # [:upcase]
    # "singleton:FOCUS"
    
  • 方法中有块,块中有 break 和 next,这种情况应该怎么理解? at 2018年04月13日

    对

    # ``` ruby
    # 这样可以加代码高亮
    # ```
    
    
    puts 'hello'
    
  • 使用 Docker 為 Rails 系統作橫向擴展? at 2018年02月22日

    写个脚本,读随机生成的 port,生成一个 conf,reload nginx. 我在测试环境这么做的。生产用的 swarm mode。

  • 为什么说绝大多数人都没搞懂区块链接,区块链的实质创新是什么 at 2018年02月11日

    我赚了

  • 有考虑使用 Sinatra + ActiveRecord 替换你的 Rails 项目吗 at 2018年02月09日

    正在用 modori.rb 做 api 哈哈

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