Dom Christie

Today I Learned

Ruby’s Enumerable#tally:

["a", "b", "c", "b"].tally  #=> {"a"=>1, "b"=>2, "c"=>1}

rails runner runs Ruby code (including Ruby files) in a Rails context from the command line:

bin/rails runner lib/code_to_be_run.rb