Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
jan
@jan
高级会员
第 100 位会员 / 2011-11-15

杭州
1 篇帖子 / 60 条回帖
36 关注者
0 正在关注
6 收藏
Two against the world.
GitHub Public Repos
More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • [杭州][9.16 - 17] RubyConf China 2017 主题分享征集 (已更新主题) at 2017年06月04日

    可以讲 Ethereum 吗?😀

  • Turbolinks 引发的微信浏览器 BUG at 2015年10月31日

    不仅是微信,其他的某些浏览器也会有这个问题。

    position: absolute我这里也不行,最后索性通过 media query 在小屏幕上把 progressbar 给隐藏了:

    html.turbolinks-progress-bar::before {
      display: none;
      height: 0 !important;
    
      @media (min-width: $screen-sm-min) {
        display: block;
        background-color: $primary-color !important;
        height: 2px !important;
      }
    }
    
  • 做 Web 前后端开发,Mac 苹果电脑,是最佳装备吗 at 2015年10月21日

    当然不是,linux 足矣。

  • Grape 的 JSON 参数验证,以及 nested params 问题 at 2015年08月30日

    传 json 参数要设置 Content-Type header 为 application/json, grape 会调用自带的 Grape::Parser::Json 去解析。

    可参考 API Data Formats 文档:https://github.com/ruby-grape/grape#api-data-formats

  • 为什么都说 Devise 很慢? at 2015年08月27日

    rails 本来就是大而全的东西,devise 的做法相当 rails way. rails 同样自带 erb 模板引擎和 i18n 数据。

    要达到所谓的“容易定制”很简单,像其他 gem 一样选择不做一些事情就行。结果什么都自己写,自然好定制。

    无意说哪种更好,只想说 rails 和 sinatra 各有自己的场景。

    如果有 gem 和 devise 能力大致相同,却比 devise 容易定制,相信社区会用脚投票。

  • [已解决] 怎么生成 UUID?用 Gem?用 Rails 自带的?用 Ruby 自带的? at 2015年08月26日

    SecureRandom 生成的是 UUID v4, 不是真正的 unique, 利用随机数来保证碰撞概率很小。正如 wiki 所说,碰撞概率很小,可惜有个前提:

    However, these probabilities only hold when the UUIDs are generated using sufficient entropy. Otherwise, the probability of duplicates could be significantly higher, since the statistical dispersion might be lower. Where unique identifiers are required for distributed applications, so that UUIDs do not clash even when data from many devices is merged, the randomness of the seeds and generators used on every device must be reliable for the life of the application. Where this is not feasible, RFC4122 recommends using a namespace variant instead.

    uuid gem 产生的 uuid 是用 mac+timestamp+local sequence, 代码简单明了。twitter 当年的 snowflake 是同样的思路 https://blog.twitter.com/2010/announcing-snowflake

    分布式场景下 uuid 是最方便的选择,sequence 很难,有兴趣可以 google。

  • 又一个新的 JS 框架 Flight -- 出自 Twitter at 2015年06月14日

    Flight 不是这个时代的东西,不用考虑了。

    https://twitter.com/necolas/status/582673863588192256

  • Rails 开发:那些年,我们一起踩过的坑 (剧终) at 2015年03月24日

    楼主好文章,对架构的分析很赞同。实际项目中多次看到自发形成的 service, presenter 之类,但正如楼主说的,这么多路,没一个是官方扶持的 (或者说是主流的),也许才是最大的问题。不是所有项目都能遇到这一个坑,遇到坑自行绕路的又各自在踩坑 :)

  • [remote] 寻 Ruby Expert 加入 Startup at 2015年01月26日

    支持楼主招人。

  • [北京 / 远程] 墨刀 (MockingBot) 招聘 Rails 全栈工程师 at 2015年01月12日

    很棒的产品,第一次看到要求里面有 React 的,支持~

  • 你们都是如何调试的 at 2015年01月01日

    p is the ultimate debugger.

  • 理解红黑树 at 2014年11月05日

    服

  • 继 Lotus 之后,又来一个新轮子 Roda at 2014年08月12日

    和 lotus 没什么可比性。

  • [成都]2014年8月23日,Ruby 社区聚会! at 2014年08月06日

    报名看活的!激动!

  • 谁可以给我个用 Grape 写 API 的项目的源码或者 example at 2014年07月08日

    @wangping Peatio 的 API 也是 Grape 写的,基本上一个资源一个文件 https://github.com/peatio/peatio/tree/master/app/api/api_v2

    另外还用了 grape-swagger 来生成 API 文档 https://github.com/tim-vandecasteele/grape-swagger

  • [你还不用 pg?] 坑爹的 MySQL 事务 at 2014年05月25日

    @baibaluo +1

    我觉得 mysql 的实现没有什么问题,基于 multiversion concurrency control 实现的 isolation level, 和锁没有必然联系。

    pg 的 isolation level 实现本来就是强于 sql 标准的 (见 pg 自己的文档),不能当作标准说事。

  • [杭州][2014年2月23日] 杭州 RubySunday 线下活动召集 (周日) at 2014年02月17日

    👏

  • 写了一个中文词语语义相似度分析的 gem-tyccl (基于同义词词林) at 2014年01月26日

    好有趣的 gem :thumbsup:

  • [杭州] ThePlant 招聘 at 2014年01月24日

    好公司 :thumbsup:

  • 你选择 Angular 还是 Ember? at 2014年01月22日

    #16 楼 @darkbaby123 赞,学习了

  • 支持多音字的汉字转拼音 ruby-pinyin 0.3.0 发布了 at 2014年01月10日

    @huacnlee 发布了 0.4.0, 体积减小了 25%

    另外根据使用频率调整了多音字的发音。

  • 支持多音字的汉字转拼音 ruby-pinyin 0.3.0 发布了 at 2013年12月30日

    #21 楼 @song940 是的,打算在 major version 变动的时候改 api

  • 支持多音字的汉字转拼音 ruby-pinyin 0.3.0 发布了 at 2013年12月30日

    #23 楼 @huacnlee 恩,下一步打算把内存占用优化一下

  • 支持多音字的汉字转拼音 ruby-pinyin 0.3.0 发布了 at 2013年12月30日

    #15 楼 @quakewang 这个对我来说难度太高了..

    如果更喜欢自定义字库或者有其他什么原因想要 fallback 到之前按字注音的,可以这样配置一下:

    PinYin.backend = PinYin::Backend::Simple.new
    
  • 支持多音字的汉字转拼音 ruby-pinyin 0.3.0 发布了 at 2013年12月30日

    #14 楼 @huacnlee 词库大小我也纠结了挺久,最后还是带上了,主要是觉得现在的主流配置还是能接受的,就是安装的时候可能会慢一点,不过用 ruby.taobao.org 的话也没啥感觉 :) 这样先解决 correctness, 在考虑效率之类的问题

  • 支持多音字的汉字转拼音 ruby-pinyin 0.3.0 发布了 at 2013年12月30日

    #13 楼 @shiny 我自己整理的,保留版权,但是你可以随意使用,注明出处就好 :) 目前有 17 万词左右

  • 支持多音字的汉字转拼音 ruby-pinyin 0.3.0 发布了 at 2013年12月30日

    #5 楼 @huacnlee 是给“词”做了一个数据库,因为多音字在一个词里面的读音是确定的

  • 支持多音字的汉字转拼音 ruby-pinyin 0.3.0 发布了 at 2013年12月30日

    #7 楼 @cisolarix 目前用的 rmmseg-cpp, 看看效果先

  • [姨妈] 终于把 rvm 换成 rbenv 了 at 2013年12月14日

    rubygems-bundler 自作聪明 +1

  • ruby 时间区间判断 at 2013年11月30日
    a.cover?(Time.now)
    
  • 1
  • 2
  • 下一页
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English