Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Groningen.rb RailsConf 2015 recap

Groningen.rb RailsConf 2015 recap

Small and simple recap of RailsConf 2015 for Groningen.rb

Remon Oldenbeuving

April 28, 2015
Tweet

More Decks by Remon Oldenbeuving

Other Decks in Programming

Transcript

  1. Prying open the black box • Stack traces are cleaned

    by default in Rails • puts caller gives stack trace without raising • pp instance_values • rails new —dev
  2. Prying open the black box • export DISABLE_SPRING=1 • git

    blame abcdef^ FILENAME • bundle open activerecord • gem pristine cleans gems
  3. Speed Science • https://github.com/htcat/htcat • Disk IO is most of

    the times the problem • https://github.com/schneems/derailed_benchmarks
  4. Processes and threads, sidekiq vs rescue • Pry is awesome

    • Unicorn does a lot of awesome magic • http://thorstenball.com/blog/2014/11/20/unicorn-unix-magic-tricks/ • gem install pry-stack_explorer • gem install pry-byebug • gem install pry-rescue
  5. Resque • Uses fork • mitigates the risk of leaking

    memory • avoids the cost of booting rails for each job
  6. Aaron Patterson • Main focus for the coming year: speed

    • bundle exec is exponential based on amount of installed gems • Difference between controller/integration tests • https://github.com/tmm1/stackprof
  7. Implementing a visual CSS testing framework • A lot of

    existing packages that do a similar thing: • Huxley, Phantom CSS, GhostStory, Cactus, Needle, CSSCritic, fighting-layout-bugs, sikuli, Mogo, Quixote • Not the right fit, so: Do It Yourself ™ • BugSnag has a separate service that runs screenshot tests and that posts back to pull request with the outcome. • Screenshots are compared between branches
  8. The World of Rails Security • Rails isn’t fully secure

    by default • html_safe does not make strings safe • CSRF doesn’t apply to GET • CSRF tokens persist per session • By default when a CSRF error occurs, Rails will continue the current action unless explicitly being told not to (fixed in a couple of versions)
  9. The World of Rails Security • Server-side session are not

    default • Session cookies are forever by default • No build in account management • No build in authorization framework • link_to not safe by default • etc etc: http://blog.codeclimate.com/blog/2013/03/27/rails-insecure- defaults/