 All right, so this was not planned, but this actually dovetails kind of nicely from the last talk. I got interested in refinements in Ruby, the thing that nobody uses, and most people don't have any idea really how it works. So I decided to try something, and I made a polyfill library. So the idea is, if you're familiar with JavaScript, this may sound familiar to you, but the idea is that you can port features from newer versions of Ruby into older versions of Ruby. This is particularly helpful if you're in, like, a lockdown environment for some reason, or if you're a gem author and you're trying to support a wide range and you want to still be able to use some of the latest stuff. So you can require the gem in and then using it. Is this big enough for everyone to read? I tried to blow it up. All right, so you can say basically the class you want followed by the methods you want to pull in. Using is, by the way, how you refine something in, just if that doesn't look familiar. And the nice thing about refinements is you can use these without monkey patching everything and messing with other people's code. So if you have a gem and you pull in active support, you destroy everything. So I built this out. It's got also the ability to include these in if you are in a situation where you're inside of a module because that didn't gain support until after Ruby 2.4. And I've got a whole implementation table of things, and you can see a lot of Xs over here, which kind of gets to what I wanted to talk about, which is that I would love to get some help on this. I cannot promise you fame. I have 79 stars, that's not a lot. As Eric Berry pointed out, I can't promise you money. Because there is none. But I did try to make it, there's a lot of code that if you wanna dig into it, it's open source, but you don't really have to understand to help. This is an example, I'll make it a little bigger here, of me adding the clamp method, which just takes anything that's comparable and allows you to keep it within a range. So it doesn't exceed either end of the range. Adding it was not too bad. There's Ruby spec where you can get tests. So essentially pull in the test, do the implementation. A lot of these aren't complicated. There are some very complicated ones that people are inclined in that direction as well. And it's pretty easy. Like if you put them in, I've got it set up so that class methods are just in this module. So this is polyfilling version two five integer methods. Class method square root versus like seal though, is just now it always spits out an integer. So that's one that's not very complicated. So this can be a very good way if you've been wanting to try to contribute to open source. There are a lot of smaller things that you can try out. Pull over the test, you don't have to understand a whole library to do this. You just have to implement one method. Send it over. I won't bite your head off. You've heard me say that in person. So hopefully that makes it somewhat trustworthy. And I've got a contributing doc that will tell you where you can find some information about changes, kind of where you can go to pull tests. Let me shrink this down a little bit. Where you can go to pull tests, how things are laid out, and just the general process. So like I said, I'd love to get help from any and everyone. If it's something you're interested in, just hit me up afterwards. That's it. All right. Thanks. Okay. Like any good lightning talk, I just learned about what I'm gonna tell you about on Monday. I'm gonna do some live coding and pull the audience. So hopefully this kind of works. All right. So why not crypto? Okay, Mark, thanks. Everyone go here. It's pull time. And I'm not fancy enough to do a QR code, sorry. And I don't know how to go back there. So sorry again. All right. First question, are you crypto friendly? Oh no. Okay, there's your link. You guys look at the results. I don't know how long this is gonna take. Zero people. One person. Good enough for me to keep going. Okay. Crypto coin. Blockchain, Bitcoin. What's a crypto? Yes, also an option. Okay. That's good enough. My next question. I don't know how to do this. Mark help me out. All right. How have you participated in crypto? I'm gonna pull this up after because I'm super interested. So just more for me than you. Sorry. Okay. That's pretty good. And that's my last one. This will determine the direction I go with this talk. So it seems like it is the end of the day on a Friday, guys. I had to put that one out there. Okay. All right. So it seems like no matter what I've done over the last six, nine months, crypto has been like in the air and around me, right? Background, I studied finance in college. I did a little bit of stock trading, day trading stuff. Nothing really. I like this more than that. So I'm here. Okay. So I always used to think and pre like fall winter of 2017, this was true. If you wanted to ever make money in crypto, the money was in mining. Until we had this whole graphic card shorted and this whole thing happened. Okay. So I've dabbled with a lot of things. This is a really small view. Like I did this like mining pool, this hash flare. I like to try these things just to understand how it all works, right? So I did like this hash flare, like mining pool thing where I've got like 225 mega hashes, mining litecoin for me. So I tried a little bit of that. If you guys are interested in that, let me know after. And then I, this is gonna get really fun. Okay. Decided I'm gonna try this whole like biting, selling, trading thing. So like anybody, I'm showing all the highlights and none of the pitfalls here. Okay. So I started off like with Coinbase and that got super expensive. Then I found out they had this tool called GDAX which is like an actual trading form of Coinbase. So I'm gonna show you this a little bit today. And I started out doing a couple of things and I was like, all right, I'm gonna put some money in here. I put a lot in there, but I wasn't gonna use it all. I was just gonna pace myself with it just to figure out like, well, if I decided to go crazy on one day, whatever. Okay. So I was like, all right, let's put some money in there and let's buy some litecoin. It's like, you know, Bitcoin, I feel like I'm gonna get like screwed because I have so many friends who have gotten screwed over that and lots who have made lots of money. Okay. So I bought some litecoin. I bought 10 of them. It's like, okay, cool. So my first strategy was like, all right, I just wanna play with this. So I was like buy low, sell high, right? So over like the last two months, I basically took that initial 1400 bucks and my strategy was basically like, it's pretty same. I'm just gonna like buy some at 145, sell it at 155, buy a board, 45, 155. I was like, all right, kind of worked. At one point it felt like, what's that? Okay. All right, fast forward. So I decided, all right, I did pretty good there. And then I decided, let's automate this because what could ever go wrong? So automated trading on Bitcoin is what I did. Basically seeing this stuff's changing all the time. So I wrote some great code. It's out there on GitHub. Actually, this guy wrote some great code. It's out here on GitHub about this cool strategy about this stuff that's really just kind of like an automated thing where you buy low and sell high. Okay. I can deal with this. So I got 30 seconds. So you fire it up and you run it and it makes a bunch of buys and a bunch of sales and I tweak this stuff. And despite Litecoin being relatively flat until last night, somehow over the last like two days of automated trading, I made like 150 bucks, which isn't bad, right? Yeah. So if you want to play with Ruby and try and waste a lot of money, there's this cool little automated bot trader you can use. If you want to talk about it, let's talk. So I don't have a PowerPoint for you here. My talk is called, I'm a girl, so what? My name is Leah. And you might notice that I'm female. Right. I have 20 years of experience, actually more than that, but I don't really want to tell you how much in the business world. And I have a strong background in business management and marketing and product management, digital product management specifically. And I started working more in the digital world about 10 years ago and I only started coding actually about two years ago. And I've been doing test automation since then, I really love it. So I'm used to getting asked to talk about being a woman in business. But since I've become a woman in tech, it's almost like you're expected to talk about it, right? The thing about being a woman in technology, people want you to talk about being a woman in technology. So this bugged me for a while because I was like, I just want to see badass women get up there and do some cool geeky stuff, you know? Like, I don't want to hear you keep talking about what it's like to be a female in business. We already know it. Go show it, you know? But I've had some more time in the industry now and I kind of realized why this keeps happening. And so I've come to a point now, this is the main point I want to share with you guys today. What's important is diversity of thought and diversity of background. It doesn't matter if it comes from gender. It doesn't matter if it comes from race, experience, age, be it young or old, wherever it's coming from, innovation and evolution happens through diversity. That's how this occurs, right? Like dogs that are mutts, they're the ones that live longer, right? They're the healthier ones. So when we put our ideas together and we really try to listen to each other and work through something together, then at the end of this conversation, we can end up with something that we hadn't thought of that's better than what we thought we wanted to do or maybe we end up where we were and all we really got out of it is I really understand this person I was talking to a lot better now and when I collaborate with them in the future, I kind of have a better idea about how to do that. So when I want to leave you here with today in all aspects of your life, regardless of the technology field, wherever you go, diversity of thought and background. When somebody says something to you that for whatever reason doesn't sit right, stop and ask yourself, why? How Marianna am I into this? Is it really important to be right? Usually it's not really very important to be right. So stop and ask some questions and listen and be thoughtful and participate and take it with you wherever you go. Please. Thanks. All right. So can talk a little bit about test locality. This is kind of riffing off of what David talked about yesterday with all the testing stuff. It was a great talk, loved it. Really about reducing cognitive overhead in your tests. The problem that I kind of took away from his talk which we've all suffered from is I want to know why this test is failing but to figure that out I've got to go here and here and here and here and wait, what was over here again? And if we have to do that we can never really figure out what's going on with our tests. So the pattern that this all comes down to is called arrange, act, assert, shout out to TAB for pointing this out to me. But if you have really clearly in your test I'm setting this up. I'm doing this thing and I'm testing it with all the literals right there. I totally agree with the literal thing. It makes it very easy to see what's going on and very easy to do. That's not too bad in your tests. What you get to a problem here is with integration tests where you have a thing that's testing lots of stuff so you need to set up like 30 objects in your database before you can get to your test. What do you do? Well, well actually before we get to that, sorry but there's a couple of places to read it non locality. One of them is your test helper. Hopefully that stays nice and small but sometimes that can get bloated. Lots of complexity there. Mix-ins which sometimes comes with the shared test stuff. Before and after blocks can sometimes get very, very complicated. This thing goes for these seven tests and this one goes for these two tests and how do they all work together. And then this is what I wanted to talk about the rest of the time is fixtures. So if you have those integration tests you have to set up all these objects in your database. How do you go about doing that in the same manner that stays local? The three ways I've normally seen are yaml files is just the raw fixtures. That's pretty common for rails. You also see something like factory bot or factory girl, change name there. And then machinist, you know, blueprint style things. But the problem with all of those is none of those are local. Those are not in your test files. Those are in a different file in a different place in your application and oftentimes those are shared across many different tests. So you got that whole kind of shared state thing going on and it's really hard just to reason about your tests and how they work together. So for the next little example this is the object diagram we're working with. There's a patient and a client those work together for an appointment. We work for veterinary technology so this comes from our system and the patient ends up species. It's a dog, it's a cat, it's a parrot, whatever. So one of your options if you're not gonna use fixtures is to use raw active record and you end up with code that ends up looking like this. And this is actually better in my opinion than fixtures. You actually just create your objects in line. You know, they're there, I'm creating the species, I'm creating the patient, I'm creating the client. Put those together and make an appointment and do it again for a second thing. Run the code, do what I want it to. That's great. The problem you get with that, well actually in my opinion this is actually really good. It's there, it's a little bit verbose but everything you need is right there. You can debug your tests, you know what's going on. Back to the presentation. It's local, yay. It's really annoying to write that code. There's a lot of boilerplate there. You're referencing your classes all over the place. It's hard to see how the data is related is the biggest issue. Which objects connect to which objects and how do they connect? So, Tad has been telling me I'm supposed to make this into a gem. So the name I'm, he's told me I should use is called Fabriel and I'm kind of excited about it. This is something we've done internally at LIDVM and I'll get it posted eventually. Not out there yet but it's an idea that I've really liked. So the code ends up looking, I'll come back to the notes there, the code ends up looking like this. So all of your active record data is hierarchical in nature. You've already got all of your association setup in your models. Your data knows how to connect to your data. Your data knows what those relationships are and the native data structures in Ruby already point that out very, very, very well. So you can see here, I wanna create two clients. The client, there's a species that wraps a patient and the client and the patient together make an appointment. You do that again with a second one and then that all gets processed at big nested hash of literals. Get processed and get dumped into your database and then you can run it just like the same thing. The key is that, is that the exact same code as what you had for the previously, the active record stuff. And there's really not much to the gem. All it ends up doing is it looks at that hierarchy and looks at your active record associations. It says, is this key here the name of association? If yes, create that nested object, otherwise it's a field on the object. There's not much to it, it's really, really good. But the whole point being is the more you can keep your data local and focused, right? Less boilerplate focusing on what do we actually need just for the test and not for another test or anything else that lets you focus on the test, let you keep it clean and when you come back to change it later, you know what you're doing. So that's it. All right, let's see if I can get this done in five minutes. So my name is Test After Development Thorly. I work for LIDVM. I go by Phaedrix Online. I'm a developer, so I've of course got a bunch of opinions. As you can see, last on the list, my most recent opinion is that I really like GraphQL a lot more than REST, and which works out nice because currently at work, I'm replacing our REST API with a GraphQL API. So if you were to look at our code base, I think we've got roughly 70 models and that could be a lot of tedious work, right? Like I go in, I make a type for each model, I list all the fields for those models, a bunch of resolvers, and tie it all together. I'm like, oh man. Or if I think about it for a little bit, Ruby's pretty powerful. It's very good at introspection and stuff like that. Wouldn't it be cool if I could just say, what are all my classes? They're just all the things that inherit from ActiveRecord Base. And what if I could just throw them in a method that said generate the API for me? That would be super rad. I'd love that. So that's what I did instead. So just a few points of what I did as part of that. I wrote this module called GraphQL annotation that let me go into my actual models and add little notes for my GraphQL stuff because things like full address, GraphQL says you have to return a type. Full address is calculated. It doesn't know the type, so I tell it the type. And I can also, as another argument for this, I can give it like a description and things like that. And it just goes into this big hash like thing that I can pull out later. So each type is just a bunch of, is a type in a bunch of fields. And it turns out those are just your attributes in your association. So how do I get my attributes? I just say, oh, look at all my annotations, find all the ones that are attributes. I just see between attributes and associations and enums and some other things. And then I find out all the rest of them from the classes columns. I put those all together. Those are gonna be the attributes that I'm gonna generate into fields. And then I say, okay, what are all the associations? Those are also gonna become fields. And so then I just create a module that takes the class, the attributes and the associations, and it's gonna create a GraphQL type for me. Pretty straightforward, I have a class type. GraphQL name is just the same as a class name. The description is the same as whatever I've annotated it to be. I just loop through all the attributes first. The field type, this is actually a different file, but ActiveRecord only has a fixed set of all the different types that you can get. And I just map those to whatever GraphQL type I want. And so that's the type. The field name is just the attribute name and then I camelize it to make it more JavaScript-y. And the description is just whatever I annotated it with. And so I can just go through and say, that class type I created earlier has a field and the field has a field name, field type, da, da, da, da, and done, right? All the attributes that my model had, now my GraphQL type has, and I do the same kind of thing with my associations. And since the GraphQL Ruby Jam does kind of a delayed evaluation, I can just reference it and then assume that once it needs to do it, they'll all be there. So I can actually refer to a class type that I haven't created yet as the field type. And so yeah, if the association is like it has many or has it belongs to many, I need to pluralize it. I need to do it as a list instead of an individual field and then it gets a resolver for multiple and then singular. And then I just, you know, const set that in as my class type and it's with all my types. And the thing is like, if I do this, it's awesome, but I've gone through my whole code base and I've exposed everything to the world. And so my other problem is I need to have some kind of permission system. And so pull request 474. Please go like that and get the maintainer to do something about it. But it lets me do fill level permissions. Like you can see here, the reward, you can only create with title price, da-da-da-da. And so in the end, the hook is that anything now that I put in my can-can permissions immediately just becomes my GraphQL API and no steps or code in between. Hi, Chad. Hey. Woo! There's one more time. One, two, three. Woo! Oh, I didn't even know there was a mic. It's cool, man. Everybody was walking around. I'm just like, where's that coming from? Like the ceiling? No, it's a mic. Cool. I'm gonna do non-text stuff. We're gonna do some soft skill stuff really quickly. I am the campus director and director of fulfillment for the New York Code and Design Academy. And my job, beyond all the other crap that I deal with, is to teach soft skills. And I came up with a pretty cool way to do it, I think. My company, they wanted me to do everything generic like everybody else does, LinkedIn, all that crap. Anyway, I'm like, I have a better way. We'll still add that to it, but I'm gonna ask a couple of questions. First of all, who here knows about the power of vulnerability? Yeah, see? Whoa. Who here knows what neuroplasticity is? Most of us, right? So I'm gonna do one vulnerable thing that you guys can ask yourselves. You can raise your hands if you want. If you don't, it's no big deal. How many people can look in the mirror right now and say, I love you? I see we are different, right? I'm serious. Most of my students are like, I'm afraid of doing that to myself. That's crazy. Like I can't see that. So what I did, and I want you to teach this to other people because this might actually help other people, most of you, you love yourselves and you guys are all like super developers. You're highly motivated. I totally get that. This is a different arena that we're all in here. I'm gonna teach you something pretty cool though. Neuroplasticity, ready? This is easy one too. If this was a mirror, and I had a little sticky note up there that said, I love you, and you couldn't tell yourself that you love yourself in the mirror, and you leave that on your mirror every day. Within one year of building that neural pathway, or less, some of us, have brain lateralization that works a little better that way. Within one year, you can take that sticky note off, see your face, just your reflection, and your brain automatically says, I love you. That is a big tool. And if you can teach that to somebody who is depressed, and because all of us, right, we all have friends that are like, man, I wanna do what you're doing. They don't know how to get started because why, they're depressed or something's holding them down. I lost my brother, my sister, my brother, my niece, and my mom, all within a short amount of time. I didn't know what I was gonna do, I was freaking out. If it wasn't for these tools, and finding out about these types of things, I wouldn't have been able to teach this stuff to my students and being confident. It's important that we do this stuff. You guys have a lot of power because of where you're at in your lives and because you're all so dang determined to do what you're doing. This tech stuff is amazing. Most of you are so creative you don't even realize that your brain lateralization is insanely smart and you can, like I can write forwards and backwards with both hands. A lot of us can, right? Some of us can. You can practice it, it's not too hard. I can do it reverse and it's easy. Anyway, how many are artists? How many are musicians? So weird, how many do you code? So weird. We are a unique group because of that. That's brain lateralization, by the way. It's creativity and logic, right? Anyway, I'm gonna leave it alone, but that was part of my proposal to my company is that we teach these skills instead so that by the time our students graduate, they've got a tool belt beyond just the hardest skills to go out there and confidently, like, oh, that's what they do, woo! Don't do that in an interview, by the way. I was like, I go in there to an interview, and I'm like, woo! And the guy's like, no. You're no, you're not hired. I was like, I'm sorry, just practicing. Anyway. But yeah, that's kind of what I teach my students. I walk in there every day and I'm just like, how many of you pumped up, right? I've got a couple of them up here. One of them, now both of them, are extremely intelligent people and they were actually able to get with Nate Smith. Thank you, Nate. I don't know, he doesn't care. But those guys are amazing. They came out the gates running and got jobs immediately. But they already have the skills. Some of us need to teach other people how to have those skills, right? So anyway, take that with you, teach people, boom, done.