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
  • (译) 我不喜欢新哈希语法 at April 17, 2012

    #5 楼 @donnior 少三次 空格,=, >

  • 怎么向传过来的 block 中添加一些 block at April 17, 2012
    namespace.register(resource, options) { |args*|
      # 该干嘛干嘛
      block.call(args*)
    }
    
    
  • meta_search 帮助你实现复杂的组合查询 at April 17, 2012

    也可以用用 arel,就是写起来感觉还不如直接写 SQL,只是生成的 SQL 标准些

    users_table = User.arel_table
    User.where(users_table[:name].matches('Enie%').and(users_table[:name].lt(50000)))
    # `users`.`name` LIKE 'Enie%' AND `users`.`salary` < 50000
    
    
    
  • pry 代替 Rails console 的 irb,不用加进 Gemfile at April 17, 2012

    这个好像是 pry 没有加进来,试试 rails-console-pry 0.0.5。我刚测试了下 rails 3.2.2 , 3.2.3 都没问题

  • pry 代替 Rails console 的 irb,不用加进 Gemfile at April 17, 2012

    #6 楼 @AlphaLiu 就是用 pry 代替了 irb,可以 ls, cd, edit, edit-method 等等.

  • jQuery 的 unload () 失效 at April 17, 2012

    #7 楼 @hlcfan AJAX 的话要同步,不然这个函数返回 AJAX 直接被 cancel 了。

    $.get({url:url, async: false})

  • 版本库服务器不能克隆项目到自身吗? at April 15, 2012

    #10 楼 @lb563 ssh-add 只是把 key 加到当前的 ssh-agent 里,每次 agent 启动需要重新添加。如果你的 key 没设置 passphrase 的话可以在 .bashrc/.zshrc 里 add 一下。用 zsh 可以直接用 oh-my-zsh 的 ssh-agent plugin

  • CoffeeScript 源码文件用什么 http 头? at April 15, 2012

    #3 楼 @jiyinyiyong sprockets 傻瓜化的,Rails 已经集成,rack 里也只用 mount 上就行了。不想用 sprockets 可以用 guard-coffeescript,文件一修改就自动编译。如果你用 Mac 可以用 http://livereload.com/ ,也是文件修改后自动编译

  • 版本库服务器不能克隆项目到自身吗? at April 15, 2012

    #5 楼 @Rei #2 楼 @reyesyang 用 agent forward 而不是给 deploy 用户直接访问 code repository 的权限是个好习惯

  • 版本库服务器不能克隆项目到自身吗? at April 15, 2012

    #3 楼 @lb563

    • 看看 key 有没有加进去 ssh-add -l

    • 你 ssh 到服务器的那个 shell 的 ssh-agent 的变量有没有设置正确,主要是 SSH_AUTH_SOCK

    • ssh 上去以后在服务器再检查下 SSH_AUTH_SOCK 是不是指向一个存在的 sock 文件

    • 服务器上 my_app.git IP 有没有弄错

    • 在服务器上直接运行 ssh 看看有什么异常

      ssh -vvv git@my_app.git date

  • nginx error_page 相关问题 at April 15, 2012

    #4 楼 @kehao 我是说只在 400.html 里关掉

    location = /400.html { ssl_verify_client off; internal; }

  • 版本库服务器不能克隆项目到自身吗? at April 15, 2012

    本地 ssh-agent 启动了吗?

  • 有没有详细深入的关于 rails ajax 以及 push 的好资料? at April 14, 2012

    可以用第三方服务比如 pusher,nodejs 可以直接用 juggernaut,基于 redis 的

  • nginx error_page 相关问题 at April 14, 2012

    #2 楼 @kehao 估计是 /404.html 这个页面本身又出错了,你试试把在 location /404.html 把 ssl_verify_client 关了

  • 想自己写一个文本 parser 吗?这个 parslet 挺好的。 at April 14, 2012

    好东西。再复杂估计就要用 LALR 了

  • Foundation at April 13, 2012

    #1 楼 @huacnlee 这个是告诉你可以三个里选一个用吧

  • 有多少人不喜欢 asset pipeline? at April 13, 2012

    sprockets js 只是拼接在一起,确实太简单粗暴了,可以试试 requirejs-rails

  • 在使用 capstriano 的时候怎么取远程服务器的环境 at April 13, 2012

    #2 楼 @lb563 cap 不会读进来吗?我服务器上 ruby 安装的 rbenv 就是在 zshenv 里初始化,cap 通过 ssh 执行命令会 load zshenv

  • 在使用 capstriano 的时候怎么取远程服务器的环境 at April 13, 2012

    用 bash 写在 bashrc 里,用 zsh 写在 zshenv,Ubuntu 的话 bashrc 记得要在那行 return 之前设置

  • 把 mbp 以旧换新了 at April 12, 2012

    一直修也很不爽啊

  • 大家好哇! 我的 Emacs 脚本终于发布到 github 了. at April 11, 2012

    #16 楼 @zw963 因为 git 是分布式的,所以 clone 包含所有 branch 的所有历史信息

  • 关于类似网易评论盖楼的数据库设计 at April 11, 2012

    #2 楼 @caryl nested set 不适合 comments 这种场景,插入代价太高了,每次插入要更新整个表。这种插入多的树结构建议用 ancestry ,不同于 nested set,ancestry 把 ancestors 以 path 的形式保存,比如 comment 3 回复的 comment 2,comment 2 又回复的 comment 1, comment 3 的 ancestry 就是 1/2。ancestry 的大部分查询都只用一次 SQL,虽然 desendents 要用到 LIKE,但是不是以通配符开头,所以可以利用到 index。唯一限制的是 ancestry 最长是 255 个字符

  • 大家好哇! 我的 Emacs 脚本终于发布到 github 了. at April 11, 2012

    #13 楼 @hbin 可以试试 package.el + melpa https://github.com/milkypostman/melpadev,包比较全不过都是 snapshot,可能不够稳定,也可以自己 clone 下来建个自己的 repository

    我前段时候写了个命令行下管理用的工具 https://github.com/doitian/eler ,不过目前只支持 elpa packages,打算是能够支持 emacswiki, http, git

    我自己的配置也没占那么多,大部分都是 submodule 里的.git,像 org-mode 就是 70M,而且我还是用的 el-get,安装的时候还会再 clone 到 el-get 目录下去,整个安装完有 200 多 M

  • 如何在不同的页面加载不同的 js 文件? at April 11, 2012

    controllers/application_controller.rb

    class ApplicationController < ActionController::Base
      def self.page_javascripts(*files)
        files.empty? ? @page_javascripts : @page_javascripts = files
      end
    
      def page_javascripts
        @page_javascripts || self.class.page_javascripts
      end
    end
    
    

    controllers/welcome_controller.rb

    class WelcomeController < ApplicationController
      # for all actions
      page_javascripts 'welcome'
    
      def index
        # override for only this action
        @page_javascripts = ['welcome_index']
      end
    end
    
    

    views/layouts/application.html.erb

    <head>
      ...
      <%= javascript_include_tag "application" %>
      <%= javascript_include_tag *controller.page_javascripts if controller.page_javascripts %>
      ...
    </head>
    
    
  • 关于 callback 的单独句柄类 at April 11, 2012

    #8 楼 @douya0808 ActiveRecord::Base 搞的小动作

  • 做了个关于云推荐的网站,麻烦各位帮提提意见 at April 11, 2012

    我还以为是提供 推荐 API 的云服务

  • qwandry - 帮你快速打开 gem 的源代码 at April 11, 2012

    open_gem 也是干这个的,安装后就可以 gem open rails

  • [上海][2012年04月10日] Ruby Tuesday 活动公告 at April 11, 2012

    #23 楼 @lgn21st 就录 screencasts 好了,弄个话筒就 OK 了。

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