# I have some fruits...fruits=<<END_OF_FRUITS
Apple Orange Banana
Pineapple Strawberry Apple
Orange Apple Strawberry
END_OF_FRUITS# "Apple Orange Banana\nPineapple Strawberry Apple\nOrange Apple Strawberry\n"# I want to split with space and CRfruits.split(/ |\n/)# ["Apple", "Orange", "Banana", "Pineapple", "Strawberry", "Apple", "Orange", "Apple", "Strawberry"]# I want to make a GROUP BY like a DBfruits.split(/ |\n/).tally# {"Apple"=>3, "Orange"=>2, "Banana"=>1, "Pineapple"=>1, "Strawberry"=>2}# How many Apples can I eat this morning?fruits.split(/ |\n/).tally["Apple"]# 3
Thank you for this summary! I'm brushing up my Ruby skills and this cheat sheet jogged a lot of things for me.
For the exception handling part, I think you meant 1 / 0 for ZeroDivisionError. It's written as 0 / 1 in two lines and one comment, which is just 0 and shouldn't produce an error.
Businessman and blogger #Javascript, #Python and #PHP. My favorite frameworks/librairies are #React, #Laravel, and #Django. I am also a fan of #TailwindCSS
Thanks for putting this out there.
I have one suggestion:
Consider making "dealing with Nil values" its own section. :)
This is great!
This article is very great, thanks
Have added it to my snippets :D
Oh wow!! I love this. I’m going to read it in depth tomorrow to my morning coffee!
This is truly helpfull. Also want to have the same for PHP and Python
Thank you for this summary! I'm brushing up my Ruby skills and this cheat sheet jogged a lot of things for me.
For the exception handling part, I think you meant 1 / 0 for ZeroDivisionError. It's written as 0 / 1 in two lines and one comment, which is just 0 and shouldn't produce an error.
I had never heard of screaming snake case until today and I am so delighted to find out about it 😂
Updated the cheat cheat with couples more info related to array contact and couples other things.
Thank you so much for this
Thanks! Very useful.