Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
ian
@doitian
高级会员
第 186 位会员 / 2011-11-23

皮匠科技
杭州
22 篇帖子 / 849 条回帖
42 关注者
1 正在关注
13 收藏
GitHub Public Repos
  • live2dviewer 76

    Live2D 模型批量查看器

  • dotfiles-public 14

    My configurations

  • knowledge-base 5

  • ckb-sdk-python 2

  • readwise-scripts 2

  • zotero-actions-tags-sc... 2

    Scripts for the Zotero plugin windingwind/zotero-actions-tags

  • lnd-grpc-tonic-client 2

    Rust lnd client using tonic and tonic-openssl.

  • http-inspector 1

  • dotfiles 1

    dotfiles managed using saltstack

  • userstyles 0

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 受不了 Emacs 的缩进了,求指点 at 2013年12月11日

    其实 Emacs 对 if 的缩进是 ruby style guide 里推荐的方式,觉得太长了可以 if 之前换行

    a =
      if foo
        1
      else
        2
      end
    
  • 受不了 Emacs 的缩进了,求指点 at 2013年12月11日

    https://github.com/zenspider/enhanced-ruby-mode 这个缩进比 ruby-mode 好很多,不过不稳定,比较慢,有时候会假死。ruby-mode 可以调整的参数比较少,调整一块又会影响到另外的地方。

  • DHH 再次重申,Rails 项目应该拥抱 SJR,别去整啥 JSON-Client render 方案。 at 2013年12月11日

    还从没正儿巴紧整过 RJS。最大的问题应该是测试吧,js 东一团西一团,要测也只能上 selenium 这样重要级的东西。

  • 不小心点到了 feed at 2013年12月10日

    估计是 tuborlinks 的问题

  • 代码里可以贴图了? at 2013年12月10日

    应该是在编辑器里也用了 Icons 那个字体。

  • 如何以非 root 用户将应用绑定到 80 端口-ssh 篇 at 2013年12月09日

    可以用 haproxy,配置下后台只需要起一个服务就行了。

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

    #22 楼 @ashchan 所以说太小众,和其它工具集成就会稍微麻烦点

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

    #20 楼 @ashchan rvm 和 rbenv 都只要 .ruby-version 或者 .rbenv-version 这些文件指定版本就好了

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

    #18 楼 @ashchan 选版本得自己改 .powrc 不方便

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

    #1 楼 @xds2000 太小众也不好啊,很多工具就不支持了,比如 pow

  • ctags 替代物: ripper-tags at 2013年12月08日

    #4 楼 @aptx4869 是不是你 ctags 时候配置了什么去包含 gems,用 ripper-tags 的时候没有加上?像 has_many 这些方法去是 gems 提供的,只索引应用目录下的文件肯定就不包括了。

  • [2014年1月11日] 五地 Rails Girls 北京 & 成都 & 西安 & 深圳 & 广州 & 上海 Tutors 召集 at 2013年12月07日

    包邮国已经独立了?

  • 搭建属于自己的 Travis Pro 服务 at 2013年12月06日

    用 pull request 那个插件是不是所有 pull requests 的 build 都在一个任务里?这样任务历史会比较混乱吧。

    之前用的是 http://entagen.github.io/jenkins-build-per-branch/ 会用一个 job 作为模板,为每个 branch 创建个新的 job。不过就是 PR 的状态要自己用 API 在 build script 里设置下

  • 买了个 apple care at 2013年12月06日

    #4 楼 @lululau 大件没有

  • 买了个 apple care at 2013年12月06日

    #2 楼 @lgn21st Macbook Pro 应该是两年变三年,国内主要部件都是包两年

    http://www.apple.com/cn/support/warranties/

  • 买了个 apple care at 2013年12月05日

    一年保修变两年。而且有两次意外损坏的修理,只需要付出比较低的服务费,也就是不保修的一些损坏,现在你付一些服务费就可以修了,不然是要按照实际维修的费用出的。

  • 用 Arch linux 的进来看看,最近更新系统你们遇到过这个问题没有?[更新,解决方案] at 2013年12月01日

    太久没更新,步子迈太大了

  • 关于 ruby array `dup` 很诡异 的问题 at 2013年11月29日

    #3 楼 @jhjguxin deep_dup 只是对嵌套的 hash 递归拷贝。你这个是数组里套 hash。

    循环的时候数组元素是直接传 (准确说是转引用,就像调用了个方法 do_something(a[0]) 给 block 的,所以你用到 delete 这种 in place update 的方法,就会影响到数组中存的元素,因为它们指向同一个对象。

    如果你想找出附合某个条件的东西,又想做修改,又不想影响原来的数组,应该是拷贝你要修改的数组元素,而不是数组本身。

    a.select { |e| [1].include?(e[:a]) }.collect(&:dup).each { |e| e.delete(:a) }
    
    # 或者用 Rails 的 Core Extension 里的 except
    a.select { |e| [1].include?(e[:a]) }.collect { |e| e.except(:a) }
    
  • 关于 ruby array `dup` 很诡异 的问题 at 2013年11月28日

    a.dup 是 dup 的 array。里面的成员并没有 dup

    2.0.0 (main):0 > a = [{}]
    [
        [0] {}
    ]
    2.0.0 (main):0 > a.object_id
    70243821092280
    2.0.0 (main):0 > a.first.object_id
    70243821092660
    2.0.0 (main):0 > b = a.dup
    [
        [0] {}
    ]
    2.0.0 (main):0 > b.object_id
    70243877001940
    2.0.0 (main):0 > b.first.object_id
    70243821092660
    2.0.0 (main):0 > a.first.object_id == b.first.object_id
    true
    
  • RubyConfChina 2013 大会视频 (更新下载链接) at 2013年11月28日

    #31 楼 @windix 👍 我更新下

  • 2013 RubyConf China 收获分享 at 2013年11月26日

    👍

  • 发现 InfoQ 已经上传了 RubyConfChina 2013 的视频了 at 2013年11月24日

    整理了下,相关视频里找得到的

    • http://www.infoq.com/cn/presentations/maintainable-rails-view
    • http://www.infoq.com/cn/presentations/rails-project-architecture-evolution
    • http://www.infoq.com/cn/presentations/the-use-of-ruby-in-jingdong-cloud-engine
    • http://www.infoq.com/cn/presentations/from-craftsmen-to-artists-from-programmers-to-designers
    • http://www.infoq.com/cn/presentations/with-tests-found-a-better-object-oriented-design
    • http://www.infoq.com/cn/presentations/ruby-encoding-happy
    • http://www.infoq.com/cn/presentations/somethings-about-rspec
    • http://www.infoq.com/cn/presentations/experience-of-migrated-to-jruby
    • http://www.infoq.com/cn/presentations/more-about-the-secrets-of-git-and-github
    • http://www.infoq.com/cn/presentations/combination-ror-and-better-startup-strategy-in-business
    • http://www.infoq.com/cn/presentations/fanatical-sentiment-of-ruby-community-fanatics
    • http://www.infoq.com/cn/presentations/simplify-and-retreat-for-improvement
    • http://www.infoq.com/cn/presentations/build-a-sync-like-async-web-server
    • http://www.infoq.com/cn/presentations/rails-application-testing-happy
    • http://www.infoq.com/cn/presentations/write-a-ruby-web-server-for-nodejs
    • http://www.infoq.com/cn/presentations/from-classes-to-objects-oop-taught-me-these-things
    • http://www.infoq.com/cn/presentations/hidden-gems-inside-those-of-Ruby-on-rails
  • CSS 解决 field error 的重复代码 at 2013年11月23日

    #1 楼 @pepsin 可以在不支持的浏览器 fallback 到用 JavaScript 添加

  • 谁给推荐一款 Android 端的 Podcast App at 2013年11月19日

    #2 楼 @cod7ce 好吧,你那是日元

  • 谁给推荐一款 Android 端的 Podcast App at 2013年11月19日

    有看到推荐 Pocket Casts 的,评分蛮高,价格 4 刀,自己没用过。

    #2 楼 @cod7ce 现在这么贵啊,我是以前直接到开发者的网站上买的,才 7 刀

  • 我如何把薪水从 50 人民币 / 天 提升到 100 美元 / 小时的 (4) -- 已更新 at 2013年11月18日

    帅气

  • Grape 如何实现不需要重启服务器,自动编译 reload at 2013年11月18日

    http://stackoverflow.com/a/9238856/667158

  • [远程] 帮这次 Rubyconf China 2013 的讲师 Jack 招一个 freelancer at 2013年11月13日

    这个 rate 不错,一年折算 2000 小时,按 6 元的汇率,一年有 35 万到 50 万

  • 如何获取进程号? at 2013年11月11日

    通用的方法是用 find 或者 find 搭配 xargs。也可以用专门的 pkill 和 pgrep

  • rails 数据迁移问题 at 2013年11月07日

    因为你数据库已经有这张表了,如果你要创建的是一样的表,也没有数据需要保留,就手到在数据库里删除掉,然后跑下 migration。如果想保留,也可以先把 db/migrate 下相应的创建表的行注释掉,跑完后再注释回来。如果还是觉得麻烦,而且你确定当前数据库不用跑任何 migration 就是最新的状态,也可以直接手动在数据库的 schema_migrations 里添加记录。这张表里记录的是所有已经执行过的 migration 的版本,也就是文件名最开始的那一串时间戳。

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