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 74

    Live2D 模型批量查看器

  • dotfiles-public 14

    My configurations

  • knowledge-base 5

  • readwise-scripts 2

  • ckb-sdk-python 2

  • lnd-grpc-tonic-client 2

    Rust lnd client using tonic and tonic-openssl.

  • zotero-actions-tags-sc... 1

    Scripts for the Zotero plugin windingwind/zotero-actions-tags

  • http-inspector 1

  • dotfiles 1

    dotfiles managed using saltstack

  • bru-files 0

    API playground

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 大家可以到这里来占坑翻译 Rails Guides 了~ at March 27, 2012

    #14 楼 @tassandar redcarpet 2.0+

    require 'redcarpet'

    rndr = Redcarpet::Render::HTML.new with_toc_data: true markdown = Redcarpet::Markdown.new rndr, autolink: true

    markdown.render <<MD header ------

    works MD

    # => # #

    header

    # #

    works

  • 大家可以到这里来占坑翻译 Rails Guides 了~ at March 27, 2012

    #16 楼 @doitian #14 楼 @tassandar

    说错了,应该是 with_toc_data

  • 大家可以到这里来占坑翻译 Rails Guides 了~ at March 27, 2012

    #14 楼 @tassandar 比如 redcarpet 的 autolink

  • Emacs 开发 Rails 应用之 --- 自动补全与 snippet 输入 at March 27, 2012

    #33 楼 @ghosTM55 我猜你应该是 byte compile 以后找不到变量声明,用 eval after load 加载配置或者自己声明下变量 (defvar ac-dictionary-directories nil)

  • 大家可以到这里来占坑翻译 Rails Guides 了~ at March 27, 2012

    #1 楼 @tassandar 有很多实现是可能配置成给 header 加 ID 的。也可以手动在 header 前面或者后面直接插入段 html(a, span 什么的,div 什么的),把 id 加到这个插入的 tag 上

  • jQuery 的 unload () 失效 at March 27, 2012

    唯一能阻止页面关闭的就是 beforeunload 返回 truthy value,并且用户点击了 Cancel/No

  • jQuery 的 unload () 失效 at March 27, 2012

    unload 和 beforeunload 都没法区分刷新和关闭,只要当前页面 unload 了就会触发(关闭,刷新,点击链接,输入地址等等)

    unload 可以做些清理工作,但是不能用 preventDefault 来阻止页面关闭。(jquery unload )

    alert 实际执行了,只是大部分浏览器会阻止正在关闭的窗口弹对话框。如果你用 chrome,可以打开 Developer Tool 并点击右下角的齿轮设置,选择 Preserve log upon navigation,可以查看到 unload 里的 console.log。因为 unload 一返回,页面就关闭,如果有 ajax 请求什么的,都一定要同步调用(async:true),不然页面 unload 完资源就全部注销了。

    beforeunload 如果返回值不是 null 或者 undefined,浏览器会负责跳出个 confirm 对话框,返回值可以会做为提示的一部份也可能压根就不用。

  • Rspec 和 Foreign Key 的问题 at March 27, 2012

    感觉你是在测试 active record

  • Back to Emacs at March 27, 2012

    #17 楼 @ripple el-get 确实不稳定,特别是编译出错,只能手动删掉重新运行 我的配置就是基于 el-get: https://github.com/doitian/emacs.d 缺点是重新安装要很长时间,优点是方便升级

  • jQuery 的 unload () 失效 at March 27, 2012

    你需要使用 beforeunload,但是只能返回个字符串让浏览器显示提示框,返回 null,undefine 就直接关闭了。

    $(window).bind('beforeunload', function (e) { if (app.shouldSave()) { return 'You have unsaved changes'; } })

  • Rails 下的长久运行的任务脚本怎么做成后台进程运行? at March 27, 2012

    runit,写个 run 脚本就行了

  • 你们是不是也是开一堆 shell. at March 24, 2012

    tmuxinator 一个 topic 一堆 shell,不用直接关掉,要用再 attach 上

    s/堆/个/

  • rbenv 每次需要 rehash,和 rvm 比,可用性也太差了吧。 at March 24, 2012

    新装的 gem(以前重没装过)一定要 rehash 在.rbenv/shims 下生成可执行程序,像 zsh 要自动补全还需要 hash -r .不过因为 rbenv init - 里会调用 rbenv rehash,所有新开个窗口是不需要的.我的用法是 bundler 管理 gemset,在~/.bundle/config 里设置 BUNDLE_PATH 为 vendor/bundle , 配合 shell 的一个小函数为常用命令添加 alias,在发现 Gemset 的时候自动加上 bundle exec ( rbenv.zsh ).通过 bundler 安装 bundle exec 执行是不需要 rehash 的

  • 看到个好玩的 Ruby 插件. (Vimer 和 Emacer 可以试试) at March 24, 2012

    这个可是要真正执行代码的,有 system('rm -r xxx') 的慎用

  • 如何批量生成百万条数据? at February 23, 2012

    #10 楼 @xdite 是不是看成 1_000_000.collect 了?

  • 你现在正在用的 vim 配色方案是神马.. at February 16, 2012

    喜欢对比度低的,用的 zenburn

  • [深圳] 排队网络技术有限公司招聘 ROR 兼职人员 at February 12, 2012

    曾经搭建公司内部系统的时候写过不少插件,插件机制实现的很不错

  • 刚刚开始玩 Sunspot,想知道在 Production 环境里面应该怎么配置? at February 11, 2012

    FYI https://gist.github.com/1795439 我用的 cap 部署

  • 推荐一个 shell 下面切换路径的工具 at February 11, 2012

    其实要去的目录就那几个,装了 autojump 就没怎么用过。主要用的 zsh cdable_vars,设置几个变量比如

    cb=/home/ian/codebase

    要去哪个项目

    $ cb/ruby

  • rails-settings-cached 0.2.0 发布 at February 11, 2012

    如果要在 form 里编辑某些选项呢?我能想到的是用 activemodel 封装,加验证,数据实际是从 setting 加载,最后保存到 setting

  • 推荐一个 shell 下面切换路径的工具 at February 11, 2012

    autojump 的 shell completion 不好用,等下试试 z

  • [上海] 500 强招聘 (Senior) Software Engineer at February 11, 2012

    看到 500 强就想到凤姐

  • 刚刚开始玩 Sunspot,想知道在 Production 环境里面应该怎么配置? at February 11, 2012

    在 production 里跑 sunspot 带的主要是加 solr 插件不方便,调整 jvm 参数不方便。独立开可以单独部署,弄多个组 cluster 都是可以的。用 sunspot 主要注意把 data 和 pid 都放到 shared 里

  • 如何实现多个 simple_navigation? at February 11, 2012

    建议看代码,配置和 render navigation 这俩地方

  • rails 中 LDAP 认证问题 at February 10, 2012

    #8 楼 @fsword https://github.com/ruby-ldap/ruby-net-ldap/commits/master ruby ldap 还是在维护的,只是很不活跃,我发了个 pull request,过了半年才 merge,还且到现在还没发新版 gem

  • 1.9.3 的速度 at February 04, 2012

    我用 rbenv 通过 ruby build 安装后缺少 sockets.rb 这些标准库,必须手动把那个脚本里的 autoconf 改成 autoreconf

  • @ 自动匹配用户名功能上线 at February 04, 2012

    #18 楼 @ichord 如果输入第一个字母有匹配,再输入下一个如果没有匹配项了,上一次的匹配结果还是显示在那。

  • 打算换电脑,mac or thinkpad? at February 04, 2012

    不喜欢 macbook 键盘的手感,尤其是 mba

  • 使用 VIM 和 GNU Screen 实现最佳 Rails 开发环境 at February 04, 2012

    #6 楼 @superbatironmans5 用 tmux/screen 的好处,一不小心窗口关了,重新 attach 上去就好了,还可以一个任务一个 session,不需要的时候 detach;而且 tmux/screen 可以方便的绑定快捷键,而且是可编程的,比如你可以在 VIM 里写个方法,把当前选中的代码发到一个 irb 的窗口里去执行

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