quattro_4 scribble

scribble 落書き (調べた事をただ落書きする)

RubyPlus #34

https://www.rubyplus.com/podcasts/391-Episode-34

  • Redis 4.0 General Availability
    • new replication engine and the ability to extend Redis itself
  • How I reduced my database server load by 80%
    • heroku pg:outliers command which comes from this Heroku a pg:extras CLI extension.
  • How to safely store API keys in Rails apps
    • Pros & Cons - Save directly in codebase, Save in ENV, Save in DB
    • Save in DB and encrypt attr_encrypted
  • Spreadsheet Architect
    • turn any activerecord relation or ruby object collection into a XLSX, ODS, or CSV spreadsheet
  • Fast CSV Report Generation with Postgres in Rails
    • conn.copy_data "COPY (#{sql_query}) TO STDOUT #{options};" do
  • Rails on Docker: Getting Started with Docker and Ruby on Rails
    • docker run --rm -it --env RAILS_ENV=development ...
  • 2 Tests You Should Run Against Your Ruby Project
  • Speed Up Your Rails Test Suite By 6% In 1 Line
    • unless ENV['RAILS_ENABLE_TEST_LOG']
      • config.logger = Logger.new(nil)
  • Ruby on Rails Code Audits: 8 Steps to Review Your App
    • grep -v 'add_index' db/schema.rb | grep '_id' | wc -l
    • grep 'add_index' db/schema.rb | wc -l
    • grep -ir 'todo' app/*
  • Running feature specs with Capybara and Chrome headless
    • capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
      • chromeOptions: { args: %w[headless disable-gpu] }
  • Graphing Benchmark Results in Ruby
    • benchmark-ips
  • 5 ways we’ve improved flakey test debugging

RubyPlus #33

https://www.rubyplus.com/podcasts/381-Episode-33

  • Nanoc - Static Site Generator
    • flexible static-site generator (a small personal blog to a large corporate website)
  • Demystifying Rails
  • Upgrading Shopify to Rails 5
    • Upgrading the Shopify monolith - one of the oldest and the largest Rails applications in the industry
      • from Rails 4.2 to 5.0 took us nearly a year.
  • Helpful Resources for Your Rails App Upgrade
  • Ruby Standard Gems
    • Default gems
    • Bundled gems
  • Testing Cookies in Rails
    • rack-test get_cookie method
    • Timecop
  • How We Upgraded A Very Large App from Rails 3 to Rails 4
    • BUNDLE_GEMFILE=Gemfile_rails4 bundle exec
  • redis_dashboard
    • Sinatra app to monitor Redis servers
    • mount RedisDashboard::Application, at: "redis_dashboard"
  • nplusone_control
    • expect { ... }.to perform_constant_number_of_queries.matching(/INSERT/)
  • Replacing a Complex Regular Expression with a Simple Parser
    • Step through a string, character by character
    • Append each character to a buffer
    • When a token-separating condition is encountered, save the buffer to an array and empty it.
  • What I learnt today from reading gems' code
    • Sidekiq
      • Sidekiq.redis_pool
      • yielding for configuration
    • ActiveSupport::TaggedLogging
    • self.new in a module
  • ActiveRecord callbacks: an after_commit gotchya
    • callbacks can certainly enable bad design
  • Ruby Code Formatter

RubyPlus #32

https://www.rubyplus.com/podcasts/371-Episode-32

  • Performance Updates from RailsConf 2017
  • Why write code when more dependencies will do?
    • Polyfill implements newer Ruby features into older versions
  • RedDot RubyConf 2017
    • Two days single track Ruby conference is taking Place in June 22-23 in Singapore
  • Fragment Caching with Rails 5.1
  • Announcing an open data set on the open source community
    • Open Source Survey
    • What people value in the software they use and in open source projects
    • How and where people find and provide help
    • Privacy preferences and practices
    • Employer policies around using and contributing to open source
    • Negative experiences and their consequences
    • Personal backgrounds of community members
  • Grafana 4.3 Beta Release
    • New Heatmap Panel
    • Elasticsearch Histogram Aggregation
  • RailsConf 2017: Perusing the Rails Source Code - A Beginners Guide
    • This video outlines steps you can take to explore the inner workings of Rails
  • Instantly prepare your ERB templates for translation!
  • darnbrokenrails: A Cyber Security/Code Quality Teaching Tool for Rails
    • cybersecurity / code quality teaching tool for Rails
    • bundler-audit, brakeman, rails_best_practices

Ruby Facets #7

Seven.new | Ruby Facets

  • What makes Rails a framework worth learning in 2017?
    • despite all the front-end progress and excitement, there’s always a need for the back-end for databases, computing, job queueing, mailers, push notifications, and much more
  • Ossert
    • Ossert
    • Maintenance, Popularity, Maturity
  • The Difference Between to_s & to_str In Ruby
    • to_str - object CAN behave like a String
  • ROM 3.0
    • rom-sql and rom-repository
  • Ruby Coercion Protocols
  • Two screencasts, two ways to erradicate Ruby nil values
    • Ruby Tapas
    • Special Case and Null Object patterns

RubyPlus #31

https://www.rubyplus.com/podcasts/361-Episode-31

  • HTTP2 Server
  • RailsPanel: A Chrome Extension for Rails Development
    • tailing of development.log
    • db/rendering/total times, parameter list, rendered views and more
  • Background jobs and deploys
    • indempotent
    • Always prefer many smaller jobs to one large job
  • What About Warmup?
  • Deploying a Rails Application to Elastic Beanstalk
    • Elastic Beanstalk in a Virtual Private Cloud (VPC) on Amazon AWS
  • Faster Rails: Is Your Database Properly Indexed?
    • double index (polymorphic)
    • Any frequently used sorting can be improved by using a dedicated index
  • A Starter Guide to Ruby Backend Performance
    • bullet, rack-mini-profiler
    • derailed_benchmarks
  • Polyfill: Use Newer Ruby Features on Older Versions
    • The polyfills are built using refinements so there is no monkey patching
  • Don’t Use Objects as Hash Keys in Ruby
    • 313% slower than it would with a Symbol type object
  • The hidden cost of the invisible queries in Rails
    • if Actor.limit(1).count == 0
    • exists? method is good
  • CuckooFilter
    • a probabilistic datastructure which is objectively better than Bloom Filters for set-membership queries

RubyPlus #30

https://www.rubyplus.com/podcasts/351-Episode-30

  • Rails 5.1 Released
    • manage JavaScript dependencies from NPM via Yarn
    • Optionally compile JavaScript with webpack
    • jQuery is no longer a default dependency
    • system tests using Capybara
    • encrypted secrets
    • parameterized mailers
  • Oj (Optimized JSON) 3.0 Released
    • Faster than the built in Ruby json gem
  • Write Native Ruby Extensions ‘Without Fear’
    • Helix makes writing Ruby classes in Rust
  • Boot large ruby/rails apps faster
    • optional support for ActiveSupport and YAML, to optimize and cache expensive computations
  • Search and Autocomplete in Rails with Postgres
  • Rails 5.1 has introduced Date#all_day helper
    • User.where(created_at: Date.today.all_day)
      • SELECT "users".* FROM "users" WHERE ("users"."created_at" BETWEEN $1 AND $2)
  • The Good, Bad and Ugly: The Story of a Rails 5 Upgrade
  • acli: A Command-Line Client for Action Cable
    • Action Cable command-line client
    • written in mRuby
  • Implicit Code : Programming with a love of the implicit
    • DHH: explicit code is not always better
  • Ruby on Rails: the Bad and Good parts
    • Hanami, Roda
  • Postgres tips for Rails developers
    • Manage long running queries with statement time-outs
    • Finding misbehaving queries
  • Some Lesser-Known Features in Rails 5.1
    • More consistent tag helpers
  • Caution when using before_destroy with model association
    • before_destroy :remove_external_account, prepend: true
  • Parsing Excel Files with Ruby
    • axlsx, rubyXL, roo, creek, spreadsheet, simple_xlsx_reader

RubyPlus #29

https://www.rubyplus.com/podcasts/341-Episode-29

  • One Line of Code that Compromises Your Server
    • how such a weak key can be cracked
    • In just 43 seconds we blasted through over a billion hashes and, 85.34%
  • Rails Benchmarking: Puma and MultiProcess
    • One consequence of the GIL is that a single Ruby process has limited ability to fully use the capabilities of a multi-core machine, including a larger AWS instance
  • 5 Tips for More Effective Capybara Tests
    • all 'a.btn-signup', count: 1, wait: 5
    • click 'Sign', exact: true
      • Capybara.exact = true
  • Fae: A Flexible, Open-Source, Rails-Based CMS
    • gem 'fae-rails'
  • Difference between Date, Time and DateTime
    • Ruby’s Time class implements a proleptic Gregorian calendar and has no concept of calendar reform
  • Monitoring Sidekiq Using AWS Lambda and CloudWatch
    • how to monitor Sidekiq retries using AWS Lambda
  • GitHub::DS
    • A collection of Ruby libraries for working with SQL on top of ActiveRecord’s connection
    • kv = GitHub::KV.new { ActiveRecord::Base.connection }
  • The state of Ruby on Google Cloud Platform
    • App Engine flexible environment
    • tested the top 1000 Ruby libraries, a.k.a., gems
      • including C extensions
  • Jumping Off The Ruby Memory Cliff
    • rack-mini-profiler or derailed benchmarks
  • A 50 Minute Chat About The Forthcoming Rails 5.1