Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Yuan Cheung
@zhangyuan
VIP
NO. 140 / 2011-11-20

北京
6 Topics / 558 Replies
10 Followers
0 Following
32 Favorites
I'm not the only one.
GitHub Public Repos
  • google-authenticator-e... 10

    A command line tool to extract secrets from Google Authenticator's QR code. 从 Google Authenticato...

  • proxymanager 2

    A simple tool to manage v2ray process and network proxy on MacOS

  • zender 1

    Compile templates written in Jinja, with metadata generated.

  • seo-helper 1

    A simple tool to generate SEO meta info with LLM.

  • dq 1

    A data quality check utility

  • amlogic-s9xxx-openwrt 0

    Support for OpenWrt in Amlogic, Rockchip and Allwinner boxes. Support a311d, s922x, s905x3, s905x...

  • securebin 0

    A simple application for sharing text securely with client side encryption.

  • git-server 0

    A simple demo for git server

  • qqwry-rs 0

    A library and program for IP address lookup using the qqwry.dat file.

  • stm32f103c8t6-blink-ar... 0

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • 我带着我的招聘贴回来了!!!找工作的人辣么多,为什么我还招不到人。来吐槽面试好么 at March 23, 2014

    记得有段时间招聘板块的帖子都是高清大图,你有吗?

  • GitHub 首位女工程师离职、联合创始人停职 at March 18, 2014

    期待出一本《孵化 Github》的书

  • 会哭的孩子有奶吃? at March 04, 2014

    西安的媒体发展地怎么样?

  • (求助) Mac 下使用 ImageMagick 出现中文乱码的情况。 at March 04, 2014

    看了一下源码,quick_magick 和 mini_magick 类似,都是调用命令行来处理图片的。

    建议用 bundle open quick_magick 打开源码,然后找到执行命令的代码(应该就是 save 方法),把处理图片的命令打印出来。然后在终端执行看看。

  • (求助) Mac 下使用 ImageMagick 出现中文乱码的情况。 at March 03, 2014

    是不是设置字体那一行代码,得放在 draw_text 之前?

  • RAILS_ENV 写在命令前后有什么区别呢? at February 24, 2014

    写在前面是环境变量。如果对于非 rails、rake 命令,写在后边,就不能当作环境变量读取。

  • 关于 Rails reload code at February 24, 2014

    #30 楼 @hiveer 看看这个 https://github.com/rails/rails/issues/2665

  • 关于 Rails reload code at February 21, 2014

    #25 楼 @hiveer 就你目前的代码,是可以自动 reload 的。不过你代码有问题

    module UserMethods
      def n_upcase
        self.nickname.upcase!
        self.save!
      end
    end
    

    这里,虽然修改了 nickname 这个属性的内容,但是,self.save! 并不会保存到数据库。可以修改为:

    module UserMethods
      def n_upcase
        self.nickname = nickname.upcase
        self.save!
      end
    end
    
  • 关于 Rails reload code at February 21, 2014

    #23 楼 @hiveer 好的。我在本地跑一下看看

  • 关于 Rails reload code at February 21, 2014

    #20 楼 @hiveer 现在没问题了吗?

    还有,修改 config/application.rb 后要重启 server。

  • 关于 Rails reload code at February 21, 2014

    #18 楼 @hiveer 你把 app/models/modules/user_methods.rb 重命名为 app/models/modules/user_method.rb;或者把 UserMethod 这个模块名改成 UserMethods 了吗?

    你确定没有在其他地方 require 这个文件吗?如果不符合 Rails 的惯例,是不会自动加载的。

  • 关于 Rails reload code at February 21, 2014

    #16 楼 @hiveer 你的文件名是 user_methods.rb 但是你的模块是 UserMethod (注意 s),需要改成一致才符合 Rails 的惯例。

  • 关于 Rails reload code at February 21, 2014

    #14 楼 @hiveer 能给出代码片段吗?

    另外,

    1. 打印出 ActiveSupport::Dependencies.autoload_paths 的值
    2. 不要 使用 require 加载文件
  • Ruby 的可变参数的 C 实现是怎样的? at February 21, 2014

    楼主是想在 C 语言里实现可变参数吗?C 语言也有的。

  • 关于 Rails reload code at February 21, 2014

    你可以在 config/application.rb 里添加

    config.autoload_paths += %W(#{config.root}/app/models/modules)
    

    同时,不要使用 require 加载文件。

  • Rails 是如何做到 development 下修改代码后,不重启服务器就可以重新加载代码? at February 21, 2014

    #9 楼 @hiveer 其他的都是目录,你这个第一条怎么是文件?

    你可以在 config/application.rb 里添加

    config.autoload_paths += %W(#{config.root}/app/models/modules)
    
  • Rails 是如何做到 development 下修改代码后,不重启服务器就可以重新加载代码? at February 21, 2014

    #6 楼 @hiveer 你可以打印一下 ActiveSupport::Dependencies.autoload_paths 的结果。返回值里的目录,是自动 reload 的

  • 有没有什么办法生成好看的统计图片 (infographic)。 at February 17, 2014

    能否生成 SVG 格式,然后用 ImageMagick 转换成图片?

  • 有没有用 capistrano 3 的?我从 2 升到 3 后就傻了,不知道怎么弄了。 at February 05, 2014

    这里有个例子,

    https://github.com/zhangyuan/thunder_search

  • 已解决:关于 require 'FileUtils' at January 28, 2014

    不在电脑旁没验证。但记得应该是 require 'fileutils' 吧。

    你的电脑是 mac 文件名不区分大小写。所以大小写不同,会 require 多次。

  • 人人都有一颗八卦的心 at January 25, 2014

    http://www.zhihu.com/question/21321201

  • sidekiq run in background?? at January 24, 2014

    #4 楼 @kee 2.5.3 没有 -d 选项,最后一次是 2012-11-14 提交的,已经很老了。。。建议升级。

  • sidekiq run in background?? at January 24, 2014

    你用的是哪个版本?

    命令行是在这个文件里处理的,你可以看看 lib/sidekiq/cli.rb。后台运行时,还需要指定日志文件,否则会报错。

  • [广州] 网易公司诚招 Ruby 高级开发工程师 (多名) at January 22, 2014

    广州做 rails 的不多,据说对 rails 的要求不是非常高,以前好像.net 的开发都可以试试吧…

  • rails 中 http 客户端获取其它服务数据效率的比较 at January 21, 2014

    用 EM 或者多线程,单个请求还是那么慢。但多个请求可以并行。

  • 有一段代码看不明白 (&:upcase) at January 18, 2014

    看这个 http://dreamhead.blogbus.com/logs/10568733.html

  • gem 加载一次,就预编译一下,下次就快了 at January 16, 2014

    #3 楼 @luikore 默默地去 Google 预编译...

  • gem 加载一次,就预编译一下,下次就快了 at January 16, 2014

    #1 楼 @luikore 不是说 1.9 以后,ruby 代码会被编译成字节码,由 YARV 执行吗?

  • rails console 和 shell 的关系。因为 zsh,掉坑里了。 at January 15, 2014

    Mac OSX 里默认的文件系统是不区分大小写的

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