Valentino Stoll takes us on a tour of the "gems" of features built into the core Ruby language. We explore tips and tricks for using irb that can also improve your Rails console.LinksDependency on mimemagic 0.3.x no longer valid Add this `.irbrc` file and your Rails console will show a colorized banner with the environment | TwitterGitHub | pry/pryRuby JardTree-sitterGitHub | ruby/rubyGitHub | ruby/relineGitHub | tree-sitter/tree-sitterGitHub | bcicen/ctopcodenamevTwitter: Valentino Stoll ( @thecodenamev )GitHub: Valentino Stoll ( codenamev )PicksCharles- SodaStream Aqua Fizz Sparkling Water Maker BundleCharles- Soda Stream Flavor SyrupsCharles- TeachableCharles- ThriveCartJohn- Char-Broil: 6-Burner Cart Style Gas Grill, Stainless/BlackLuke- Dependency on mimemagic 0.3.x no longer valid Valentino- GitHub | reenhanced/gitreflowValentino- BitbarValentino- TwilioValentino- Twilio Powered Minecraft Server on AWSBecome a supporter of this podcast: https://www.spreaker.com/podcast/ruby-rogues--6102073/support.
Hey, everybody, and welcome to another episode of the Ruby Rogues podcast. This week on our panel, we have John Epperson. Hello, everybody. Luke Stutters. Hello. I'm Charles Maxwood from devchat.tv. Just want to shout out, go check out devinfluencers.com if you're looking to be a dev influencer. I guess that's pretty straightforward. We have a special guest this week, and that's Valentino Stoll.
Valentino, do you want to introduce yourself? Let everybody know why you're awesome and all that good stuff.
Sure. I'm a software engineer at Doximity. I've been working there for...
quite some time now i've been working on ruby quite a long time and it's kind of my go-to crutch of a language if you will but i really enjoy uh hacking away on embedded systems with ruby that's been my my latest craze and you know i i've really been digging deep into the ruby core library and kind of just exploring it and uh it's really not that scary so i'm hoping to kind of
Make it a little more approachable for people and hopefully get some more contributors out of it, including myself.
Nice. So we have you on the docket to talk about the hidden gems of Ruby's IRB. But before we dive into that, you said embedded systems with Ruby. So are you using, what is it, mRuby for that?
For some projects I have, primarily I've been working on a Raspberry Pi. I'm no expert, so... I picked up one of those starter kits that has a bajillion tiny little components to work with and slowly chipping away at converting some Python examples.
To prepare for this episode, I also bought a collection of Raspberry Pi related devices.
Oh, there you go.
So I too could code along with Valentino's Ruby guide. And as he says, the Python is infested, absolutely infested the Raspberry Pi ecosystem. There's Python everywhere. And trying to root it out, trying to root it out of your hardware, getting a kind of Ruby pitchfork and digging all of the Python out of the examples is really fantastic work. So thank you very much for doing that.
Code by code, we'll make it through.
Gross Python. Anyway, so yeah, we'll send people over to your Raspberry Pi Ruby stuff because that's just cool stuff. In fact, we should just get you back to nerd out with that on. Anyway. Sure.
But yeah, let's talk about IRB because it's a tool that we kind of all go to, whether we realize that it's the Rails console kind of runs on top of IRB or whether we just run it ourselves and then run stuff in it.
Why don't we kind of go with kind of a high-level overview of what IRB is for people who are just getting into Ruby, and then we can just assume that people know it and use it, and we can dive into, okay, stuff you didn't know about, right?
Sure. Yeah, I mean... IRB is basically just a REPL. You give it input and it'll evaluate the Ruby that you give it, analyze the syntax of it, and then directly show you the output for whatever that it is that you give it. So people work in REPLs all the time. If you open up any console, that's a REPL in a bash shell, basically. But Ruby's IRB kind of has a hierarchy to it.
that breaks all the different pieces of it into little modules that then pipe it through as it's going through and evaluating just the strings that you're giving it. And it does that in real time. And it does that basically in what they call a session and wraps that in a context and then evaluates it inside of a binding, which is really the underpinnings of Ruby code
Ruby's own core evaluation is the binding object. And then through the binding, it can basically compile Ruby on the fly into low-level code and do whatever it is that you tell it to do. You know, IRB, it's kind of like what gets you really into Ruby, right? You go and you're trying to learn a new, like try and learn any new language, even JavaScript as an example.
You'll go and what do you do is you open up the JavaScript console and you try and play around and move elements around or, you know. try and be the first to purchase a pair of sneakers or something like that. But, you know, learning Ruby is so easy. You don't do the same thing. You open up an IRB session and they just type anything that you want and you can play around with the language.
It's pretty powerful. Yep, absolutely.
So, yeah, I don't want to go too deep into, you know, what it is. And you kind of connected the dots, I guess, on how it evaluates code. But I'm always looking for kind of the neat tricks, right? Yeah. So let's start there. And then if we have time, we can come back around to internals or other things that you learned while you dove into this. Sure. So what are the neat tricks?
Like what were the things that you didn't know it did that it does?
So coming into this, definitely the customization part.
of the prompt itself so i believe it was matt swanson that i discovered the uh you know customization of the prompt for when you're in a production server that you could just signal hey this is a different server than your development console you might want to be careful what you write in here and from there it kind of just exploded into okay well what else is in this
customization and you know you open up your you find out you start you start with the irbrc as like your starting point and it kind of leads you into the rabbit hole of customization and what i realize is that you can basically make this file that will evaluate anytime you open up irb and do whatever you want with it so anytime you're trying to you know open up
specific set of code in a specific context, you can make a custom IRB file for whatever that context might be. So that was probably my biggest, you know, aha moment. And as an example, what we eventually ended up doing at Doximity was making a special Rails console that tagged the system internally
to say, hey, any changes made to the database, you know, make sure they're attributed to whoever the current user is. So we implemented that and then allowed, you know, full auditing for whatever user was logged into the system, you know, with just a simple little Rails customization. Gotcha.
So then we know, you know, John is a witch. He turned me into a newt, right? Yeah, exactly. I got better. Anyway, yeah, but yeah, you can see where that change happened, right? And you can go and you can reverse it or go slap somebody's hand or something like that, right?
Yeah, more for accountability than anything else. You say, hey, what were you doing during this change? Sometimes you just need to audit the specific scenario of a change so that you can go and make sure it didn't affect anything else as a side effect.
yeah makes sense do either of you uh luke or john use a custom i what is irbrc i didn't even know it existed is this the same thing as pry because i use pry all the time but but but i feel like a question for me i don't know he's good is irb pry no
Short answer, no. I mean, there's a kind of a discrepancy here. And it's two worlds colliding where somebody made a better IRB at one point. And now kind of the features of Pry are sneaking into the native Ruby IRB. Which is awesome. Yeah. So, I mean, they're very... They're completely different things at this point.
What about the Rails console then? It's built on top of IRB, right?
Yes. Rails console is wrapped on IRB.
Unless you install Rails Pry and then you hook into Pry.
Yeah. And Pry has a Pry RC, doesn't it? It does. Yep. So what does Rails do in order to torture or otherwise modify IRB? I haven't looked into it. You haven't looked at that. Okay.
I don't know that it's torturing it. My understanding. So, you know, obviously if I'm wrong, let us know. But my understanding is that most of what Rails is doing with its shell is just loading a bunch of Rails files. You're just loading your environment.
Right. So you're adding to the context.
Yeah. I mean, if you open an IRB shell, right, even if you open it in your Rails directory, you don't have all those files loaded. But if you open your Rails console, it's already just like if you're running a Rails server, preloaded everything and run the initializers and all that kind of stuff.
Gotcha. Yeah. So as far as like what Rails is doing, it's probably just an elaborate IRB RC thing. Because anything you have in your IRB-C will be in the context of whatever ends up being the IRB session you're in. So when you do Rails C, I imagine it just loads the application and makes a few things available to the terminal, like the reload command or something like that.
Yeah, that makes sense.
Well, the reload command is just part of Rails anyway. So yeah, I mean, that makes sense that that would be in there. Yeah, so I mean, that's a...
That's kind of the value of the IRB-C2 is like you can define methods in there that do whatever you want. So, you know, Rails has the customizations with a bunch of methods that it'll inject into the session and, you know, give you that available. So I have some myself, which will give me me. as an example.
So then I have a who am I, basically, that gives you access to your current user's name and a bunch of related ones to that.
See, now I want to create an evil IRBRC that redefines common methods off of kernel.
I mean, what you could do is you can make your own input method that then remaps all of the characters. So as you're typing, it'll output a different character. Yeah, yeah.
Sounds like my Apple butterfly keyboard.
Already implemented in hardware. That's what John is saying. It's all good. It works. My butterfly keyboard, it didn't do that. It was just P, P, P, P, P, P, P, P, P, P, P. I just tapped it once.
So, all right. So I have this really sweet. So first of all, I've actually done the auditing thing, right? We did do it through an IRBRC or whatever. We did it differently or whatever. So that totally makes sense to me. But you guys implemented that through your IRBRC?
Not technically the IRBRC. We have a custom initializer for Rails itself that will just make some modifications to the Rails console itself and then start up kind of call super on it.
Okay. So we're just talking about extensions here to our environment. All right. Yep. No worries. No worries.
So this kind of environment automation and warning is kind of really important for you because you're dealing with medical data and things. So it's kind of really important you don't get it wrong.
Yeah, that's right. And I mean, the customization of the prompt, too, is just hugely helpful, especially when you have to jump context through many servers. So we have at Doximity a series of staging servers that are separate from development, right, so that we can add quality control and test out a lot of our changes. And then we have several production servers that are all different.
And it's nice to see them labeled so you know instantly, especially if you have a bunch of different terminal windows open that all have an IRB session in it. You don't want to get confused about... which one you're in. Right.
Of course, I've worked at a lot of places that don't even give you that kind of access to the production systems to even be able to run IRB, right? I mean, you might, your ops people might be able to do it, right? And you might be able to give them specific instructions or check in a rake task or something that will do with the work and then they can run the rake task for you. But yeah.
Yeah. And I mean, we don't all have access and it's certainly limited.
But somebody's got to log in when all the systems go down. And it's Friday afternoon and everybody's trying to do some stuff. It just happens, you know?
Yeah, this is the kind of double-edged problem of your sphere is because not only does it have to be really high security, but it also has to be high availability because the code is literally saving people's lives.
All right. Yep.
All right.
So we talked about some stuff that's coming over from Fry. I actually I'm like super interested because as a very heavy user of Fry, basically, since I discovered it. Like, I don't know. I don't even remember because I don't remember my life before Pride, to be frank. What are the awesome features?
Are you hijacking this IRB talk with Pride?
I mean, okay. All right. There are times when I load up IRB, right? And it's primarily when either I'm writing like a Ruby script, right? So I don't have a Rails thing going on, right? And, you know, and I just want to load something up really fast.
Or if I'm working on a very large Rails system that takes forever to load and I just want to test out something really fast, so then I just load up IRB, require one or two files, and do a thing and then exit, right? And in both of those instances, one of the first things that I often do is I type IRB and then I go require Pry. So I have not lived without Pry for a very long time.
So what are some of the cool features that we'll get over, if you know them?
Sure. I know a couple. I mean, a lot of these are brand new, like in Rails 3. But there was just merged a pry-like ls command. So you can basically list all the methods on a particular object. as an example. I imagine the next step to that would be the cd command to pry, where you can basically move into the object.
And you can kind of already do that with IRB, because you can run IRB on any Ruby object and enter inside of the context of it. So if you make an instance of something and you IRB that instance, then you're in the context of the instance. And you could do the same with the class and pretty much any, you know, object in Ruby. How do you do that? How do you go inside the objects? Sure.
So when you're in the IRB console itself, you just run IRB and then the object. So if you did, you know, string new and you just said IRB string new, you can enter inside the instance of a string and play with all the methods. You don't have to do the string's object name as a variable and then dot whatever. You just enter the method.
So it's kind of a fun way to explore the object without having to run a bunch of chained methods.
You know how smart I'm going to look at work tomorrow.
I didn't know that. I did not know that. I didn't either.
Yeah, and I mean, another cool thing which Pry gives that maybe you just don't know about IRB is you get a lot of context from the source code just using the method method, right? So when you say, you know, method and then... colon some, the name of some method, it returns a special Ruby object that describes what the method is, what it does, the source location.
And you could pull all that information to open up a new, you know, i use vim as my command or as my editor so i i often well i'll have a special you know method in my irbrc that allows me to open a vim you know editor with whatever the source location is for the method that i'm interested in in the context of an irb session so it ends up you know being a You can open up any editor.
It can be, it doesn't have to be Vim. Yeah. Right. But no, that makes sense. That, that sounds really handy.
Yep.
So the only, the only, yeah. One of the main reasons that I like Fry is actually this, but it's not because you just use show desk source, right? Right. But it's mostly because it's complicated to remember all the steps that you have to do, right. To grab the method as an object, then call, you know, source location or whatever, right.
The other thing that's an issue here is that Pry actually does a reasonably good job now. It didn't used to, but it does a reasonably good job of showing me all the dynamic stuff that goes on when I prepend eight things, which is just going to cause problems anyway. But if I'm overriding my method a million times in weird, odd ways, things can get weird.
I don't know if anybody else has looked in, and not to plug Pry again, but there's actually a project called Ruby Jard that combines Pry with Bybug, and it's pretty incredible. You basically can do just like you can binding the IRB in your source code or pry in your source code. You can do a jarred in your source code.
And when it stops the execution, it has this really beautiful kind of split pane debugging session. where it shows you the current line in context, but also shows you some lower level definitions within that context. And it's pretty wild. I definitely recommend people check that out. I've been using that on a couple projects as well.
But IRB is still my go-to for just testing out random Ruby files.
Yeah, I'm pretty sure I saw that in a Ruby Weekly, and I just have been slow to get around to looking at it. but I like pretty things. So I'm, we'll be checking it out.
Yeah, that's really great.
All right. So some sweet, uh, any other like things that are coming over so we can wrap up that part?
Sure. Yeah. Let's see from, from pry itself. I'm not sure. I do know that IRB itself has introduced some tracing mechanisms and measure utility to make it easy to trace the execution of specific method calls while you're going through, as well as processing time.
So I actually do that for a lot of just quick performance testing of, will this array method lookup work faster than this one in this context? You know, just turn on the measuring processor and just check how fast it runs with each case.
That's the thing that comes with Ruby 3, right? Specifically?
Yeah, I believe so.
So that's really nice interface because it just does it for you after you turn it on. Yep. So you type measure and then anything you run from your IRB or whatever after that gets measured.
Yeah, and it's line-by-line measuring, too. So whatever you enter, every single thing will show you the processing time for it, which is really nice.
Is that combined with the tracing stuff? So if I turn on tracing, right, and then it's giving me my whole back trace, am I also getting... whatever we call it, benchmarking, right? For each of those lines.
Yep.
That's pretty sweet.
I'm going to go into my IRBRC and I'm going to alias that to vanity. I'll type in vanity and then it'll tell me how fast all my stuff is. What else is coming to Ruby 3? Oh, go ahead.
I was going to say, one thing that I saw that I thought was really nice in the article that kind of spawned this particular interview was that IRB is getting colors now. I don't have to hire something separate to get colors.
That's actually in 2.7. So if you're already on 2.7, you should have colors.
Nope. I'm part of the same crowd. Skipping from 2.6 to 3. Oh, there you go. Do you have anything specific for that? Go ahead. No, I believe it's turned on by default.
Okay. But one other thing I will note, at least with Ruby 3, actually it's 2.7, was the inline documentation. So if you just double tab while you're on a particular method name, it'll give you the documentation and the context, kind of like a man page. Oh, nice. And it does that through our docs.
So I don't know if anybody else here has a gem RC that doesn't include documentation when you install gems because it takes longer. I used to have that. Dash, dash, dash. Yeah. So I have turned that back on now because it's so great to see, you know, tab, tab. How does this method work? I use that all the time now.
Well, yeah, because you had to use the command line utility to get R docs before or open up some kind of wonky web interface and it just was never worth it. Right. But if it's in line when I'm working, that makes a lot more sense.
Yep. Because to be frank, the only good docs readers were all web browsers. And so whenever my internet goes out, I have to be like, oh, And then like go re-remember how to get my docs working locally again, like for the three hours that it's on.
Yeah. Or get it on the fifth try. Oh, these are the right parameters.
Yep. That's super cool.
Yeah, it's also, you know, if you use a higher level, like, documentation app, right, which has some nice things as well. Like, I use Dash as an example. But it has some drawbacks in that you have to know what you're looking up. And so it's nice having it in the direct context that you're in without having to go, okay, let me go to this other app, you know, look up this context, this method.
Yeah, I stopped using Dash because I didn't like paying for it. I felt like my web browser version was better. This is kind of what I meant, but the web browser version is weak whenever my internet goes out.
Right. I don't pay for the Dash. I just wait for it to load.
So you mentioned the banner thing that kind of started you down this road. Were there any... As in... As somebody who likes my console to look aesthetically pleasing, were there any things that you were just like, oh, yeah, now I do this all the time, customize my IRB shell, and everything is pink and green or something? I don't know. I'm sorry. I shouldn't say that.
Sure.
I like aesthetically pleasing stuff and then immediately pick those two colors in conjunction. Yeah.
I have a thing with lightning bolts. My starting prompt is a lightning bolt. It tells me I'm in IRB. That's kind of nice. I used to, for the longest time, use... There's a Oh My Zosh theme that has a cloud.
And when you have changes in your Git repository or in whatever repository you're working with, it'll show a lightning bolt to tell you that there's changes made so you know whether you're in a clean state or not. So it's just fun. That's cool. It was kind of interesting making the custom prompt because I was just, you know, playing with it, seeing what you could do.
And so I had actually picked up the quoting. So when you're in different modes in IRB, so example, like in a string and you have a string open in line that basically has a signal to IRB to style it differently. And so, you know, I wrapped it in the quotes icon So that like an emoji quotes, which was kind of interesting to use on a regular basis for a while.
I definitely will be using some emojis in my prompt for a while now. Nice. I was trying to figure out how to get an X wing on there.
It's possible. Real emoji? Probably not. I don't know. There's probably everything in the emoji space. What am I saying?
You might be able to find an emoji font that has it. You know, it's like it's a smiley emoji, except it's I don't know. There's probably a Powerline font out there with it in there. Yeah. Anyway, very cool. You mentioned, yeah, that you kind of got into this because you saw somebody else doing some stuff with it. What's the story as far as like you... learning this stuff, right?
Because I'm assuming there's a bit of a journey there. And, you know, it didn't just like, you know, upload to your brain, right? So, so what was the journey there? And how did this kind of get implemented over time at work and things like that?
Sure. I had dealt with IRB customizations for a long time. So I was familiar at least with the notion of IRB RC and being able to kind of customize small things. But I didn't know the extent at which you can do it. Like probably another topic of conversation or blog post is that the history itself of IRB and even kind of save those histories as files.
So you could, in essence, and that's kind of where I'm going to go next with some of our servers, is to customize the IRB session per user so they all have their own history, especially when you deal with a shared server setting. You run into a lot of, oh, you hit up a few times and You're scrolling through somebody else's history that's sharing the session with you.
And so that's an easy fix, scoping to a particular file. And so it started, you know, just small realizations over time of, oh, hey, you can do this, you can do this. And then finding the actual need was we have these hack days at Doximity where the whole team will split up and work on anything in particular that could help be useful for the team.
And one of the problems we had was this auditing in that our auditing had to be explicitly set anytime possible. any user logged into a IRB session or Rails console. And so sometimes it would be forgotten, the auditing would get lost, and we'd have to go back and readdress those data concerns. And so somebody was like, hey, it would be nice if we can just automatically do this.
And that basically is what started me down this rabbit hole to begin with. Is that possible? And there were some prerequisites to that in that, you know, how do you know what user in the system is related to the user that logged into the server? We happen to have some, you know, formalities in place that lined up those user names.
So it ended up working out really well and being easier than was expected. And then, so as you go through and once you have a custom Rails system, console, it makes you think, oh, well, what else can we put in here? What other, you know, Doximity-specific customizations can we inject inside the Rails console? Limitations, you know, how can we add restrictions? Things like that.
And it becomes very easy once you have that place, that source of truth to kind of make those customizations. And I work in the terminal almost exclusively. That's kind of why I... Because Vim, right? Yeah, because Vim. But more so, I have a very elaborate Tmux setup as well that I've just grown comfortable with. And so I try and do as much as possible. I don't like leaving the console at all.
I've been looking at a couple of projects to do even code reviews from the terminal. They're not quite there yet. But that would be my dream to just never leave. I used to use, what was it? There was a chat service for a while when Campfire was around that allowed you to do that from the terminal as well. Maybe it was WeChat, but that would be my ideal environment.
So, you know, playing around with IRB and being able to do as much as possible there, you know, open up any files, you know, send things to the background when I don't need to use them kind of thing. It's just a very nice workflow. So that's kind of my foray into the IRB space was, you know, what is possible? What can you do with it? And how can you make things easier to develop? Right.
Can I ask you about the Ripper? Sure.
So this is from the Hidden Gems Ruby article. The Ripper, it says, is a lexical analyzer. And you run the Ripper command on a Hello World and you get loads of stuff out. How did you get into using that? And what are you using that for? Because that, to me, looks incredibly technical and obscure. Yeah.
So mostly it's for analyzing memory usage. So with the instruction sequence compiler, you can then use it to see how Ruby is making those instructions on the low level. And it's a helpful way to debug how it's compiling those instructions.
And sometimes when you're debugging a particular memory issue, you can elaborate on that using the lexical analyzer to see how it's constructing it on the back end.
Got it. So maybe if you're calling in some external library that's memory is going missing, that kind of situation?
Yeah, something like that. It's mostly useful for really cross-compiling What do they call it? Transpiling. I haven't used it for that, but I know, what is it? Opal or Ruby Opal. There was some kind of project where they're translating the Ruby code to JavaScript as an example. So that's primarily the value of Ripper is its AST kind of generalization.
So I don't know if anyone's familiar with TreeSitter, which is what GitHub uses as their code hinting. So anytime you've been... on GitHub in a code review and you've hovered over a method name and it shows, hey, this is defined in this file. They actually use an AST called TreeSitter that they've made with Rust. It's pretty wild stuff.
It is pretty cool. It doesn't catch all the dynamically named stuff or the dynamic calls mostly. But yeah.
No, unfortunately.
I mean, that's Ruby. Rails specific mostly. All those after commit things that you're doing. One of the things that I noticed in here was the switch from read line to re-line. So does that mean that we're dropping the read line dependency? Like, I guess I tried to look that up and I couldn't find an answer real fast. I don't happen to know if you...
I don't know. Unfortunately, I haven't joined the Ruby forums themselves yet. I imagine that will come soon when I want to add a feature to IRB or something like that. So I don't know what they have plans for it at this moment from just the master branch of the repository. Or have they moved the main branch? I'm not sure. But they haven't removed it. It's still there.
So they at least have it backwards compatible. But yeah, I mean, the realign is really cool because mostly for the multi-line support. So if you paste it in, I don't know, 15, 20 lines of Ruby code, you can actually just scroll up and edit it right in place. You don't have to go and, you know, line by line edit and... hit up again. It's really nice to work with.
Does it does it increase my buffer for pasting now that you're talking about pasting in here?
I can't answer that one. I haven't played with that.
Always had a problem with that when I'm like writing long scripts or something.
Cool. So I'm kind of curious now that you've dived. It's so funny because talking through this, I'm sitting here going, man, I really kind of just took this for granted that it just worked. Right.
But yeah, now that you're... Yeah, go ahead. I was going to say... There was a few years back where I was looking at... Somebody had pasted just the lib directory of Ruby's repo. And there's a ton of Ruby files in there. And at first, it's just like delegate class or something like that. Some simple ones that I could recognize.
And then you realize, well, there's a bunch of other gems in here that are... I guess this is the core library, right? That's what's included. And that's kind of what got me to... to IRB eventually is that, you know, there are all these cool things included in Ruby. And I imagine the same with Rails, right? Where there's just way too many features for you to know all of them, right?
But if you just spend a day and poke around, you're like really surprising how much stuff is in there. And I'm kind of hoping to turn this into kind of a more longer form series on what's included in Ruby's, you know, core library. Because there is just so much information Like you were saying, you don't even know, you take it for granted that all this stuff is there.
You just open up an IRB session and do what you're trying to do in the moment and don't realize kind of what's all available to you. Yeah.
So I guess what I'm kind of aiming at next is you've done all this work to understand IRB, understand how it works, dive into the feature set.
What do you wish it had that it doesn't? That's a good question. I guess I wish it had more... native integrations. Like as an example, you know, being able to use VS code or something like that and, you know, hooking up IRB to the editor. So you can evaluate various things live from within the editor, which I know are kind of external to the Ruby source itself.
But it would be nice to have kind of some more native things, even like a mechanism that would make it easier to make more extensions to IRB. Like say, for example, this jarred project, which I know is built on something that's kind of a competitor to IRB.
But they're basically, they have a ton of modules that make it easy to do, you know, X, Y, Z. It would be nice if there were support from the, you know, Ruby core team or something like that, that could help. expose what's available and make it easier to extend and say, hey, this is how you do it kind of thing. Right.
It kind of sounds like IRB is giving you a lot of what you want already.
I know. It's hard to poke any holes. I mean, they already add extra features that I wouldn't have thought about. Yeah.
Yeah, fair. All right. Well, anything else you all want to dive into here before we do picks? All right. Well, let's go ahead and shout out about some cool stuff. John, do you want to start us off with picks?
Yeah, I will. So I just recently replaced my grill. My grill of... over a decade um it just i replaced the grates a few times anyway i've tried to keep that thing alive because i had it was one of those like double-sided one half was gas one half was charcoal and i was very happy that i got it and i got it for like 200 bucks and
And so, you know, I got it like a decade ago and I'm like, oh, sweet. I'm ready to spend two hundred dollars on a grill and like like two hundred dollars will buy you like a little dinky thing that sits on the ground and you have to crouch down and use it. So I was like, oh, so I had to reevaluate a lot.
And I went around and dug around and I was just pretty angry that everything that I wanted to buy was like six hundred bucks. But I eventually like found something that was pretty good and I've been using it for like two months now. So I've been pretty pleased with it.
I had to give up having one side charcoal and one side gas in order to get a good gas grill because apparently they just don't put those two together unless you're willing to spend, you know, a small fortune on it. But yeah, so I found like this nice gas grill that gave me like six burners and like didn't completely break the bank at 350 bucks. So I was pretty pleased with it.
I'll put a link to it or whatever. But it also wasn't a deal because like there was a different grill that I really wanted that was like the $400 price point. Only like my wife was like, well, you need to need to think over it for another night. And I was like, but I have been thinking about it for like a month now. And this, anyway, whatever the deal was gone by the next day.
So this one is stuck around for a while. So at about that price point, so that seems like this is probably its natural price point. So yeah, anyway, got a sweet grill and it works pretty swimmingly for what it is. So, and now I just have to work on convincing my wife to let me buy a separate charcoal burner so that I can do charcoal stuff when it, when I have like more time or something. So.
Right. So I like that. That's that's my pick for this week or whatever. Been able. That's been very helpful because I my wife does not like Mexican food. And the number of things that I can cook that are not on a grill are pretty much all Mexican foods because that's that's how I grew up eating. So that's what I know to make.
So, yeah, my wife very much appreciates that I can grill some stuff since we are dealing with baby things.
Nice. All right, Luke, what are your picks? Well, I've got to pick my magic, haven't I? My max magic gem is definitely my pick. What a marvelous gem it is. But only version 3.5 or lower. You know how we were talking about JavaScript features kind of coming into Ruby 3? Well, now we've got kind of NPM features coming into the gem ecosystem, the Ruby gem system.
We're really, really taking our lead from JavaScript at the moment. So I've linked to an issue on GitHub where some developers are saying that because this license changes to GPL, then everyone has to release all their source code. This really isn't true. This idea of a viral license was introduced by Microsoft in the early 2000s. And, you know, you can go on Wikipedia and look it up.
And it's kind of a smear used against the free software movement that there is this kind of nasty license that if you include it in your code, then you suddenly have to release all your source queries and your business is over. There is a license called the AGPL. which has some restrictions on software as a service systems.
But there is no strange magic license that you introduce that suddenly makes you do things. And people miss the point with free software a lot. They seem to kind of confuse it. The whole point of free software is that you have freedom. And if someone's making you release your source code when you don't want to, that's not really freedom. So people need to calm down on the GPL side of things.
GPL is a great thing. It's built the... the computing infrastructure we have today, the MIT license is not so great. And I'm not such a big fan. But if you don't believe me, look into it for yourself. So there we go. My Pick of the Week, my magic. Thank you for keeping Ruby interesting.
Yeah, and so I'm going to pile on that because I was going to pick similar. And essentially, there's an issue in the Rails repo. I think it was introduced yesterday, the issue. And so, yeah, MimeMagic used a list of MimeTypes that was GPL licensed in the gem. And so because of that, yeah, it...
The whole thread is essentially a discussion over this idea of viral licenses and how it does or doesn't ruin software, which I found to be mostly not helpful. Ultimately, there's going to be, you know, They're going to talk. Somebody's going to talk to some lawyers.
They're going to figure out what they're supposed to do and then they're going to fix it so that if you're using rails, you don't have to worry about it. But in the meantime, yeah, just be aware that this is a conversation that's going on. I'm going to see if I can find somebody who is an expert on this stuff so we can do an episode on it. right? Because I'm not an attorney.
I don't know how all this stuff works. I don't know what the implications are. But in the meantime, yeah, it's something to watch for sure. So we'll put a link to the issue in the show notes. And yeah, let everybody kind of
follow up on that but they did actually close commentary on the issue because after the first probably 20 or 30 comments yeah it just kind of devolved into people arguing over what it meant as far as this is good or this is not good and ultimately i think what we need to just see is What are the implications for the Rails community at large?
And, you know, how do we continue to be able to write software the way we write software? Because a lot of these conversations about kind of the social structure of software and the legal structure of software are things that we don't really want to think about. We just want to think about writing code and enjoying technology.
So anyway, yeah, we'll get somebody on who can tell us what we have to care about. Yeah. Yeah, so that's one pick. I was looking back through my Amazon history for some ideas on other things I could pick. One thing that I've really been enjoying lately, I have a soda stream, which is a carbonator. You can make your own soda. They also sell mixes.
And then I just order drink mixes in general off of Amazon. So they have like different fruit flavors and stuff like that. I don't drink alcohol. So it's kind of funny because I get this stuff that people add to their alcoholic drinks that just are the flavors, you know, and we just... carbonate that. So anyway, but I'm really liking it.
They have an energy drink flavor and a cola flavor and a root beer flavor and a, They don't have a cream soda flavor, but you can find one on there that is. I get the sugar flavors because I'm diabetic. So I'm going to pick that. I've really, really been liking having that. And so that's something I'm picking.
And then for the Dev Heroes Accelerator, one thing that's really been working out nicely for me lately that I've been using to get people in and then get them the content they need. I've been using Teachable and I'm really liking Teachable. It's a terrific platform for just putting the videos up and giving people what they need there.
And so I've been putting videos up on, hey, you know, during the coaching call, it's a group coaching call. Don't always have time to dive into everything that everybody needs. But afterward, I can do a video on it, right? And then everybody has it. And so I've got some videos going up there, which is awesome. Probably going to turn it into a course at some point. People can just buy one off.
And then if you want the direct coaching, teaching, you can go for it. But yeah, I'm really digging that. If you want to apply, you can go to devinfluencers.com slash apply and get that. I'm also starting a podcast for dev influencers. So if you're thinking, hey, I'm not sure how to grow my career from here.
We're going to be talking about how to grow it by building an audience, making connections through something like a podcast. In fact, specifically through a podcast. And I'm also going to be interviewing other people who have built audiences and influence in the dev space and talking to them about how they did it. And yeah, just giving you ideas about how that can be done, right?
Because some people, what happens is they... They kind of become senior devs. They realize that, hey, the job I have now looks a whole lot like the job I'm going to have in a few years. Not really what I want long term for my career. You know, I want to keep learning. I want to keep growing. You know, I want to get paid more five years down the line kind of thing. And so how do I do that?
They don't really want to go the architecture route. They don't really want to go the management route. And so where do we go? So you can go the influencer route, right? And it's a lot of fun because you get to meet people. You get to explore areas. You don't get to explore other ways. And you still get to code. And so that's kind of what we're doing there. Yeah.
Anyway, long pitch, but ultimately I'm doing Teachable and I'm really enjoying Teachable. And then for the cart to sign people up, I've used all kinds of stuff, all kinds of membership software. I hate them all. I hate the shopping cart in Teachable, by the way. It sucks. But I've been using Thrivecart for all that stuff and I really like it. It is terrific.
It has an affiliate system that actually works, which is awesome. And so if you're going to be selling stuff online, I highly recommend Thrivecart. So those are my picks. Valentino, what are your picks?
Sure. The first one I'd definitely recommend any developer out there is called Git Reflow. It's a tool I actually built a long time ago now. It helps automate your Git workflow. So it creates pull requests automatically for you. It makes sure to close out all your branches when you've merged down to your main branch.
It does a lot of things that just save a lot of time when you do over and over again. So I highly recommend check that out. Another pick I have is for an app called BitBar. If you're using the Mac OS, it's a nice little kind of menu bar generator. So you can run scripts and show icons and various things on a periodic timer, which is kind of nice.
So I use it as an example to see how many Docker containers I have up and how much CPU it's consuming because Docker is painful at that. And a... Let's see. I had one that just escaped me. Oh, yes. Twilio. Twilio is incredible. I used it not too long to... Not to shout out to Python, but I used it to... automatically orchestrate a AWS server for my kids to play Minecraft with their neighbors.
So all I had to do was send some commands to a specific Twilio number, and it would start firing off commands on AWS, which was really cool. So that was kind of impressive how seamlessly that worked. And their documentation is really well really well worded and mapped out. Nice.
So now I have to ask, my kids love playing Minecraft and they want to be able to play with their cousins, but we do not let them play on public servers on the internet because I do not trust who's going to be on public servers on the internet. So how do I set up a private server that their cousins can get on or, you know, things like that?
I just put the link in the show notes that we can add. Is that what you're talking about, Valentino?
Yep, that's the one. Awesome. Yeah, it was a little painstaking to get set up and configured it. I kind of hoped at some point to find some time to automate this so other people could just spin up their own AWS server that you can whitelist IP addresses on the fly using Twilio app. Cool. Maybe I get to it. Otherwise, you can go through the setup I went through.
to get it all configured on your own AWS account. Looks good to me. It was really fun playing with Lambda server and things like that to kind of just spin up EC2 instances on the fly. And my goal was to just drive the price down as much as possible per minute, which is where I got to a nice comfortable spot with spot instances.
So hopefully I can get back to it to make it easier for other people to kind of do the same thing. But right now it's just a series of Lambda scripts that just make it easier to spin up stuff. And how much does it cost you to actually run this? My monthly bill is maybe $3 to $5 a month. Oh, okay. I feel like, yeah, on average, it's around $3. So, I mean, they use it regularly.
It's definitely been the cheapest I've found, just not time-wise.
No, I like it because, yeah, my I mean, especially with my kids, most of my brothers and sisters live pretty close to here. But even then, you know, they're connecting from their houses. But my wife's family in particular, she has a brother in Oklahoma, a brother in Texas, a sister that lives an hour and a half away. Right. And so, yeah, it's just it's not ideal.
But yeah, they'd still like to be able to connect and, you know, go play in the same world. So.
Yeah, it's pretty great. So when I... What I ultimately did is made a way for just some environment variables as, you know, the allowed admins to whitelist IPs, which basically just become the parents, right? Right.
So then any parent that wants to be able to get their kid to join or, you know, to stop their kid from playing or anything like that, they could just text this number and say, hey, like, you know, remove this whitelisted IP for now. And then it cuts them out of the server, right? Yeah. No, that makes sense. Yeah. So it's been really helpful, you know, just to help.
I mean, it's hard because like you said, like, how do you trust any one of these servers outside of Minecraft's, you know, realms or whatever it is. And, you know, that that is great, too. But then like any of their friends have to be in the realms also. And it becomes this thing of, OK, well, who's paying for what? Right.
And then, yeah, the other question I have then is it just it keeps your EC2. So you shut down the EC2 instance, but it still saves all the data because it keeps it around.
I have all that backed up to S3. Right. That's how that works. So then, you know, when they turn it back on, all their stuff's still there.
Yep. OK, because, yeah, they like to build towers and castles and they'd be devastated if it disappeared.
So I know this is the sound of Chuck's weekend disappearing.
That's right. I have I have three things to do this weekend. Now I have four. But I'll tell you what, the three things I have to do this weekend make me the hero with my wife, which pays off, right? And then the fourth one makes me the hero with my kids. And if I get it done this weekend, I get it done a week early for spring break. Boom.
Well, I'll tell you what, Minecraft servers are not that hard to get configured and spin up. So at least there's that for you.
Yeah, my kids keep asking me to add... There are the extensions, I can't remember, mods to the server or to our setup at home, right, on the Xbox. And so that'd be nice too to be able to just, yeah.
It's all about reducing that management time, right? Like, sure, getting it set up the first time is fine. The issue is like when you're going in there for the 20th time because, you know, Minecraft is updated and your kids want this cool new mod and you're like trying to decide what dependencies are going to be an issue or not.
And you have to remember because the last time you logged in was six months ago and now you have to like read a million things and your entire Saturday is gone before you finally finish with the darn thing.
Yeah. Yeah, luckily I haven't hit that wall yet. My kids aren't as demanding with the mods.
Well, I'll tell you too, though, like giving my wife, you know, well, I'll just take away Minecraft and all she has to do is text a number to do it. Yeah, it's pretty huge. Boom.
About delegating the administration of it to someone else.
Ultimate power. Yeah. All right. Good deal. Well, I've asked you enough questions about that. Thanks for coming, Valentino. This was awesome. Yeah, absolutely. I've had a blast. Thanks for having me on. All right. If people want to find you online, I'm assuming you're like on Twitter and GitHub and stuff.
Yeah, I'm on Twitter. T-H-E, code name V, the code name V. Find me on GitHub at Codename V. I have a blog where I post about my experiments with embedded systems and Ruby. That's at least been what I've been writing about currently. And that's blog.codenamev.com. So that's where you can find me. Awesome.
And yeah, my kids' lives just got better because of Twilio-powered Minecraft. There you go.
You're welcome. All right. Honestly, let me know how that goes because I've been the only one that's used it so far. Will do.
Yeah, you're going to get an email and it's going to be like, this was so great. All right. Thanks again. And until next time, folks, Max out.