Today I Learned

TIL, 2017-08-02

  • Webmock assert_requested.
  • git commit -v to Reference
  • Resizing a window: opt to resize opposite corner, shift to resize and maintain aspect ratio. Reference
  • Default screenshot location changed. Reference
  • brew cleanup actually removed 572.1 MB of disk space. Reference
  • Rails: Date.today.advance(days: 1) to move the date.
  • Rails: To read an attribute you can do read_attribute.
  • Rails: Hash.slice to get keys you want.
  • Rails: Object.presence to retrieve the object if it exists.
  • Pry-Rails: show-routes and show-models.
  • rake db:migrate:status.
  • rspec --only-failures.
  • all? without a block checks if they are all truthy.
  • Array of stringed numbers: ('1'..'5').to_a
  • The User.matches is a lot harder on pure SQL, lol.
  • Full server: Delete Capistrano releases.
expect {
  Project.generate(attrs)
  }.to change{ Project.count }.by(1).and \
       change{ User.count }.by(1)
  • Read Stripe implementation of HTTP clients.
    • Different connection for client.
    • Able to should_retry?: retries on a TimeoutError, a ConnectionFailed, and a 409 (Conflict) HTTP code.
    • Check if SSL certificates are verified.
    • Gem::Deprecate and deprecate :uri_encode, "Stripe::Util#encode_parameters", 2016, 01.

This project is maintained by daryllxd