Today I Learned

TIL, 2017-03-31, We Have Monokai

  • http://craftingruby.com/posts/2015/06/29/query-objects-through-scopes.html
  • Delegate call to new instance of the object
  • http://batsov.com/articles/2014/02/17/the-elements-of-style-in-ruby-number-13-length-vs-size-vs-count/
  • Array.fill is destructive (why not just have Array.fill! again?).
  • Array.take returns an empty array if the array is empty. Array.first returns nil if the array is empty. Reference
  • I think I can use Array.transpose, Array.sample, and Array.permutation. (I must have reimplemented them at some point when I could just have looked at the source.) Reference
  • Breaking up longs strings to multiple lines. Reference
string = "line #1"\
         "line #2"\
         "line #3"

p string # => "line #1line #2line #3"
  • Just to clarify: a ||= b means a = b when a == false (falsey).
  • Nokogiri apparently needs other things like libxml2.
  • To remove the ‘You have activated rake 0.9.0, but your Gemfile requires rake 0.8.7’ types of errors, you have to coerce the Gemfile version to the version that all of the gems want. Reference
  • Meta TIL: To add rouge actual CSS to this freaking blog, I followed the instructions here. We have Monokai now!
  • Another meta TIL: You can’t add plugins to Github pages. I’m seriously thinking about just building the page first then pushing after. But then again I won’t be able to have a blog for a few days so yeah.

This project is maintained by daryllxd