Home
Wade Ruby
Cancel

Ruby Railsapi,grape,sinatra的比较

参考: https://scoutapm.com/blog/rails-api-vs-sinatra-vs-grape-which-ruby-microframework-is-right-for-you

Ruby Rails Profiler另外一个人写的工具大全toolslist

参考:http://maratgaliev.com/profiling-ruby-rails/ 写的非常好

新晋管理者的成长

小D是一名新晋管理者。现在带5个人团队 9.23 反馈: 9.24 晨会反馈: 1.  对于乐乐(容易犯懒的成员),不能光听她说:我做完了XX,YY。一定要走过去看。因为很可能你看到的是个半成品。 2. 对于测试新人,已经入职一周了,不能再继续熟悉项目了。我们的项目很庞大。需要她尽快的参与测试。例如:OTC交易,例如币币交易。从小的模块做起。 3. 龙辉:让他看我慕课网的ruby课...

Ruby Profiler Ruby Prof.https:ruby Prof.github.io

ruby-prof Gemfile: gem 'ruby-prof' 然后在application.rb 中增加中间件 config.middleware.use Rack::RubyProf, :path => './tmp/profile' 就会生成好多文件,放到 ./tmp/profile文件夹下 /your_app/current/tmp/profile$ ls -call_s...

Ruby 对非数据库的记录分页paginateforarray,redis

参考:https://stackoverflow.com/questions/10491478/pagination-with-an-array-of-hashes-in-rails controller: items = $redis.lrange("items-#{params[:id]}", 0, -1) @items = Kaminari.paginate_array(item...

Ruby Ubuntu18下面,编译ruby的注意事项:gcc6

参考:https://github.com/rbenv/ruby-build/issues/1146 另外,也参考:https://bugs.ruby-lang.org/issues/14076 需要安装 gcc-6 , 默认的gcc-7 会引起ruby 2.4以下的无法安装(?) 反正,如果要安装2.1.x 报错,那么就执行下面的: # for ruby <2.4 apt...

Ruby Rails还没使用https:github.combhbrack Perftools_profiler

参考:https://github.com/bhb/rack-perftools_profiler https://github.com/tmm1/perftools.rb 的 rack集成版本</span>

Websocket 相关资源:二进制发送,chatroom,实现多个频道的播放

实现 多个频道的播放 https://github.com/igrigorik/em-websocket/blob/master/examples/multicast.rb 如何使用一个url 就可以发送多种消息 https://stackoverflow.com/questions/57766181/how-to-publish-private-information-via-public...

近期面试的面试心得和经验

# 面试注意事项 0.第一次的电话沟通。 威中杰信息技术有限公司是否在职能否短期出差4级过没过是否学位证毕业证齐全工作年限能否独立完成项目 - 安卓蔚蓝洪泰创新空间 话术: 0.1 你好!这里是威中杰技术部,我在智联招聘上收到了你的简历,请问是XXX吗?0.2 我想用几分钟的时间,跟你做一个简单的电话面试。请问现在可以吗?0.3 请你用30秒的时间,简单介绍一下你自己。 (注意:候选人...

Ruby 几个商用的profiler:skylight.io

skylight:  https://www.skylight.io 还有几个。。。

Ruby 多线程编程,可以不用使用join

参考:https://stackoverflow.com/questions/7905808/is-it-ok-not-to-call-threadjoin join的目的是为了让当前主thread等待子thread,然后返回对应的结果. 一旦多线程用熟悉了的话,是不需要join的. 不过需要注意一点:  一旦主进程结束, 子进程就跟着结束(起码在ruby中是这样) 其他语言也是一...

Ruby Rails Profiler 非常好的一篇文章:

参考:https://www.toptal.com/ruby/hunting-ruby-memory-issues 说了一些工具,把概念讲的很明白

Ruby 多个进程共享对象(默认是无法这样做的)

参考: https://stackoverflow.com/questions/16538732/share-variable-through-ruby-processes?noredirect=1&lq=1 https://en.wikipedia.org/wiki/Inter-process_communication

Ruby Rblineprof每行每行的查看rb文件的执行时间

https://github.com/tmm1/rblineprof 跟数据库无关,只跟rb代码执行相关 其实,如果要这样的话,还不如用rust重写

Ruby 使用rubyxl读取excel文件

参考: https://github.com/weshatheleopard/rubyXL gem install rubyXL 放弃了.原因是有的文件读不出来,直接使用csv文件更好.

Ruby Railsprofiler Oink,集成了memorylogic,查看rails项目占用的内存

参考:https://github.com/noahd1/oink Gemfile:  gem 'oink' Rails.application.middleware.use Oink::Middleware 之后重启rails, 看log (会发现每次请求url之后, 内存会上升。。。找到明显上升的地方即可) 106 Dec 03 08:20:59 main-production...

Ruby Cas的相关问题:singlesignout,与gateway

cas 服务器端: https://github.com/rubycas/rubycas-server/  (内容多) 文档都在代码里.wiki中也有很多. 配置文档见 config.example.yml 这里也有配置:https://github.com/rubycas/rubycas-server/wiki/Installation 这里说了gateway的用法:https:...

Rails 直接执行rawsql.查询mysql的基本数据

参考: https://stackoverflow.com/questions/10836805/how-can-i-iterate-through-a-mysql-result-set ActiveRecord::Base.connection.exec_query  用这个。  不要用 ...execute.   例如: irb(main):006...

Ruby Railsprofiler Memorylogic10年前的东西,目前已经成为一个plugin

参考:https://github.com/binarylogic/memorylogic 专门为rails使用。每次请求都会在logger中增加某条请求的内存使用情况 用法 class Applicationcontroller  include Memorylogicend 然后查看日志就行。

Ruby 把string转换成datetime

# 这个是 Rails的 model.to_json 后,产生的默认的日期格式 my_string = '2019-06-29T16:35:45.000+08:00' DateTime.strptime(my_string, "%Y-%m-%dT%H:%M:%S.%L%z")