Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
@zhufenggood
高级会员
第 743 位会员 / 2012-01-11

北京
5 篇帖子 / 77 条回帖
1 关注者
1 正在关注
11 收藏
未设置 GitHub 信息。
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Devise 提交验证不错,不知这是哪个 Gem 搞的鬼 at 2018年03月14日

    执行rails generate simple_form:install 试试,好像 simple_form 的一个 bug,升级版本后原有 simple_form 配置文件就错乱了。表单验证对也报错。

  • 前后端分裂 at 2018年01月10日

    像 Gitlab 那样,局部交互复杂的部分用 Vue 前端 mvc 就好,比如 CI/CD 页面里的 pipelines 部分

  • 请教 RubyMine 问题:为什么 before_action 没有智能提示? at 2017年11月21日

    https://github.com/rails/rails/blob/master/actionpack/lib/abstract_controller/callbacks.rb#L186 这几个 callback 方法是元编程出来的,RubyMine 对 dynamic 出来的代码智能提示一般。

  • RubyConf China 2016 视频 at 2016年10月28日

    http://pan.baidu.com/s/1pKFtjw3

    youtube-dl -f 'bestvideo[height<=?1081] + bestaudio/best' u2b 1080p 搬运完了,播放没有声音的话,需要安装支持 webm opus 音频的播放器。

  • 部署的时候 bundle install 能否只有添加新的 gem 才执行 at 2016年08月11日

    第一次 bundle install 以后,gem 没有变动的话。 bundle install --local 如果 gem 已经下载到本机内,只是 using 一下速度很快的。

  • 各位觉得现在该入手 Macbook Pro 吗? at 2016年03月31日

    小道消息 rMBP 9 月换模具更新

  • 新版 MacBook 完全没风扇了 at 2015年03月10日

    http://arstechnica.com/apple/2015/03/hands-on-with-the-retina-macbook-one-port-wonder/ Core M 性能和 12 年的 MacBook Air 差不多,性能不如 13 和 15 年的 Air http://store.apple.com/us/product/MJ1K2AM/A/usb-c-digital-av-multiport-adapter 想外接显示器还得花 500 块买转接器。

  • 请教个 vim 问题 at 2014年07月03日

    set shellcmdflag=-ic

  • 你觉得它会输出什么? at 2014年03月01日

    #4 楼 @luikore 浏览器相关的,Firefox 结果就是'first'

  • string.scan 问题 at 2014年01月20日
    " sss\1\2abcd\xAA sss ".force_encoding('ASCII-8BIT').scan(Regexp.new '\001[\002\004](.{4})\xAA', nil , 'n')[0] #if RUBY_VERSION >= "1.9"
    
  • ruby round down 三位小数 at 2014年01月19日
    '%.3f' % 1.2345
    
    sprintf '%.3f', 1.2345
    
  • 靠,遇到骗子了!大家过年了小心点啊! at 2014年01月17日

    以后再遇到骗子和推销的电话,直接来一句:"其实啊,咱们是同行“,挂掉就行了。

  • 令人苦恼的性能问题 at 2014年01月15日

    http://tmm1.net/ruby21-profiling/

  • 有人成功开启过 Dash 里面的 Ruby Gems 吗? at 2014年01月09日

    Dash 不能识别 Rdoc 4.1.0 生成的 html rdoc 文件。 刚打开 Dash 能识别几个 Gem 的 Doc,看了下 Rdoc 4.1.0 和 Rdoc 3.x.x 生成的 html 文件开头标签有些不一样,可能 Dash 就识别不了。必须生成的是 HTML 格式的 doc, .ri 格式 Dash 肯定也不能识别。 试了试换了 rdoc 3.9.5 就能识别。 gem uninstall rdoc gem install rdoc -v '3.9.5'

    gem rdoc --rdoc --all --overwrite 重新生成文档 要是旧版本的 rdoc 生成 doc 过程中有 encoding error 问题的话

    export LANGUAGE=en_US.UTF-8
    export LANG=en_US.UTF-8
    export LC_ALL=en_US.UTF-8
    

    写到.bashrc 或.zshrc 中,让 rdoc 默认使用 utf-8 就没问题了。

    再打开 Dash 重新导入下 Ruby Installed Gems Docset,设置好要 index 的 gempath

  • 分享:如何阅读 ruby 项目 源码 at 2014年01月05日

    把下面一段代码添加到 .irbrc 或者 .pryrc 文件中

    def source_for(object, method_sym)
      if object.respond_to?(method_sym, true)
        method = object.method(method_sym)
      elsif object.is_a?(Module)
        method = object.instance_method(method_sym)
      end
      location = method.source_location
      `mvim #{location[0]} +#{location[1]}` if location
    rescue
      nil
    end
    

    用 Ruby 的反射找出方法定义的源代码的位置,再用 mvim 打开

    随便找了一个 Sinatra 的项目用 irb 或者 pry load,直接用 source_for 很快就能找到方法定义了

  • Ruby Hacking Guide 的 Ruby 源代码里的 REAME.EXT.ja 用 macvim 打开乱码 at 2013年12月28日

    :set enc=euc-jp

  • 笔记本收到一周,发帖纪念一下,另外求解两个疑问 at 2013年12月25日
    • Testing conducted by Apple in October 2013 using preproduction 2.3GHz quad-core Intel Core i7–based 15‑inch MacBook Pro units, preproduction 2.0GHz quad-core Intel Core i7–based 15‑inch MacBook Pro units and preproduction 2.6GHz dual-core Intel Core i5–based 13‑inch MacBook Pro units. The wireless web test measures battery life by wirelessly browsing 25 popular websites with display brightness set to 12 clicks from bottom or 75%. The HD movie playback test measures battery life by playing back HD 720p content with display brightness set to 12 clicks from bottom or 75%. The standby test measures battery life by allowing a system, connected to a wireless network, to enter standby mode with Safari and Mail applications launched and all system settings left at default. Battery life varies by use and configuration. See www.apple.com/batteries for more information.

    用 Safari 没有 Flash 测的电池数据,要是 Chrome+Flash 肯定就要少很多。

  • 好像 Ruby 的性能问题始终是个大问题啊! at 2013年12月21日

    用 2.1.0-preview2 跑了下,比 2.0 快了不少了,已经比 python3.3 快了

    $h[pos], $h[j] = $h[j], $h[pos]
    

    写成

    tmp = $h[pos]
    $h[pos] = $h[j]
    $h[j] = tmp
    

    就能快不少 优化前:68091 优化后:58694

  • Devdocs - 很棒的在线文档整合应用 at 2013年11月26日

    不错,终于能抛弃 Dash 了 😄

  • CSS 解决 field error 的重复代码 at 2013年11月23日

    学习了

  • 10.9 下一些后台程序是不是会被限制性能? at 2013年11月23日

    估计是被 Mavericks 的 app nap 了。打开迅雷以后最小化或者迅雷界面被挡以后就被 app nap,就没有速度了。 在 Finder 中找到迅雷,找到应用的图标后,右键并选择显示简介在打开的窗口中,勾选 防止 App Nap 即可。

  • 升级到 Mavericks 出现的问题 at 2013年10月24日

    Mplayer 从 Mac AppStore 装的就有问题,从 mplayer 官网下载安装的版本重新装一遍就没事。

    Mavericks 感觉挺好,iWork 3 件套洗白了 😄

  • Ruby Hacking Guide 英文翻译完成 at 2013年10月03日

    转换好的 epub 和 mobi 格式下载
    http://pan.baidu.com/s/188moY epub 格式还是小问题,要是在意的话,可以 iOS 设备上下载 kindle 看 mobi 格式或者直接用 kindle 看 mobi 😄

  • Ruby Hacking Guide 英文翻译完成 at 2013年10月02日

    http://patshaughnessy.net/ruby-under-a-microscope http://nostarch.com/rum Ruby Under a Microscope 这本比较新

  • Writings 开源 at 2013年09月28日

    支持,学习下。

  • [UCloud 开源接力]#[email protected]# at 2013年09月24日

    抢楼

  • [UCloud 开源接力]#[email protected]#19wu at 2013年09月24日

    抢楼

  • [UCloud 开源接力]#[email protected]#union at 2013年09月24日

    抢楼

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