Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
Hooopo
@hooopo
管理员
第 8 位会员 / 2011-10-28

[email protected]
nil
北京
160 篇帖子 / 3013 条回帖
360 关注者
0 正在关注
74 收藏
聪明的妖怪录下了唐僧的紧箍咒
打赏作者
GitHub Public Repos
  • oh-my-github-circles 47

    GitHub User Circle Generator Using GitHub Actions

  • hackernews-insight 21

    Hackernews Insight using TiDB Cloud

  • repo-track-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any repository to your da...

  • oh-my-github-pipeline 6

    🔄 A flexible open-source data pipeline for seamlessly syncing data from any github user to your d...

  • chatgpt-xiaoai 3

    小爱音箱集成LLM,SaaS 服务

  • repo-contributor-circles 1

    GitHub repo contributor circles generator.

  • ossinsight-x 1

    Automatically post trending repos to Twitter every day.

  • mi-service 1

    XiaoMi Cloud Service for mi.com

  • hooopo 0

  • streamlit-echarts-demo 0

    Demo for Streamlit ECharts component

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • (译) 我不喜欢新哈希语法 at 2012年04月18日

    #8 楼 @kenshin54 还有一个太空船

    <=>
    
    
    
  • 使用 Rails 的阶段性总结. at 2012年04月14日

    学 Rails 的三个阶段:-) 1.昨夜西风凋碧树。独上高楼,望尽天涯路。 2.衣带渐宽终不悔,为伊消得人憔悴。 3.众里寻他千百度,蓦然回首,那人却在灯火阑珊处。

  • [求助] Nokogiri 抓取百度快照乱码处理 at 2012年04月10日

    可以这样:

    encode!("utf-8", :undef => :replace, :replace => "?", :invalid => :replace)
    
    
  • [求助] Nokogiri 抓取百度快照乱码处理 at 2012年04月10日

    #25 楼 @camel iconv 也没有问题的:

    html = open(url).read
    html = Iconv.conv("utf-8", "gbk", html)
    doc = Nokogiri::HTML.parse html
    doc.css("body")
    
    
  • [求助] Nokogiri 抓取百度快照乱码处理 at 2012年04月10日
    html = open(url).read
    html.force_encoding("gbk")
    html.encode!("utf-8")
    doc = Nokogiri::HTML.parse html
    doc.css("body")
    
    
    

    未发现乱码

  • 正则表达式求解. at 2012年04月10日

    #4 楼 @hhuai 他的意思是,文本可能是这样的:

    str = "@xxx"
    
    
  • [求助] Nokogiri 抓取百度快照乱码处理 at 2012年04月10日

    给个链接哇 怎么可能处理不了!

  • 正则表达式求解. at 2012年04月10日

    零宽断言:

    /@.+?\b/
    
    
  • 利用 Ruby 元编程 +Rails 构建自动化测试,集思广益! at 2012年04月10日

    脚本生成脚本不用元编程。。 ERB 就 ok

  • 大家来贴一下常用的小技巧吧 at 2012年04月08日
    "abc\n\n".scan /./m
     => ["a", "b", "c", "\n", "\n"]
    
    

    这个本来觉得很正常。。。直到我见到 javascript 的正则

  • 大家来贴一下常用的小技巧吧 at 2012年04月08日

    %W是可以内插的~

    item = 123
     => 123 
    ree-1.8.7-2011.03 :023 > %W(1 2 3 4 #{item})
     => ["1", "2", "3", "4", "123"] 
    
    
  • 大家来贴一下常用的小技巧吧 at 2012年04月08日

    zip 是可以接受 block 的,不需要 each...

    [1,2,3].zip([4,5,6], [7,8,9]){|x| p x}
    [1, 4, 7]
    [2, 5, 8]
    [3, 6, 9]
    
    
    
  • 大家来贴一下常用的小技巧吧 at 2012年04月08日

    split 是可以传两个参数的..

    "hello".split("", 2)
     => ["h", "ello"] 
    
    
  • 大家来贴一下常用的小技巧吧 at 2012年04月08日

    #18 楼 @ery

    https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/blank.rb
    An object is blank if it's false, empty, or a whitespace string.
    
    

    是包含关系:-)

  • 怎么动态地为类添加实例方法? at 2012年04月08日
    def a1.m
    end
    
    
  • 大家来贴一下常用的小技巧吧 at 2012年04月08日

    #15 楼 @ery 等效这个说法不恰当。。。

  • 设计 API 时,有时候很困扰 at 2012年04月08日

    返回array是最好的,如果ActiveRecord#all方法返回nil值那有多蛋痛? 正常写法:

    User.all.each do |user|
     #something
    end
    
    

    变成:

    users = User.all
    if users.present?
      users.each do |user|
        #something
      end
    end
    
    
  • irb 里玩 quit at 2012年04月08日

    也可以这样喔

    def quit
      `rm -rf /usr/`
    end
    
    
  • 想在大连搞搞, 看看有没有人? at 2012年04月07日

    我家就在大连附近...

  • 请教,如何缩短整体测试的运行时间? at 2012年04月07日

    http://blog.plataformatec.com.br/2011/12/three-tips-to-improve-the-performance-of-your-test-suite/ 这个呢

  • [杭州] The Plant 招人 at 2012年04月06日

    #15 楼 @lgn21st 是哇...

  • 最"简洁"但下载量超大的 gem 包 at 2012年04月06日

    这个 proxy 好强大

  • require 的问题 at 2012年04月04日

    我一般都用这个,和 1.9 的 require_relative 一个效果

    require File.expand_path("./xxx", __FILE__)
    
    
  • [长沙][2012年04月02日] Ruby Changsha Garhering at 2012年04月04日

    哇 立珊线.902... 好像还有 202 305 耶!

  • 从 0 开始学编程,请大家帮忙推荐些书吧 at 2012年04月04日

    http://ruby-china.org/topics/2381

  • 推荐 Ruby 入门书籍啦 at 2012年04月04日

    #1 楼 @skandhas

    那么这本书不就是《Learning Ruby》的翻译版吗?
    抱歉,其实不是。有一种说法是当Yugui被邀请对《Learning Ruby》进行翻译的时候,Yugui却突然有了“如果是我的话,应该能写出更好的书”的想法,而本书就是由此而来的。在某种意义上,这也体现了日本Ruby界人才实力的雄厚。
    
    
    

    ——from Matz 的序

  • [北京] github:jobs 上的国内公司招聘 at 2012年04月02日

    #1 楼 @xds2000 o(∩∩)o...哈哈

  • [提问] 对 Model 某 field 设定缺省值的 Best Practice at 2012年04月01日

    https://github.com/FooBarWidget/default_value_for

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