Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
屎丸
@lithium4010
Member
NO. 8744 / 2013-08-19

上海
38 Topics / 613 Replies
11 Followers
47 Following
35 Favorites
GitHub Public Repos
More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 推荐大家使用 ruby:2.5.1-alpine 镜像 at May 18, 2018

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

  • 如何使用 Sidekiq 进行异步处理 at May 18, 2018

    后来好像又加上了。。。

  • 请教一个 each_with_object / inject /tap 相关 更优雅的写法 at May 17, 2018

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

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

    https://webassembly.org/roadmap/

  • 50 行 Ruby 代码写一个区块链 at May 11, 2018

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

  • Ruby 用 jemalloc 有什么坑么? at May 08, 2018

    使用 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 May 07, 2018

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

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

    把消息内容算到 auth_token 里面

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

    消息里面带 auth token

  • ==, eql? , === 核心类 Override 一览表 at May 06, 2018

    申请+精

  • Whenever 每 20 秒执行任务 at May 03, 2018

    这样不准

  • 论坛里面杠精很多,有没有人有同感? at May 03, 2018

    一个扎克特梨

  • 如何实现实时的并行处理 at April 29, 2018

    parallel 了解一下

  • Rails 5.2 中的 Credentials 和 Active Storage at April 29, 2018

    感谢分享

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

    玩了一下不好玩。。。

  • 谈谈我对 Python 的看法 at April 29, 2018

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

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

  • 谈谈我对 Python 的看法 at April 28, 2018

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

  • 大佬帮忙看下 小弟初学 rails 使用 gem devise 报错 at April 27, 2018

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

  • 大佬帮忙看下 小弟初学 rails 使用 gem devise 报错 at April 26, 2018

    贴下你的 routes.rb application_controller.rb

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

    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 April 17, 2018

    看完,记住,下一篇

  • Ruby 应用服务器的新选择 - Nginx Unit at April 14, 2018

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

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

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

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

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

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

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

  • define_singleton_method 时调用自身原来方法 at April 13, 2018
    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 April 13, 2018

    对

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

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

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

    我赚了

  • 有考虑使用 Sinatra + ActiveRecord 替换你的 Rails 项目吗 at February 09, 2018

    正在用 modori.rb 做 api 哈哈

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