Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
ian
@doitian
VIP
NO. 186 / 2011-11-23

皮匠科技
杭州
22 Topics / 849 Replies
42 Followers
1 Following
13 Favorites
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
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 一个关于 self 的问题 at April 25, 2012

    #2 楼 @ptmagic 隐含是指你不能显示指定接收者,即使接收者是 self。换句话说不能用 dot 操作符调用私有方法。

  • 除了 state_machine 还有没有更好的? at April 24, 2012

    #6 楼 @huacnlee 你这是不要 machine,只要 state ? 我用过 classy_enum 来生成个 enum 类,感觉还不错,不过 i18n 得自己弄。

  • Grape 的改动如何即时生效? at April 24, 2012

    要 reload routes

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

  • Ruby 程序员回家 Soho 好不好? at April 23, 2012

    #52 楼 @huobazi 没户口等于缴同样的税,享受不到同等的待遇

  • <=> 这个符号是什么意思? at April 22, 2012

    Comparable

  • Ruby China T 恤第二期的赠送名单公布 at April 22, 2012

    暴露 QQ 号了

  • 大家一般在哪写博客 at April 22, 2012

    好多时候直接 gist 了,又能贴代码又能 markdown,还带评论功能,而且每篇文章还是个单独的 git repo

  • 一些关于单页 JS App 的问题 at April 22, 2012

    #5 楼 @yedingding 要去上海么?

  • 一些关于单页 JS App 的问题 at April 22, 2012
    1. 想即时点客户端肯定要加逻辑。
    2. 部分更新可以绑定 bind 'change:xxx',我在一个项目是实现了个简单的 data-bind,效果不错。另外 View/Controller 尽量简单,如果某个控件需要经常性重绘,可以单独弄个 View/Controller,可以参考下 backbone-patterns 的 Sub Views 和 Delegate Views
  • 请教 Rails Guides 里面使用的关系图编辑工具 at April 21, 2012

    inkscape 自己画矢量图,或者 graphviz dot http://www.graphviz.org/Gallery.php , 可以分格子可以上色 http://www.graphviz.org/content/node-shapes

  • Ruby 程序员回家 Soho 好不好? at April 20, 2012

    #17 楼 @raecoo 有歧义啊

  • 诡异的 SSH 登录! at April 20, 2012

    #36 楼 @lb563 重启就是取消再勾上

  • 诡异的 SSH 登录! at April 20, 2012

    #33 楼 @lb563 按楼上的修改一下然后到 System Preference -> Sharing 里把 remote login 重启一下

  • 诡异的 SSH 登录! at April 20, 2012

    #31 楼 @lb563 像是 sshd 禁掉了 pubkey auth, 检查下 /etc/sshd_config

  • 如何把 rails 安装在项目目录下 at April 20, 2012

    bundle install --path vendor/bundle

  • 推荐订阅 Ruby Weekly => 关于 Ruby 的新闻与文章 at April 20, 2012

    #4 楼 @paranoyang hn 一定要单独目录,几天没看果断 A

  • 诡异的 SSH 登录! at April 20, 2012

    把 ssh -vvv 全贴出来吧

  • Ruby 源码 Hack... (鼓足勇气发个,有可能 TJ,慢慢更新) at April 19, 2012

    autoconf 没必要深入去研究,已有的项目基本也不用怎么改。自己弄还是 cmake 吧

  • 想把 Ransack 搜索结果导出到 Excel,但每次导出的却是该 model 的全部数据 at April 19, 2012

    导出的 URL 也要带上参数

    admin_projects_path(:format => 'xls', :number_cont => @search.number_cont, :title_cont => @search.title_cont)

  • 诡异的 SSH 登录! at April 18, 2012

    从 / 到 $HOME 的整个路径上的所有目录也应该是只能 owner 可写

  • 诡异的 SSH 登录! at April 18, 2012

    #4 楼 @lb563 你试试 ssh -vvv

  • markdown 清单碰上缩进代码不显示 at April 18, 2012

    List 后面弄个 html 注释,&nbsp;, <br/> 什么的,有些 markdown renderer 也支持用 ~ 做标志分隔开连续的 lists, code blocks 等

    -   3
    -   2
    -   1
    
    <br />
    
        def foo
          p "Hello, world!"
        end
    
    
    
    
    
    
    
    
    
    
    • 3
    • 2
    • 1


    def foo p "Hello, world!" end

  • 诡异的 SSH 登录! at April 18, 2012

    一个常犯的错误是文件权限不对。$HOME只能自己可写 (0755 或者 0750), .ssh设置成 0700,authorized_keys和id_rsa.pub 0644, id_rsa 0600

  • 可以在单独的 js 文件中使用 "var online_users = #{@users}" at April 18, 2012

    可以在 helepr 里 expose 些全局的 js 对象

    # app/helpers/application_helper.rb
    module ApplicationHelper
      def render_js_app_object
        {
          :user => current_user
          :users => @users
        }.to_json.html_safe
      end
    end
    
    
    # app/views/layouts/application.html.erb
    
      ...
      <%= javascript_tag do %>
        window.app = <%= render_js_app_object %>;
      <% end %>
      <%= javascript_include_tag "application" %>
      ...
    
    
  • 做了一个脚本,方便大家用 Sunpot 做中文全文索引 at April 18, 2012

    #12 楼 @qichunren sunspot 里带了 solr 的 jar 包,并且 rake sunspot:solor:run 会自动导出配置文件到 solr/config

  • 本机装 ruby-china 遇到了个问题,麻烦达人来看看 at April 17, 2012

    #4 楼 @Desert http://nodejs.org/ 下载你系统对应该的包或者下载源码编译安装

  • 这里到底要不要加 self? at April 17, 2012
    class Foo
      def test=(value)
        puts "test=#{value}"
      end
    
      def run
        self.test = 1
        test = 2
    
        send :ptest=, 3
        ptest = 4
      end
    
      private
      def ptest=(value)
        puts "ptest=#{value}"
      end
    end
    
    Foo.new.run
    # test=1
    # ptest=3
    
    
    
  • 这里到底要不要加 self? at April 17, 2012

    #13 楼 @hysios 直接就成临时变量

  • Rspec 的 and_yield () at April 17, 2012

    这里 values,to,yields 是范指 表示所有参数原封不动的 yield 出去。

  • 这里到底要不要加 self? at April 17, 2012

    #10 楼 @hysios 如果那样就只能 send(:remember_token=, value) 了

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