This was one of those tasks I was sure we were going to put off for way too long.
We still don't have a four-year badge designed, but I feel like this part of the code now could probably be refactored to account for an arbitrary number of years, and maybe take an environment variable to determine how many to iterate through.
Anyone who wants to refactor this so we don't need to add a new method every year is welcome to submit another PR at some point in the next 11 or so months. 😄
Native Android developer/Consultant for Appwise, I work on custom projects for clients.
PHP/JS (web) developer in my freetime. Trying to keep learning in an ever changing tech world.
Interesting, this would indeed be a good improvement to be more future proof. Only thing you still would need to do is prepare the designs for the upcoming years but you could make a couple at once so you will be good for a few years 😉
I am triggered by this challenge but am afraid that my knowledge in Ruby isn't good enough right now.
defself.award_x_year_badges(x)@n={1=>"one",2=>"two",3=>"three",4=>"four",5=>"five",6=>"six",7=>"seven",8=>"eight",9=>"nine",10=>"ten"}s=x==1?"":"s"message="Happy DEV birthday! Can you believe it's been #{@n[x]} year#{s} already?!"User.where("created_at < ? AND created_at > ?",(x).year.ago,(x*365+2).days.ago).find_eachdo|user|achievement=BadgeAchievement.create(user_id: user.id,badge_id: Badge.find_by_slug("#{@n[x]}-year-club").id,rewarding_context_message_markdown: message,)user.saveifachievement.valid?endendforxin1..10self.award_x_year_badges(x)end
Though I don't really know ruby either 😅
I'm not sure this line would work as expected
User.where("created_at < ? AND created_at > ?",(x).year.ago,(x*365+2).days.ago).find_eachdo|user|
Just a coder and a dad. I love my family and I love to code!!!! started coding at 11, so I have 25 years under my belt. Still love learning about it every day. Black lives matter!
dude!! So awesome! You totally encouraged me to try this myself. I literally looks at the repo the other day and was going to fix an issue (also not a ruby dev) but I was like... no they probably won't want me to. Thanks to you, I know I should!
Native Android developer/Consultant for Appwise, I work on custom projects for clients.
PHP/JS (web) developer in my freetime. Trying to keep learning in an ever changing tech world.
Awesome! I never expected that I was going to encourage anyone to contribute with my small PR and post 😂 But so happy that I did!
I thought the same in the past with a Node project (cdnjs.com) after a year, during Hacktoberfest, I finally did it and it was a lot of fun. I have tried different small projects/tweaks in the past, python, node and now ruby, always fun to step out of your comfort zone and just mess around.
Just a coder and a dad. I love my family and I love to code!!!! started coding at 11, so I have 25 years under my belt. Still love learning about it every day. Black lives matter!
I'm a fan of Open Source and have a growing interest in serverless and edge computing. I'm not a big fan of spiders, but they're doing good work eating bugs. I also stream on Twitch.
Native Android developer/Consultant for Appwise, I work on custom projects for clients.
PHP/JS (web) developer in my freetime. Trying to keep learning in an ever changing tech world.
Native Android developer/Consultant for Appwise, I work on custom projects for clients.
PHP/JS (web) developer in my freetime. Trying to keep learning in an ever changing tech world.
This was one of those tasks I was sure we were going to put off for way too long.
We still don't have a four-year badge designed, but I feel like this part of the code now could probably be refactored to account for an arbitrary number of years, and maybe take an environment variable to determine how many to iterate through.
Anyone who wants to refactor this so we don't need to add a new method every year is welcome to submit another PR at some point in the next 11 or so months. 😄
Interesting, this would indeed be a good improvement to be more future proof. Only thing you still would need to do is prepare the designs for the upcoming years but you could make a couple at once so you will be good for a few years 😉
I am triggered by this challenge but am afraid that my knowledge in Ruby isn't good enough right now.
I'd guess something like this
Though I don't really know ruby either 😅
I'm not sure this line would work as expected
This week my second dev.to pr merged. I’m so happy. This makes me feel better. Being part of the dev.to contributors is awesome.
Thanks @ben
dude!! So awesome! You totally encouraged me to try this myself. I literally looks at the repo the other day and was going to fix an issue (also not a ruby dev) but I was like... no they probably won't want me to. Thanks to you, I know I should!
Awesome! I never expected that I was going to encourage anyone to contribute with my small PR and post 😂 But so happy that I did!
I thought the same in the past with a Node project (cdnjs.com) after a year, during Hacktoberfest, I finally did it and it was a lot of fun. I have tried different small projects/tweaks in the past, python, node and now ruby, always fun to step out of your comfort zone and just mess around.
Ya! you made a big step today. I was blown away by what happens when you put yourself out there. It helps others, so thank you!
Congrats Glenn on getting your first PR merged! 🔥
Thanks! It wasn't that big of a change and I am sure anyone could have done it but it still feels great to be able to contribute to this community.
Good stuff!
Nice! I had one merged a couple weeks ago too. Feels good man.
Welcome to the PR-ty ! ☜(゚ヮ゚☜)
I'll_see_myself_out_
Awesome PR! Everyone needs a little music in their life 😉
Congrats!! Keep it up and treasure that feeling to keep going :)