Ruby China
  • Topics
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • Sign Up
  • Sign In
Jasl
@jasl
Admin
NO. 1107 / 2012-02-21

[email protected]
北京
125 Topics / 3953 Replies
395 Followers
11 Following
82 Favorites
Ass♂we♂can
GitHub Public Repos
  • wx_pay 461

    An unofficial simple wechat pay gem

  • zk_dcap_verifier_poc 1

  • substrate 0

    Substrate: The platform for blockchain innovators

  • parity-common 0

    Collection of crates used in Parity projects

  • polkadot-sdk 0

    The Parity Polkadot Blockchain SDK

  • pjs-rs 0

    A javascript runtime with pjs embebed

  • agave 0

    Web-Scale Blockchain for fast, secure, scalable, decentralized apps and marketplaces.

  • ngine 0

    A nostr application framework

  • derive_more 0

    Some more derive(Trait) options

  • cybros-experimental 0

More on GitHub
  • Overview
  • Topics
  • Replies
  • Favorites
  • Following
  • Followers
  • crontab 执行 rake 遇到 cannot load such file -- bundler/setup at February 22, 2017

    木有找到文件啊。。。顺着异常堆栈屡一下,是不是你 require 进来的文件不存在

  • 请教大家关于使用 default_scope 遇到的一个问题 at February 22, 2017

    把 default_scope 留给 gem 或者你项目的 lib 使用,比如软删除的实现方法就是通过设置 default_scope 的,你这边再做就会冲突

  • 修改图片引用地址,把 https 地址栏的叹号改为绿锁 at February 22, 2017

    #4 楼 @VICTOR-LUO 还有一些可能会遇到的浏览器端安全知识,看 https://github.com/twitter/secureheaders 这项目,看它 configuration 里的每一项设置,把名字当成关键字去 google(记得去掉下划线),撸一遍,浏览器端的安全大致概念上大致就差不多了

    SSL 的配置安全性检测用这个 https://www.ssllabs.com/ssltest/

  • 早就听说 Linode 要免费升级,为什么日本节点还没有动静 at February 22, 2017

    #3 楼 @pzgz 我实测东京 1 可以打满我家联通百兆光纤的下行,2 就差远了...

  • 过来解释一下 at February 21, 2017

    #7 楼 @miclle 嗯...

  • 修改图片引用地址,把 https 地址栏的叹号改为绿锁 at February 21, 2017

    这个其实算是个基础知识啦,关键字是 Mixed Content(混合内容),总之尽量不要在 HTTPS 页面出现混合内容,国内的视频站的嵌入视频目前还是无解的。

    参考一些资源(当然你 google 也能搜的到...)

    • How to fix a website with blocked mixed content
    • 混合内容
    • What Is Mixed Content?

    另外得感谢国内各家 CDN 服务商还有搜索引擎开始提升 HTTPS 的支持了,你简单的给 http 后边加了个 s 就可以了就是他们的功劳啊(他们终于跟上世界步伐了)...

  • 过来解释一下 at February 21, 2017

    #4 楼 @Peter APM 工具都带的,比如国内 OneAPM,NewRelic 到是没注意到在哪... 或者你配置一个 Monit 或 Systemd 的 service,可以做到挂掉自动重启的

  • 过来解释一下 at February 21, 2017

    #3 楼 @easonlovewan

    不要用 preload_app! 就好了,参考 https://github.com/puma/puma/blob/master/examples/config.rb#L154-L159 如果使用 cap 部署,需要追加一段

    on_restart do
      ENV['BUNDLE_GEMFILE'] = Pathname.new(File.dirname(__FILE__)).realpath.parent.join('Gemfile')
    end
    

    指定最新部署代码的 Gemfile

  • 修改图片引用地址,把 https 地址栏的叹号改为绿锁 at February 21, 2017

    图片的事好说,国内视频站的嵌入视频目前无解

  • 环境部署,替换镜像源,不能用 https - Unable to require openssl at February 18, 2017

    你可能是 1.29.0 版 rvm 的受害者,降级一下 rvm get 1.28.0

  • [北京][2017-02-18] 北京 Rubyists 聚会 (地址改为当代 MOMA 倍格生态 B1) at February 16, 2017

    给 Growing 那补了个空格...

  • RubyConf China 2017 什么时候 什么地点,期待! at February 16, 2017

    #6 楼 @huacnlee 只要能有可靠地陪搞定前期场地就 OK,跟去年麻烦你的一样

  • 这样的需求该怎么设计表结构? at February 16, 2017

    #6 楼 @nouse GB2260

  • RubyConf China 2017 什么时候 什么地点,期待! at February 16, 2017

    #3 楼 @huacnlee 钦定了吗?

  • 这样的需求该怎么设计表结构? at February 16, 2017

    #8 楼 @jun1st 恩?

  • RubyConf China 2017 什么时候 什么地点,期待! at February 16, 2017

    还是放在 9-11 月份吧~ 差不多 5 月份开始调整心态,这阵子我在充电准备外出需要的吹牛材料 😄

  • 这样的需求该怎么设计表结构? at February 15, 2017

    参考 https://github.com/saberma/china_city/blob/master/db/areas.json 中国的省市区是有国家标准的 http://www.stats.gov.cn/tjsj/tjbz/xzqhdm/201504/t20150415_712722.html 能看到规律了吧~

  • 大家有什么 email 编辑器可以推荐下吗? at February 05, 2017

    要自己写

  • 春节没有闲着,新手搞了个阿里云短信服务 aliyun-sms gem at February 03, 2017

    👍

  • Rails 最佳实践之配置管理 at January 30, 2017

    完全同意楼主对配置的管理方式

    还在想北京年后聚会分享这方面东西,我补充一点小技巧

    有一些配置,比如 mailer 相关的,通常需要这样来配置

    if production?
      config.action_mailer.delivery_method = :smtp
      # ...
    elsif devlopment?
      config.action_mailer.delivery_method = :smtp
      # ...
    end
    

    用 RailsConfig 的话,还是要硬编码配置项

    这里大致了解 Rails 下边各组件如何利用 Rails.application.config 的话,可以做这样一个 Monkey Patch(当然也可以换别的形式)

    module ActionMailer
      class Railtie < Rails::Railtie
        initializer 'action_mailer.set_configs.set_yaml_configs', before: 'action_mailer.set_configs' do |app|
          app.paths.add 'config/mailer', with: 'config/mailer.yml'
    
          configure = app.config_for('mailer').deep_symbolize_keys
          configure.each do |key, value|
            setter = "#{key}="
            unless ActionMailer::Base.respond_to? setter
              raise "Can't set option `#{key}` to ActionMailer, make sure that options in config/mailer.yml are valid."
            end
    
            app.config.action_mailer.send(setter, value)
          end
        end
      end
    end
    

    注意用 Initializer 的话要了解下 Rails 在 Initializer 上使用的 TSort 算法,保证初始化 block 的执行顺序

    然后编写 config/mailer.yml 即可

    default: &default
      perform_caching: false
      raise_delivery_errors: false
      perform_deliveries: true
      delivery_method: :smtp
      deliver_later_queue_name: 'mailers'
    
    development:
      <<: *default
      smtp_settings:
        # see https://github.com/sj26/mailcatcher
        address: 127.0.0.1
        port: 1025
        domain: localhost
      default_options:
        reply_to: [email protected]
        from: [email protected]
    
    test:
      <<: *default
      delivery_method: :test
    
    production:
      <<: *default
      smtp_settings:
        address: 
        domain: 
        port: 80
        user_name: 
        password: 
        authentication: :plain
      default_options:
        reply_to: 
        from: 
    
  • Rails 最佳实践 - 定时任务 at January 28, 2017

    在容器环境下,或者守护进程式设计替代 Crontab 可以看一下 clockwork

  • link_to 怎么携带参数 ? at January 27, 2017

    #2 楼 @yirolhao 他的 profile_path() 是 Rails 根据路由定义生成的命名路由 Helper 方法,至于参数列表要根据实际情况来填写,但按理解上来讲,Rails 的命令路由 Helper 方法的最后一个参数,都可以是一个 Hash,序列化后作为 URL 的 Query string,就是你所谓的鞋带参数

  • 关于把 textarea 改为富文本编辑器的问题 at January 24, 2017

    最近看好一个 https://github.com/quilljs/quill

  • 分析 Ruby 中的比较函数 at January 01, 2017

    你们说的 JS 来了:http://thomas-yang.me/projects/oh-my-dear-js/

  • [远程] 彩程招募 Rails 工程师 at December 21, 2016

    #12 楼 @oldcwj #4 楼 @qinix 过去写三端都写的,以后要重新捡起 Rails 来了哈...

  • 使用 Rails 自带的 Form Builder 来重构你的 Form at December 14, 2016

    终于看见有这么用的了!

    simple_form 什么的根本没必要嘛...

    PS: 四年前...

  • Window 10 下的开发 Rails at December 11, 2016

    加个精吧,方便用 Windows 的人,不过还是看好 WSL 的成熟~

    另外推荐一个 Terminal 叫 MobaXTerm,这个是我在 Win 下用过最强大的 Terminal 了,比 Cmder 要好用很多(当然也复杂了很多...),缺点就是启动速度慢

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