Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Jianqiu Xiao
@swordray
会员
第 6291 位会员 / 2013-03-23

北京
24 篇帖子 / 557 条回帖
22 关注者
3 正在关注
0 收藏
打赏作者
GitHub Public Repos
  • ruby-china-ios 159

    Ruby China app for iOS

  • ispinner 54

    Pure CSS spinner like iOS UIActivityIndicatorView

  • modular_migration 39

    Rails migration files generate into corresponding modular directories

  • JXWebViewController 29

    An iOS view controller wrapper for WKWebView

  • v2ex-ios 28

    An Unofficial V2EX iOS App

  • JXGradientNavigationBar 18

    Custom UINavigationBar subclass with gradient colors on iOS.

  • JXReviewController 16

    Request rating by 1-5 stars.

  • v2ex-android 15

    A V2EX Android App.

  • rails-cache_control 10

    Autotomicly add HTTP Cache-control header when caches_action expires_in specified

  • sass-lint-webpack 8

    Sass-lint plugin for Webpack 4+

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Ruby-vips 继续,尝试一了下 carrierwave-vips at 2019年04月03日

    对,我遇到的问题和你描述的应该是一样的,CarrierWave::Vips 的缩略图没有识别上一级 convert: 'jpg',我感觉是不太符合预期的,还是用 MiniMagick 能正确处理。

    class User::AvatarUploader < ApplicationUploader
      include CarrierWave::MiniMagick
    
      process convert: 'jpg'
    
      version :thumb do
        process resize_to_fill: [ 88, 88 ]
      end
    end
    
  • Ruby-vips 继续,尝试一了下 carrierwave-vips at 2019年04月01日

    CarrierWave::Vips替换CarrierWave::MiniMagick之后,转换格式process convert: 'jpg'这个处理就失效了,有遇到过吗

  • 多字段排序怎么写 at 2019年03月10日

    按字面意思写就好了

    array.sort_by(&:second).reverse.sort_by(&:first)
    
  • Ruby 中为何不支持列表构造 at 2018年10月15日

    是指 destructuring assignment(解构赋值)吧,可以在 Ruby 社区搜索一下

    https://bugs.ruby-lang.org/issues/8895#note-17

    The proposed syntax is much harder to implement than it looks. It conflicts with Hash literals. As a result, humans can be confused as well.

    Probably this kind of problems should be addressed by pattern matching, which we are considering to add to Ruby in the future.

    Matz.


    Update: 只有 Hash 解构不支持,数组是支持的

    list = [ 0, 1, 2 ]
    a, b, c = list
    
  • turbolinks 造成 Jquery 不正常怎么办? at 2018年10月09日

    去掉 turbolinks

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

    #2 楼 @huobazi 使用 iOS 原生技术开发,而非 HTML。

  • 如何从两个二维数组建立 range 对象并且进行遍历操作 at 2018年09月16日
    months = ((end_time - start_time.prev_month) / 1.month).to_i.times.map { |i| start_time + i.months }
    
  • CSV 文件如何做一个类似合并单元格的操作 at 2018年09月14日
    data.group_by(&:first).transform_values { |value| value.pluck(1) }
    
  • 数组->哈希, 指定元素求和的问题 at 2018年05月21日

    可以再迭代一下,减少中间变量和嵌套层次,尤其是避免同名变量。个人认为你这种思路是最符合直觉的了。

    arr.group_by(&:first).transform_values { |v| v.map(&:second).sum(&:to_i) }
    

    #1 楼 @IChou 忘记 at 了

  • Rails 5.2.0 RC1: Active Storage, Redis Cache Store, HTTP/2 Early Hints, CSP, Credentials at 2018年02月01日

    Active Storage 不支持校验或者事务,这一点上还是无法替代 Carrierwave

  • 环绕别名 at 2018年01月19日

    像大家说的 avatar 是动态定义的,很难保证执行顺序,所以现在一般用 prepend 取代 alias 的作用

    class User < ApplicationRecord
      module AvatarWithDefaultValue
        def avatar
          super || 'default value'
        end
      end
      prepend AvatarWithDefaultValue
    end
    
  • Rails Architecture Info-graphic at 2017年01月02日

    程序员的配色审美🙄

  • 怎样判断一个数组对象的维数是几维? at 2016年05月31日
    class Array
      def dimension
        select { |e| e.is_a?(Array) }.map(&:dimension).max.to_i + 1
      end
    end
    
  • [北京] 包拯招 Ruby、Javascript 工匠各一位 at 2016年05月17日

    #6 楼 @ayaseangle skim === skim

  • Rails 里如何对 Time 类型做验证呢? at 2016年03月18日

    gem 'validates_timeliness'

  • [成都] ActiveNetwork 又双叒叕来招 Ruby on Rails 工程师啦~ at 2016年03月04日

    #4 楼 @shawncui Rails 的模块名称不是一般都是 ActiveXxx

  • [成都] ActiveNetwork 又双叒叕来招 Ruby on Rails 工程师啦~ at 2016年02月29日

    公司名称很有 rails 范儿

  • Ruby China iOS App 开始支持 3D Touch 了 at 2016年02月28日

    #7 楼 @caiqinghua 不好意思哈,现在上班时间 996,没有时间做别的东西

  • Ruby China iOS App 开始支持 3D Touch 了 at 2016年02月09日

    #4 楼 @rubyfan1 还没收广告费呐😉 ~~

  • 全新的站内搜索上线 at 2016年01月06日

    求 API 支持

  • 感觉 Node.js 也是 MongoDB 的命,忽悠一帮小青年 at 2015年12月11日

    瞎说什么大实话呢

  • iSpinner:纯 CSS 实现的加载图标,类似于 iOS 的 UIActivityIndicatorView at 2015年11月24日

    #3 楼 @aidewoode 还有这个旋转是实现不了的,spinner-blade 的位置不变,只是透明度变化

  • iSpinner:纯 CSS 实现的加载图标,类似于 iOS 的 UIActivityIndicatorView at 2015年11月23日

    #3 楼 @aidewoode

    1、用 slim 写就可以了

    .ispinner.gray.animating
      - 12.times do
        .ispinner-blade
    

    2、字体还要额外制作和加载字体文件,不环保

  • iSpinner:纯 CSS 实现的加载图标,类似于 iOS 的 UIActivityIndicatorView at 2015年11月23日

    #1 楼 @cqcn1991 钟还简单,只有时分秒 3 个指针在转

  • RubyChina 有 iOS 客户端了嘛? at 2015年11月08日

    https://github.com/swordray/ruby-china-ios

  • 前端框架选择的一个现实的问题 at 2015年11月01日

    #13 楼 @luikore 其实电脑大部分也是 webkit 了,感谢某些流氓浏览器的极速模式

  • Ruby 将引入 ".?" Safe navigation operator at 2015年10月23日

    Swift 和 CoffeeScript 用的就很爽,现在终于轮到 Ruby 了~~~

  • 欢迎 3 位新的 Ruby China 社区管理员 at 2015年10月13日

    :plus1:

  • Ruby 的年龄计算 at 2015年10月13日
    year = 0.upto(100).find { |y| (y + 1).years.ago < birth }
    month = 0.upto(11).find { |m| (m + 1).months.ago < birth + year.years }
    day = 0.upto(30).find { |d| (d + 1).days.ago < birth + year.years + month.months }
    

    直觉上可以数出来,不过比较低效

  • [2015年9月28日] 下午三点左右,Ruby China 经受了一轮 DDOS 攻击 at 2015年10月02日

    8.8.8.8 DNS 好像好了

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