• @Jijin 哇,这么帅的 Markdown!赞!

  • @Jijin 表格的 Markdown 怎么写的,很漂亮。

  • TextMate 开源了 at 2012年08月10日

    30 Day Trial -> TextMate 1.5.11 (r1635) TextMate 2 at GitHub

    也就是说老的不变,新版本 2 开源,自己用随便,商用请联系作者

    blog贴过来吧:

    Today I am happy to announce that you can find the source for TextMate 2 on GitHub.

    I’ve always wanted to allow end-users to tinker with their environment, my ability to do this is what got me excited about programming in the first place, and it is why I created the bundles concept, but there are limits to how much a bundle can do, and with the still growing user base, I think the best move forward is to open source the program.

    The choice of license is GPL 3. This is partly to avoid a closed source fork and partly because the hacker in me wants all software to be free (as in speech), so in a time where our platform vendor is taking steps to limit our freedom, this is my small attempt of countering such trend.

    I am also a pragmatist and realize that parts of the TextMate code base is useful for other (non-free) applications, so I may later move to a less restrictive license, as is currently the case with the bundles. For now, please get in touch with us if there are subsets of the code base you wish to use for non-free software, and we might be able to work something out.

    Anything related to the code base, including contributions, can be discussed at the textmate-dev list or ##textmate on freenode.net. Pull requests can be sent via GitHub but if you plan to make larger changes, it might be good to discuss them first if you want to ensure that we are interested in accepting a pull request for such change or simply want advice on how to go about it.

  • TextMate 开源了 at 2012年08月09日

    怎么主页没有变化,还是写着 30 天试用

  • Moutain Lion 下安装 Ruby 1.9.3 at 2012年08月08日

    JewelryBox + 1

  • Otcopress + heroku = http://blog.neten.de

  • ;

  • 怎么没有继续了,github 上也是 四个月前

  • mongoid-tree mongoid (~> 3.0)

    mongoid_tree I’m about to upgade mongoid_tree to support Mongoid 2.0.0.rc.1.

  • mark, up, 顶,收藏,赞

  • @yedingding ruby-china 的时间在 hover 的时候也可以看,我才知道,不过这样已经很好了。

  • @poshboytl @yedingding @huacnlee 我喜欢加收藏了

    我有个小建议,这个功能虽然漂亮,但用户不一定都买帐。

    我本人作为一个程序员,有时候也很难体会用户细腻的小心思,心想这么贴心的功能我都实现了,多帅!

    有人却说,我就想知道那个人什么时候回的帖子,如果半夜二点还不睡觉,明天我就关心关心他,结果一看是 8 个小时前,或一天前,这些信息要么我还要算一下,要么对我根本没有用。

    我想想也有道理,能不能把时间做成一个锚点链接,默认是几分钟前,几天前,但如果点击一下可以显示年月日,时分秒,这样可能更帅!

  • 赞!

  • 网上找了一下, def email=(val) 应该就是 setter 的作用,也就是说用户注册给 email 赋值的时候,这个函数会提前把email_md5先赋值了。

    我奇怪的是,为什么email_md5是空的,这个字段文件开头也是定义过了的。

  • 谢谢 @huacnlee 回复,我是把所有用户都删除了再注册新用户来试的,看 4 楼的链接,很明显是那个 md5 出了问题,我如果直接把生成 md5 的代码放在 users_helper.rb 里面,头像就能正常显示。

    请问这个函数是不是用户一登录就会调用啊?

    def email=(val)
    。。。
    end
    
  • def email=(val)
      self.email_md5 = Digest::MD5.hexdigest(val || "")
      self[:email] = val
    end
    

    最后找到问题,似乎是 email_md5 没有值,上面那个函数在 app/models/user.rb 里面,我现在对这种跟 C++ 很大出入的函数还是有点头大,不知道 @huacnlee 能不能讲解一下,谢谢。

  • @huacnlee 昨天按你的教程把代码版本跟上来了,但是个人资料页(http://localhost:3000/account/edit)的头像不能正常显示了,我看了一下图像的链接是: http://gravatar.com/avatar/.png?s=120&d=404

    请问这个问题我要怎么改正?谢谢

  • 新发现的 ruby-china 的 bug at 2012年07月23日

    还是人肉测试厉害,这个 bug 估计 Rspec 写不出来

  • @fsword 能把 ppt 发上来吗,我一直都是人肉测试的

  • 习惯习惯就好了,虽然现在没看多少 devise 的代码,但能用能改了。

    目前在改 ruby-china 的代码,为了防注册机,加入社交元素,现已禁用注册,只允许用户通过 Omniauth( Google, Fackbook, weibo,douban, QQ) 注册。

    用户在 callback 的时候填写在本站的用户名和密码,如果像 weibo 那样的没有返回 email,还要让用户填写 email, 同时用 devise 发 comfirmation 的 email, 改动有点大,不过埋头看代码,过一段时间还是可以搞定的。

  • 我 php 下一直用这个,flash 的,效果相当好, http://teethgrinder.co.uk/open-flash-chart-2/

    回复了才看到原来不是要这个,那就给需要的人吧

  • @huacnlee 不仅是勤劳的小蜜蜂,还是大好人啊,这么快就回复了,我一定紧紧跟着,谢谢

  • @hxgdzyuyi 看了了下 vargrant,好像用的 ubuntu10.04,还是 32 位的,

    我自己也是在服务器 (16G 内存) 上放 virtualbox 虚拟机,用的是 12.04 的最新版,反正硬盘大,如果工作做得差不多了,把虚拟机停了,clone 一份,正式运行的时候生成一个/var 和/home 硬盘文件,这样保证和系统分开,出了问题直接把这两个硬盘文件挂在原来备份的系统盘上,马上搞定。

    我觉得虚拟机的方式比较简单靠谱,当然不好的地方就是服务器要过硬。

  • 用 Facebook 登录的问题 at 2012年07月19日

    这些天基本上自己摸索得差不多了,用户登录这一块,在我看来是个重头戏,考虑的问题会很多,就现在 ruby-china 的代码来看,会有很多问题。

    比如一个普通注册的用户哪天用 github 登录一下,结果就会生成了一个新用户,两个用户名还不能合并,如果是从新浪登录的,连 email 也没有,还要伪造一个 email,这个悲剧的用户还不能改 login 的名字,因为密码还是随机的,他没有这个密码也就改不了密码,所以他下次也只能从新浪登录。。。

  • @huacnlee @Rei 4 楼"九寨沟"的问题应该怎么改,指点一下,担心涉及很多文件,改了留下后患,谢谢

  • @Rei 我现在没看代码,难道改掉就可以了,这个 action 没有地方用吗?

  • @yzhrain 的经验:

    命名时请留意 Rails 下的关键字 http://yangzhihuan.iteye.com/blog/577657

  • @Rei 错误就是app/controller/users_controller.rb中有个def location, 但 rails 中会用到location这个字段,这样当 rails 给self.location赋值的时候,就会出错。

    另外的 bug 就是在这个页面 http://ruby-china.org/account/edit 请在城市那输入 "九寨沟",你看一下是不是到 404 去了?