Today I Learned

TIL, 2017-05-09

  • group_by–we can do things like this: names.group_by { |name| name[0] }
  • data.group_by { |number| number /20 }
  • Ruby Struct, you can get elements by index as well by name:
  • Structs don’t have native keyword argument support.
Person =, :age)
p ="fred", 26)
  • The error that Ruby raises when it can’t find a method is NoMethodError.
  • cp -i for interactive mode, cp -r for copying recursively.
  • mv -i for interactive mode.
  • rm -r for recursive directory removal.
  • chmod 777 myfile. Number explanation:

This project is maintained by daryllxd