 How are you guys doing? We're just gonna look at that. Okay, my name is Justin Louie. I'm some random guy at GlovaPass.com And we are bringing you five ruby tips that we've been learning over the past couple months We're gonna start with really application-specific and then we're gonna broaden out to something. Hopefully everyone can enjoy So I'll start off with a RayDot Wrap What this a RayDot Wrap does it allows us to ensure that what we're working with is always gonna be a Ray In particular, we're working with a really bad API Integration point and they don't return necessarily a hash or maybe they return an array We don't know which one they're gonna return based upon one or many in that particular response So we use one way to do it is to do is response is an array, right? That's a really common way to do it A cooler way is definitely a RayDot Wrap and you wrap the response Which then guarantees you that response will be an array All right moving along real quick. So pluck I know some of you guys have seen this one pluck is really cool because Traditionally a lot of people will do something like lesson dot everything is canceled, right? And I want the name of all the canceled lessons and right now this takes somewhere around four point eight seconds Which is a pretty long time ruby goes in Estantiates and loads every single one of the lesson objects and then we pull out the names Plex skips a lot of that it only pulls out the name column or the particular column that we want in this in this case And it doesn't instantiate any of the objects So we went from four point eight seconds down to a tenth of a second ish, right? And so this is on our particular database So here's a cool thing that we've been working on is skipping callbacks particularly in a thread safe way What happens is a lot of people do Validation checks very you know want to make sure data is Proper insured phone numbers are looking good emails are great Let's say we have a person and we want to upload an embarrassing photo of this crazy guy, right? If you can't see it's my name up there But anyways what we're going to do is we have a validation that blocks embarrassing photos But for this particular guy that we want to shame we need to remove that validation But in this particular case, let's say The the upload takes five minutes and we don't want that five minutes for everyone in the company To skip the validation for right? We still want other users to be able to have it this particular validation check So all you have to do is Ruby gives it doesn't really give us a great way to do this. I apologize about the colors So come see me afterwards if you really want to know about this But you put an attribute accessor in and then in the particular validation that you're about to perform All you do is do a check and so now we can shame this particular guy Probably uploading a 13 year old photo of him just bowl on top just like crazy Let's say Next tip let's say there was an online game where in particular you had to click to win And if you dug around in the website itself this particular website that's going to remain nameless Has a particular endpoint that you can hit So what are the ways that we want to be able to hit it? Well, if you look at the parallel gem Handling parallel threads is actually really annoying not really annoying But it's come for some of the sense that you don't want to have too many thread leaks right parallel does that take care of it All for you. So it's a simple for loop I'm just gonna hit this thing a million times Let's say in a hundred threads and it just goes out and it looks for something in particular i.e In our particular random case We were looking for sections 1 5 and 9 and 14 to appear and in a million times They never really appeared so we didn't win Okay, for our last little bit this one's not a ruby thing, but I think it's something you can all enjoy I term to if you click command Command click any url. It'll it'll load it for you So you don't have to like actually copy and paste right super easy One that's a little more obscure is if you option click in a long string It'll take your cursor and go to that particular position If you're dealing with the IRB just note that I cheated here if you scrunch up so it's multi-line It doesn't work. It has to be in a single line inside the IRB But if you're in the terminal anyways Outside of IRB this works great multi-line. It doesn't really matter And that's it. Thanks guys We are hiring we're looking for front-end gurus, so react angular guys if any of you are in here There we okay, okay, I'm allowed to oh cool cool. Um, so 10 10 30 seconds Yeah, guava pass is a subscription service into various fitness studios So things like spinning yoga There's also pole dancing Winston if you're really interested in pole dancing I think you know you'd be good up there, man. You'd be good up there I heard a commitment All right. Thank you guys