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

[email protected]
武汉
6 篇帖子 / 26 条回帖
0 关注者
0 正在关注
4 收藏
GitHub Public Repos
  • toggle-quotes.el 24

    Toggle between single quotes and double quotes in Emacs

  • instahust 4

    Sync Instagram photos tagged #instahust to Sina Weibo.

  • prelude 2

    Prelude is an enhanced Emacs 24 configuration that should make your experience with Emacs both mo...

  • fora 1

    A simple forum written with Ruby on Rails

  • postgres 0

    GORM PostgreSQL driver

  • spacemacs 0

    A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *an...

  • heroku-buildpack-static 0

    Heroku buildpack for handling static sites and single page web apps

  • tramp-term.el 0

    Provides a quick way to create an ansi-term containing an ssh session with remote directory track...

  • truss 0

    Truss helps you build go-kit microservices without having to worry about writing or maintaining b...

  • go-proto-gql 0

    Protoc plugins for generating graphql schema and quickly create servers

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • [北京][2014年9月14日] 中秋后聚会召集 at 2014年09月05日

    我也来玩玩。

  • Emacs 函数链接插件配置求分享,求推荐 at 2014年04月05日

    robe 或者 ctags:

    https://github.com/dgutov/robe http://ctags.sourceforge.net

  • 庆祝可以发贴了, Ruby China 的 Emacser 们, 你们在哪里? at 2014年03月20日

    #58 楼 @birdfrank 晕,自己改键绑定就是了。可以试试 keychord,定义 jm, jc, jv, jh 分别跳转到 model, controller, view, helper

  • 庆祝可以发贴了, Ruby China 的 Emacser 们, 你们在哪里? at 2014年03月13日

    "Fashionable editors may come and go, but Emacs forever stands."

    Be careful to check out this link, because there is no going back.

    http://batsov.com/prelude/

  • background-image 图片加载成功但在 Chrome 里不显示,怀疑和 turbolinks 有关? at 2013年12月17日

    #1 楼 @luikore

    display: block;
    position: relative;
    

    z-index 没设,也没有 overlap 的元素,我部署到 Heroku 上去又能正常显示啦,玄幻。 http://fora.herokuapp.com

  • 如何翻译 why 先生的这句话? at 2013年12月12日

    #19 楼 @Ryan 肯定不是喜欢,开始想说 like 的宾语的,想了想,语文快忘完了,不确定宾语是什么,就改成对象了。

  • 如何翻译 why 先生的这句话? at 2013年12月12日

    #15 楼 @Ryan 我觉得你断句断错了,like 的对象不是 obfuscation, 而是‘obfuscation is morally hazardous’

    @fredwu 和 @Kabie 的翻译虽然说不上等同,但意思上已经算接近了,我觉得有些东西没法翻译。

  • 受不了 Emacs 的缩进了,求指点 at 2013年12月12日

    #20 楼 @xjz19901211 我按照你的代码结构改了一下,你想要的效果是下面这张图么?

    如果是,就不可能没用,你把你的代码打开,在任意一行输入

    (setq ruby-deep-indent-paren nil)
    

    把鼠标移到这行行尾,然后M-x eval-last-sexp,再选中代码 tab 或者重新 indent buffer 就好了。

    或者你直接把这两行代码加到 init.el 或者 .emacs 里面,然后退出重启 Emacs, 再打开这个文件,重新 indent 就好了。

  • 受不了 Emacs 的缩进了,求指点 at 2013年12月12日

    #1 楼 @xjz19901211 第二个问题:

    (require 'ruby-mode)
    (setq ruby-deep-indent-paren nil)
    

  • Kernel#` 调用 xclip irb 挂起 at 2013年10月09日

    #6 楼 @luikore 我懂你的意思了,再加上 Stackoverflow 上的另一条回答就能够解释为什么`xclip .bashrc` 多花这么多时间了:

    $ xclip -verbose .bashrc
    Connected to X server.
    Using UTF8_STRING.
    Reading .bashrc...
    Waiting for selection requests, Control-C to quit
    

    问题在于 xclip 不会自己 terminate,要等待 selection requests, `xclip .bashrc` 之后如果马上用鼠标选点什么东西,他就会马上返回结果。

    http://stackoverflow.com/questions/19237559/why-xclip-bashrc-takes-much-longer-than-systemxclip-bashrc-in-ruby

  • Kernel#` 调用 xclip irb 挂起 at 2013年10月08日

    #3 楼 @sevk 应该和 Benchmark.measure 无关,因为 `xclip .bashrc` 慢了快 20 秒,不用 Benchmark 也能明显的感觉到

  • Kernel#` 调用 xclip irb 挂起 at 2013年10月08日

    #1 楼 @luikore

    不对啊, xclip 为什么会建立管道,只是读取.bashrc的内容到primary selection, 况且这时候摁 Ctrl-d 也没用

    哦,早上起来换到 root 再试了一下,这次xclip .bashrc 正常返回了,但是:

    irb(main):002:0> require 'benchmark'
    => true
    irb(main):003:0> puts Benchmark.measure { system "xclip .bashrc" }
      0.000000   0.000000   0.000000 (  0.007043)
    => nil
    irb(main):004:0> puts Benchmark.measure { `xclip .bashrc` }
      0.000000   0.000000   0.010000 ( 19.856729)
    => nil
    
  • Minitest assert 和 must 返回的结果不一样,bug? at 2013年09月12日

    #2 楼 @doitian 哦,懂了,谢谢啊。 那 Avdi Grimm 在 http://objectsonrails.com/#sec-12_1 这里的测试写错了?

  • Teahour.fm 第 18 期发布 at 2013年06月04日

    #14 楼 @yedingding

  • Teahour.fm 第 18 期发布 at 2013年06月04日

    #4 楼 @yedingding 把音频加张图片转成视频放 youtube 上去,Closed Captions 然后人工校对下应该会少很多工作量。

  • 把字符串写入文件保留'\n' at 2013年05月25日

    #13 楼 @luikore Thanks.

  • 把字符串写入文件保留'\n' at 2013年05月25日

    #9 楼 @luikore 也行,不过 to_json 不是返回 json 么?怎么和 str.inspect 返回的结果一样?

    str.inspect == str.to_json   # => true
    
  • 把字符串写入文件保留'\n' at 2013年05月25日

    #6 楼 @alsotang #7 楼 @luikore Wow, 很完美的解决方法。

    str1 = "<ul>\n<li>One</li>\n<li>Two</li>\n</ul>\n"
    puts str.gsub("\n", "\\n") # => <ul>\n<li>One</li>\n<li>Two</li>\n</ul>\n
    puts str.inspect               # => "<ul>\n<li>One</li>\n<li>Two</li>\n</ul>\n"
    
    str2 = "<p><code>\nputs &quot;hello,\\nworld&quot;\n</code></p>\n"
    puts str.gsub("\n", "\\n")     
    # => <p><code>\nputs &quot;hello,\nworld&quot;\n</code></p>\n
    puts str.inspect
    # => "<p><code>\\nputs &quot;hello,\\nworld&quot;\\n</code></p>\\n"
    

    我尝试过str.gsub("\n", "\\n"),对于前一种情况没问题,后面的就出错了。

  • 把字符串写入文件保留'\n' at 2013年05月25日

    #5 楼 @lgn21st 我需要将 markdown 的输出用 document.write() 包裹之后生成一个 js 文件,直接写入在括号里会生成多行 html

  • 把字符串写入文件保留'\n' at 2013年05月25日

    #3 楼 @lgn21st 我的意思是:我希望文件的内容为:

    <ul>\n<li>One</li>\n<li>Two</li>\n</ul>\n
    
  • 把字符串写入文件保留'\n' at 2013年05月25日

    #1 楼 @yesmeck 哦,这我也知道。不过这串字符串是另一个函数的返回结果。

  • 菜鸟练习题,fibonacci 的不同循环结构实现 at 2013年05月07日
    def fib(n)
      Hash.new{ |h,k| h[k] = k < 2 ? k : h[k-1] + h[k-2] }[n]
    end
    
  • 你们 Ubuntu 用什么桌面管理工具? at 2013年04月22日

    #25 楼 @Rei 百分之九十以上的情况我是想移动,要我再多点一下或者按住 shift 真蛋碎。

  • 你们 Ubuntu 用什么桌面管理工具? at 2013年04月22日

    #14 楼 @Rei #12 楼 @xieren58 想请教下 Dolphin 拖拽文件到文件夹会弹出一个菜单选择复制移动,链接,有没有办法默认为移动?

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