5 days per week, a ruby 💡tip - By @blaked_84

🇫🇷
Joined July 2018
Subscriptions are now open for the @daily_ruby_tips newsletter! 📅 1 mail / week 📁 all the tips of the week 👉 beckr.fr/daily_ruby_tips
4
5
I haven't started posting tips yet, but I'm hiring a Ruby on Rails + Vue.js dev. French + english speaking 👇
Evalmee.com is hiring a Ruby/Vue.js dev! 🚀 We're building an online exam platform for higher education & professional training, and looking for people who can pick a problem and solve it. 🎓 >4 years of exp 🇫🇷 Paris or full remote evalmee.welcomekit.co/jobs/d…
1
392
Hello Ruby devs! I take a break for a few days. I'll be back soon with some new tips!
3
17
Get last output in console
7
Writing large Integers 💻 Copyable example at: beckr.fr/daily_ruby_tips
1
8
😱 There is an error in today's tip! Thanks you @Jauny! You should read this 👇
Replying to @daily_ruby_tips
shouldn't the return of find e[:a] == 1 be {:a=>1, :b=>2} instead of {:a=>2, :b=>3}?!
5
Enumerable#find Do you know you can pass a proc to `find` to return a default value if no object matches? 📖 Doc: ruby-doc.org/core-2.5.1/Enum… 💻 Copyable example at: beckr.fr/daily_ruby_tips
1
2
10
Would you be interested to see Rails tips on @daily_ruby_tips ?
93%Yes
7%No
91 votes • Final results
2
2
4
Enumerable#partition 📖 Example from ruby-doc: ruby-doc.org/core-2.5.1/Enum… 💻 Copyable example at: beckr.fr/daily_ruby_tips
2
17
Unescaping text. Sometime I have to handle escaped text and... no regex tip here. Since ruby 2.5 I use `undump` 😀 📖 Doc: ruby-doc.org/core-2.5.0/Stri… 💻 Copyable example at: beckr.fr/daily_ruby_tips
2
11
`split` is not the only solution to split strings. 📖 Doc: ruby-doc.org/core-2.5.0/Stri… & ruby-doc.org/core-2.5.0/Stri… 💻 Copyable example at: beckr.fr/daily_ruby_tips
1
1
4
String#strip I'm sure you know "strip". What about "strip!", "lstrip" and "rstrip"? 📖 Doc: ruby-doc.org/core-2.5.0/Stri… 💻 Copyable example at: beckr.fr/daily_ruby_tips
4
String#center Before, I used `puts "###### Title ######"` to print title in stdout. But I hated to center a text manually. Now I use 👇 📖 Doc: ruby-doc.org/core-2.5.0/Stri… 💻 Copyable example at: beckr.fr/daily_ruby_tips
String#casecmp? If as me, you currenlty use `"aBcDeF".downcase == "abcdeF".downcase` look at this 👇 📖 Example from the ruby doc: ruby-doc.org/core-2.5.0/Stri… 💻 Copyable example at: beckr.fr/daily_ruby_tips
2
12
Struct VS OpenStruct 💻 Copyable example at: beckr.fr/daily_ruby_tips
8
I ❤️Struct! Struct provides a nice way to organise data inside a class. Exemple inspired by this article by @leighchalliday leighhalliday.com/ruby-struc… 📖 Doc: ruby-doc.org/core-2.5.0/Stru… 💻 Copyable example at: beckr.fr/daily_ruby_tips
1
3
11
We continue with other Time tips. And if like me, you never remember the strftime syntax – from ISO 8601, yes it is standard – you can use foragoodstrftime.com by @mbuckbee. 💻 Copyable example at: beckr.fr/daily_ruby_tips
1
7