Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
@gihnius
会员
第 6061 位会员 / 2013-03-10

广州
31 篇帖子 / 335 条回帖
5 关注者
0 正在关注
52 收藏
GitHub Public Repos
  • jquery.qeditor 35

    This is a simple WYSIWYG editor with jQuery.

  • http-pinger 20

    A simple tool to check website status and notify via email.

  • cl-common-blog 18

    a blog engine written in common lisp

  • gomemoize 11

    memoization function in Go

  • hunchentoot-secure-cookie 9

    encodes and decodes authenticated and optionally encrypted cookie values.

  • freebsd-wifi 7

  • ht-routes 7

    route mapping and dispatching URL's for Hunchentoot in Common Lisp.

  • gosanitize 6

    Gosanitize is a whitelist-based HTML sanitizer in Go language. Given a list of acceptable element...

  • rdb-backup 5

    redis rdb backup

  • redis_online_counter 5

    Counting online users with Redis and Go.

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 用 gsub 把'\'变换为'\\'的问题 at 2016年10月30日

    #5 楼 @msl12 这个 #1 楼 不是说了嘛,因为 back-reference 呀。

    str.gsub(/\\/, '\\\\\\\\')
    # gsub 把 MatchData 存放到 \&, \1, \' 这些 back-reference 里面
    str.gsub(/\\/) { '\\\\' }
    # 在 block 里就要自己处理 MatchData, 没有 back-reference 可以用。
    
  • Sidekiq 任务调度流程分析 at 2016年10月30日

    怎么这么能写?!

  • 用 gsub 把'\'变换为'\\'的问题 at 2016年10月30日

    #3 楼 @msl12 这个是基础,定死的

    '\'' == "\'"
    
    '\\' == "\\"
    
  • 用 gsub 把'\'变换为'\\'的问题 at 2016年10月29日

    简单说就是单双引号对转义符 '\' 的解释问题。

    ruby 里返回字符串都是以双引号包着的。

    你 puts str.gsub(/\\/, '\\\\\\\\') 才能看到真相。

    启发:

    '\a\b' == "\a\b"
    'a'.bytes
    '\a'.bytes
    "\a".bytes
    
  • Ruby 数组的 减法是通过什么判断两个对象是否相等的? at 2016年10月24日
    [84] pry(main)> show-doc Array#-
    
    From: array.c (C Method):
    Owner: Array
    Visibility: public
    Signature: -(arg1)
    Number of lines: 11
    
    Array Difference
    
    Returns a new array that is a copy of the original array, removing any
    items that also appear in other_ary. The order is preserved from the
    original array.
    
    It compares elements using their #hash and #eql? methods for efficiency.
    
       [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ]  #=>  [ 3, 3, 5 ]
    
    If you need set-like behavior, see the library class Set.
    
  • [北京] 甲骨文社交云平台团队招聘 Ruby 软件开发工程师 at 2016年09月26日

    等题...😀

  • [远程] DeepDevelop 团队诚聘 Rails 工程师 at 2016年08月21日

    远程就支持

  • 如何在 block 区块内提早返回? at 2016年08月02日
    catch(:return_from_here) do
      # ...
      throw(:return_from_here) if not_happy
      #...
    end
    
  • 建议去掉登录验证码 at 2016年07月20日

    不用去验证码,记住密码的时间再设长一点就好,比如一个月或更长。

  • A simple and fast JSON API template engine for Ruby on Rails at 2016年07月19日

    不错

  • [广州] (外资) 诺特软件 诚招 Ruby 技术顾问 1 人,Ruby 开发工程师 2 人 at 2016年06月15日

    贵公司的一连串招聘帖图片:你们多长时间没再搞活动啦?😆

  • jquery.qeditor 编辑器的 Bootstrap3 版本 at 2016年06月12日

    #9 楼 @runup 没有打包,直接可以引用 dist 目录下的 js/css, 不需要安装。 这个实现过于简单,在完全正确的输入下没有什么问题,但使用多的话你会发现有很多问题没有处理到。

  • jquery.qeditor 编辑器的 Bootstrap3 版本 at 2016年06月11日

    #7 楼 @runup 这个编辑器实现过于简单,不再建议使用。 使用方法在 Readme 有吧。

  • 广州适合程序员周末写代码看书学习的地方有推荐的吗? at 2016年04月24日

    曾经在星巴克呆过大半年时间,脸皮够厚吧!

  • 广州适合程序员周末写代码看书学习的地方有推荐的吗? at 2016年04月24日

    星巴克,找个人少一点的。

  • Rails 中一个常量的奇葩问题 at 2016年04月24日

    关键词:autoload, eager_load, const_missing

  • ActiveRecord 用 bulk_insert 来批量插入数据,提高效率 at 2016年04月07日

    postgresql 直接 copy 暴快

  • where 的一个蛋疼设定 at 2016年03月31日

    #16 楼 @gihnius 下班了,找了一堆解决方案:Ordering a query result set by an arbitrary list in PostgreSQL Raw,缺点是都要写 sql.

    参考:http://wiki.postgresql.org/wiki/Array_Index

  • where 的一个蛋疼设定 at 2016年03月31日

    同样遇到这个问题,数据库是 poatgresql 目前采用跟#14 楼一样的方法,更蛋疼的是还要考虑 id 找不到的情况,查询结果要对齐。

  • 为啥没人讨论下引力波?听说 Python 立了大功了~~ at 2016年02月17日

    Python 生来就是冲着搞科学计算的

  • [深圳] DJI 大疆创新 Q1 招聘 Ruby 工程师 3 + 2 名 (saberma 内推 15-30k) at 2016年02月17日

    不错

  • 诸君!我好兴奋啊! at 2016年02月17日

    #11 楼 @rubyu2 :plus1:

  • 目前 Ruby 代码维护是如何保证质量的? at 2016年02月17日

    目前严格按照 https://github.com/bbatsov/rubocop 建议写 ruby,装 emacs 插件自动提示,很好用。

  • Rails association 中的 foreign keys at 2016年01月05日

    之前 rails 的 references 关联的确没有做数据库层面的外键约束,rails 偏向使用 validation (rails level) 处理类似的约束。

    但 rails 4.2 增加这个功能,可以去看看 add_foreign_key 这个 api.

  • 有推荐一下好用的 Rails editor 吗? at 2015年12月18日

    basecamp 那个好像不错:https://github.com/basecamp/trix

  • 一个 String 类型处理不当导致的性能问题,在导出 CSV 文件等场景不注意就会中招 at 2015年12月18日

    #6 楼 @quakewang 把过多的数据保存在 ruby 对象里都不好,为什么不直接追加到文件里?

  • 期待 Rails enum 的新功能 at 2015年12月18日

    好像还不能加 prefix, 还得用 Enumerize

  • 2013-2015年 RubyChina 招聘数据关键词统计 at 2015年12月18日

    #11 楼 @qinfanpeng 图表应该是 Baidu ECharts 吧 😄

  • 大家前端用嵌入 Erb 还是用 Haml 呢? at 2015年12月06日

    erb

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