Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
windy
@lyfi2003
高级会员
第 121 位会员 / 2011-11-17

[email protected]
深圳至简天成科技有限公司
深圳
119 篇帖子 / 1213 条回帖
349 关注者
7 正在关注
6 收藏
技术测评,就用 ShowMeBug!
打赏作者
GitHub Public Repos
  • cywin 325

    Cywin Closed( Chinese name: 创业赢 )

  • wblog 217

    The missing independent blog system for Ruby on Rails

  • ruby-vimrc 91

    A quick vimrc for Ruby on Rails programming

  • ruby_proxy 9

    https://github.com/windy/ruby_proxy

  • mina-ng-puma 7

    Next generation mina-puma

  • ai-product-review-nextjs 0

  • remix-saas 0

    A Lightweight, Production-Ready Remix Stack for your next SaaS application.

  • wblog_2 0

  • xz-first-vision 0

  • glassmorphism-bookstore 0

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • 技术帖分享: 当你浏览我的博客时计算机干了什么 at 2015年02月12日

    #2 楼 @mogodb 有专业的视觉设计师指导哈,自己写的前端。

  • 如何在邮件中显示 HighCharts 渲染的图片 at 2015年02月11日

    楼主的解决问题能力非常强。

    对于邮件的 HTML, 只是内联样式,还有许多样式并不支持。

    Rails4.1 很给力,写 mailer 已经很方便了。

  • Rails 后台管理 at 2015年02月11日

    可以 goolge 下 : rails engine

  • 使用 Form Objects 处理结构复杂的表单 at 2015年02月09日

    不错的解决手段。

    有点觉得 Update 解决的不太优雅。

  • 有没有生成二维码的 gem at 2015年02月09日

    #3 楼 @gerry1004 那个库有 bug, 试试这个:

    gem 'rqrcode-with-patches', require: 'rqrcode'
    

    完整代码示例:

    class QrcodesController < ApplicationController
      def show
        str = params[:str].to_s
        max_length = 200
        if str.length > max_length
          render nothing: true, status: 404
          return
        end
        require 'rqrcode/export/png'
        qr = RQRCode::QRCode.new(str)
        response.headers['Cache-Control'] = "public, max-age=#{12.hours.to_i}"
        response.headers['Content-Type'] = 'image/png'
        response.headers['Content-Disposition'] = 'inline'
        render :text => qr.as_png
      end
    end
    

    代码从开源项目 wblog 取出。

  • 一个 Ajax 的返回值的问题 at 2015年02月07日
    def getgood
        good = TaoBaoApi::Good.new params[:buy_link]
        item = good.get_info
        # 只有 json 的数据 前端才能到回调里
         render :json => { :find => "NO",:data =>item}
      end
    
  • ruport 中文显示串行问题求助 at 2015年02月07日

    如果你用的是 Ruby2.0 以上,可以尝试手动改一下字串的计算方式如下:

    str = '中文'
    
    str.length
    # result is 2
    
    str.encode('gbk').force_encoding('ascii').length
    # result is 4
    
  • 丧心病狂,做几个题就可以预测程序猿的工资? at 2015年02月04日

    查看源代码嘛。JS 里直接写好了分数。

  • [已解决] Rails.logger 内部有锁吗? at 2015年02月01日

    @zhangyuan 嗯,刚 pry 跟了下,确实是线程安全的:

    # From: /Users/yafeilee/.rvm/rubies/ruby-2.1.5/lib/ruby/2.1.0/logger.rb @ line 558 Logger::LogDevice#write:
    
        557: def write(message)
     => 558:   begin
        559:     @mutex.synchronize do
        560:       if @shift_age and @dev.respond_to?(:stat)
        561:         begin
        562:           check_shift_log
        563:         rescue
        564:           warn("log shifting failed. #{$!}")
        565:         end
        566:       end
        567:       begin
        568:         @dev.write(message)
        569:       rescue
        570:         warn("log writing failed. #{$!}")
        571:       end
        572:     end
        573:   rescue Exception => ignored
        574:     warn("log writing failed. #{ignored}")
        575:   end
        576: end
    
  • [已解决] Rails.logger 内部有锁吗? at 2015年02月01日

    不保证,默认情况下 Rails 只是用 Ruby 自带的 Logger 库来记录日志。

    你可以自行修改 config/environments/production.rb 里面的 logger 来达到你的要求。

  • [深圳] 敏捷小团队招新,全职 / 实习 at 2015年01月31日

    #5 楼 @xifengzhu 如果是我招人的话,也会对此加分的。并不是说用它们就高端,而是从侧面说明用它的人是真正热爱 coding.

  • 2014 年 Web 高手都在做什么 -- 一个 Rails 开发者的视角 at 2015年01月27日

    #43 楼 @blackangel_can 里面有提了一句。

  • 容错和速错 at 2015年01月24日

    学到 Hash#fetch

    begin resuce -> begin rescue

  • 建议大家尽早应用验证码 at 2015年01月22日

    #14 楼 @chrisloong

    给客户端要求的话它爆破起来就慢很多了。

    就这几个思路,很多系统都是结合着用,先限制,最后一步觉得用户还有风险才会启用验证码。

    ( ps: 我记得验证码在 google 的一个智能识别系统上被完破了 )

  • 建议大家尽早应用验证码 at 2015年01月22日

    @chrisloong devise 有一个 lockable 模块和 timeout 模块,直接支持这种限制次数与锁定的模式。

  • 建议大家尽早应用验证码 at 2015年01月22日

    直接上验证码感觉有点粗暴了,毕竟体验会下降不少。

    1. 上一个频率检测工具
    2. 表单开启 csrf, 能防止很多通用工具的攻击
    3. 必要的时候可以启用 客户端 JS 加密回传的方式来增强门槛。
  • 高手对决 -- 博客服务器被黑的故事 at 2015年01月21日

    #27 楼 @ninehills 作为 "高手" 怎能轻易服输 😄 , 不能老使用大招。

  • 高手对决 -- 博客服务器被黑的故事 at 2015年01月21日

    #32 楼 @chrisloong 赞一个~

  • 高手对决 -- 博客服务器被黑的故事 at 2015年01月21日

    #6 楼 @ninehills 部分虚构,让你误解了。不过这个故事其实跟 ssh 暴破没任何关系。

  • 高手对决 -- 博客服务器被黑的故事 at 2015年01月21日

    #1 楼 @Rei 嗯,是个好主意:)

  • AngularJS 为什么成功了? at 2015年01月15日

    #28 楼 @Victor 这个明显叫偷换概念。

    这里的代码都是前端逻辑,不需要后端任何配合。换句话说:

    这些代码是自成一体的。而 JSP 是后端生成的 HTML.

    很明显,纯前端可以用来做 app, 维护性更好。而 JSP 则不可以。

  • ruby1.8.7 如何安装 nokogiri at 2015年01月15日

    @Rei 那只是一个错误之一。

    @yangman_wenzhu 尝试找一个低版本的安装即可。比如 gem install nokogiri --version 1.5.6

  • Basecamp 2015 年办公桌展示 at 2015年01月15日

    香港这个果然有特色:超小的空间:)

  • [已解决][Rails + devise] App 保存 Session 好,还是像 ruby china 为每个 user 生成 token_id 好? at 2015年01月14日

    #1 楼 @qige023 用 devise 这种方式来验证 app 是不合适的,推荐 JWT.

  • 怎么抓取 https 页面的源码 at 2015年01月14日

    #2 楼 @Rei :plus1:

  • AngularJS 为什么成功了? at 2015年01月13日

    #5 楼 @nightire 我觉得凡事就是多探讨才有提高,所以发出文章来看看大家的理解。

    #6 楼 @feitian124 发现已经前不久就关注了:) 我并没有厚此薄彼,会继续关注这个领域的发展。

  • AngularJS 为什么成功了? at 2015年01月13日

    #2 楼 @est 嗯,是的:) 我本想以为咱们 Rails 社区不喜欢聊前端,所以没有第一时间发这里。

  • 关于 vim 的 tab 空格问题 at 2015年01月12日
    " 1 tab to 2 space for ruby
    set tabstop=2
    set softtabstop=2
    set shiftwidth=2
    set expandtab
    
    

    see more: https://github.com/windy/ruby-vimrc

  • Ruby Shanghai 2014 年 终聚会 总结 at 2015年01月11日

    友情支持:)

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