TIL: How to Prettify Ruby's inject Method
Using each_with_object over inject
TIL: How to Quickly Get Regex Matches in Ruby
I often want to get the string from a regex match. If I'm only bothered about getting the first match, this shorthand works
TIL: You Can Use Lambdas in Ruby Case Statements
Using lambdas inside Ruby case statements
TIL: Ruby Knows the Source of Required Code
There's a magic variable which, if initialised, will contain the source of all the files imported afterwards
TIL: Using File Locking for Exclusivity in Ruby
Two TILs in one, how to use native file locking to prevent more than one process running at the same time
TIL: Ruby Has a Built-in Persistance Database
Did you know Ruby has a built-in database?
TIL: Ruby Associative Arrays
Using arrays as if they had keys
TIL: Automatic Deep Keys with Ruby Hashes
Generate keys automatically for building deep hashes quickly. Best explained with an example.
TIL: Matching Multiple Values in a Case Statement
Matching more than one value in a case statement