Philosophically, Rails CRUD is Java

Streamed

scratch


topics:
  number that should not have a decimal in it
  stream archive: all have summaries and celebrate bug VIPs
  ical tz bug
    more detail: https://paul.af/twitch-ical
    https://icalendar.org/validator.html?url=http://api.twitch.tv/helix/schedule/icalendar?broadcaster_id=95536715
    https://datatracker.ietf.org/doc/html/rfc5545#section-3.2.19
    https://en.wikipedia.org/wiki/Tz_database#Names_of_timezones
    https://datatracker.ietf.org/doc/html/rfc5545#section-3.6.5
  pairing with Nogweii on their PRs:
    example database.yml: https://github.com/lobsters/lobsters/pull/1302
    testing on story api: https://github.com/lobsters/lobsters/pull/1303
      for /latest when the url hasn't actually been submitted before
        1. 404
        2. 302 to /stories/new
          requires login
        3. if logged in, 302, else 404
  hat editing PR: https://github.com/lobsters/lobsters/pull/1303
    hats controller is getting unweildy
    hat request should be its own crud resource
    lean on rails conventions more
    hat editing/doffing needs to use wearable_hats
    hats should have a short_id
  investigating heap dump
    https://github.com/Shopify/ruby/issues/556

vim: abbr your typos!
  ex: https://code.aether.earth/nogweii/dotfiles/-/blob/main/etc/nvim/plugin/autofix.vim?ref_type=heads

philosphically, rails crud is java
https://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html

perf in discourse
https://mastodon.social/@danluu/111064835112616061

today's commits
6e85cb94 hats: use short_id instead of leaking id
255e8c54 only edit wearable_hats
aa5e51c9 split hat requests from hats to better use rails conventions
3a582608 smoke test / for mods
  (plus the PR merges)

post-stream:
  send nogweii _transcript.rb / srt_to_transcript plugin
  title: philosphically, rails crud is java
  I am suspsicious of not being able to self.short_id ||= in Story or Comment
    

Transcripts are generated with whisperx, so they mistranscribe basically every username and technical term. They're OK but not great, advice appreciated.

Recording



01:38Hello. Let's go ahead and get started. Got a whole bunch of code review and pairing kind of tasks planned. jangomandalorian ๐Ÿ‘‹๐Ÿผ
A couple of things to talk about. Let's put OBSY. And hopefully with the volume open, the evil chatting bug is gone. Oh, hey, Django. Nice to see you again. So let's see where we're at. Oh yeah. One of the things I was gonna mention was I've been, just cause it's fun as like a fun coding project, I always wanna have something really silly and low stakes. And so I've been over-engineering the streaming archive pages that I put up on my blog. Aside from embedding the Twitch player, I also made these archive pages that automatically get transcripts. So this summary is written by me, and I've written back all the previous ones, including calling out everybody who's caught a bug, and then also publishing. Oh, it didn't pull in the scratch file. I guess I have to fix that bug. Or I can just try and redeploy from here off screen. pulling in the scratch file that's off and up. So if I reload this, nope, not there. That's okay, I'll debug that later. And then these transcripts have a lot of fun in them where, oh, I got this video working, so there's a, I am not gonna watch myself, but I remuxed all my little videos, because they automatically record to MKB. I'm not sure if I can change that. And then, These videos will be resizable. Yoink. I'm not sure why the little icon is hiding. And, oh man, I broke a lot of stuff here. I've been triggering a lot. But then, so like Django, here's you chatting at the same time. And so a couple of days ago, a week ago on the previous stream, Nogway volunteered to do a couple of PRs. to write an endpoint for figuring out if a URL had been posted to lobsters before, and if so, giving back as JSON links to all of our URLs. So hopefully they will hop on in a minute here. I don't know where to see. Oh, there's users in chat. No, they're not in yet, but I want to review their PRs with them and talk through some of their testing concerns because as mentioned on the last stream rspec is a big complicated thing and really would like to be its own programming language in some ways so i had something worth calling out beforehand i got a a bug report that so over here there is a link to the the twitch calendar for this stream the schedule So if I make a new tab, gotta type a little faster than that though. So that I can just say, really? Thanks, Finn. I can try and just suck that in. So the iCal format is one of those, decades old formats that has been hacked on for years and been implemented by tons of people who kind of didn't like each other or didn't know of each other or were actively trying to compete each other to death and so it it really looks like its own thing in the way that only early 90s formats can and although i don't remember the exact date off the top of my head that's just the vibe i get off looking at it someone emailed me to say that their calendar wasn't correctly parsing this time and date. And I thought that was pretty weird, because this looks, if you've ever seen a time and date, like this part looks very much like a time zone from the TZ database, and then this is just like a number, like what else would you need? And I know a lot of developers, like your first, if you've ever had to deal with time zone bugs, your very first reaction is like, where's the Z at the end of this? Why are these times not in UTC? And usually the right practice for everything is store all your timestamps in UTC and everybody knows that one. But this one is correct to not store in UTC because it is the schedule for me streaming, which is based on the time zone for Chicago rather than UTC. And so there would be hassles as Chicago and the US central time zone go in and out of daylight savings time twice a year. So this is correct that it should be listed as this time zone. But what they said was that this leading slash was maybe bad syntax and their calendar program when importing the feed was not correctly pulling in this time zone and so it was like oh well i don't know what this is so i'm just gonna pretend you wrote utc and they were like yeah so i've missed your stream but i didn't really i didn't catch that it was weird that it said that you were streaming at like three in the morning four in the morning because i am also way off of us central time and i thought yeah that's that's computers and time zones and i thought this one was really interesting so i spent a minute digging into it and i had a couple of links so whenever there's a weird bug the first thing is always like well come on clipboard is always what does the rfc say so rfc is the internet standard for i should say the collection of internet standards for just about everything online. And RFC, oh, you know, I mentioned it felt very early 90s. Let's see the earliest one. 98. Yeah, that's late 90s. This must have been, a lot of times standards are in effect for years before someone is like, okay, let's actually write these down and nail it down for interoperability. So it is possible that, well, it's almost certain that This format is a little older than that. And these are kind of their RFCs. It stands for request for comments. It's kind of a cute bit of history that the standards document are labeled as if they're a proposal, but they are less a proposal and more the end result of a proposal. Although you can see them in draft status. So let's, come on, drop down. And so just looking at this, it's like, oh, okay. So it's giving the info you would need to write a parser for this format. And this is a pretty standard form. If you've ever had to write a parser, you have seen this kind of formatting. But just kind of looking at it, this stuff is like, oh, so there's a tzid equals some kind of prefix, some kind of parameter text. And let's get back to that. I'm going to bring up the streaming thing. And so I found this just random guy's site with a validator for ical files and i thought all right that's worth a shot and his validator spits out like oh yeah this tzid is wrong or missing a v time zone and i was like well that's interesting i don't know what that means and these line numbers 9 and 19 it is complaining about the tzid that was the exact thing that i got a bug report about so I looked up this thing and it tells you all the like, oh, it must do this, it must do that. And the part that popped out at me was, oh, it's split across the page here, but it says, it specifies a text value that uniquely identifies the vtimezone calendar to be used when evaluating the portion. And I was like, okay. so this tzid is referring to another section of the document and the interesting thing of looking at the the original source for this is that v time zone does not appear anywhere here so okay the the validator sounds pretty plausible like okay so you're mad about something in the tzid and you're complaining that v time zone doesn't exist well i can see with my own eyes vtimezone doesn't exist. So that's kind of plausible. And the really interesting thing was it says the precedence of a Solidus character as a prefix indicates that tzid represents a unique ID in a globally defined time zone registry when such registry is defined. There's a lot going on there. So right off the bat, Solidus is an old-timey British word for slash. So That part, that kind of popped out at me. It was like, okay, the presence of a solidus character. That's that leading slash that my email was saying. So we know we have that. And so it says, this tzid represents a unique ID in a globally defined time zone registry. So, you know, it's formal. It's a little stilted, but it's saying, look, if there's a leading slash, this part of it before the colon needs to be standardized. And it gives examples here where it doesn't have a leading slash, but that's a very familiar naming convention of like America, Chicago, America, New York. Okay. And then there's this note. This document does not define a naming convention for time zone identifiers. Yeah, I noticed that it wasn't, you know, a thousand pages long. Implementers may want to use the naming conventions defined in existing time zone specifications such as the public domain TZ database. The specification of global unique time zone identifiers is not addressed by this document and is left for future study. So this is the polite standards way of saying like, we are referring to this giant thorny problem, but we're not going to try and solve it here because we would never finish. And indeed you can never like finish time zones because time zones are defined by effectively by local governments in the region affected. And so some particular country may just decide to change their own time zone or even parts of a U S state. So smaller than the national level. they can do this effectively whenever they want and they can do this retroactively so you can never write down like one document defining all time zones which so this rfc is very reasonable as they almost all are and it refers here to the public domain tz database the tz database is an ongoing project and For my money, it ranks up there with like Unicode or Wikipedia for incredible accomplishments in human cooperation. I really love that people have come together and done this. As my understanding, it is effectively a nonprofit project that everybody is just donating their time and attention and gray hair to. And it tries to track all of the time zone changes as various governments define and change their time zones. nogweii sunsYo
And so when I saw in the iCal for the Twitch stream, I saw America slash Chicago, it jumped out at me because I recognized that that's exactly what time zones look like in the TZ database. And the TZ database at this point is baked into every operating system in every computer in the world. Like, there might be, oh, hey, Nagwe, thanks for coming by. nogweii Sweet!
I'm rambling about this other streaming thing, and then we're going to jump into your PRs probably in, I don't know, 10 minutes or so, if that works for you. So the TZ database is a giant accomplishment, and As soon as I saw it, I recognized it in both these examples and in the actual I cal stream. And I was like, well, this, this leading slash though. So what's going on with that. And if this says a unique ID in a registry and it kind of refers optionally to the TZ database. And I happen to know from. from being in computers forever that everyone uses this one database because it would be an incredible amount of work for no benefit to make a second one and so i was like well it's it's interesting that it refers to a registry what's up with this vtimezone thing so i found that section and the vtimezone provides a grouping of component properties that defines a time zone And I thought, that's strange. Why would you want to define a time zone? Okay, so we've got more of this Bacchus normal form defining a grammar for the file. It requires a TZ ID. There's some slash, there's some data, something about daylight standards time. There's a begin, there's an end, there's a structure, there's a TZ prompt. And I looked at this and I was like, this is a lot of data and a lot of structure and oh, there can be many of these TZ prompts. And at that point, my eyes glazed over and I just kind of skimmed a little and this table popped out at me of like, oh, here is an example of the kinds of things that you would put in a V time zone And this is the kind of thing that's in the TZ database, because the TZ database is not just currently what are all of the time zones in the world. It's also historic because these things change over time for places. You can't really interpret a historic date and time without having a database of every time zone that has existed, because otherwise you are applying the current rules to the past, if that makes sense. And so I looked at this and I was like, well, this is definitely not in that iCal file. And also it feels mildly like an enormous amount of work to try to include this in every iCal file. And it would be instantly out of date. I mean, US time zones don't change very frequently aside from the, you know, always running effort to get rid of daylight savings time. But why would this be painful to include in every iCal feed? And every program that speaks iCal would have to contain its own database and then send that out? That's very strange. And then there's another note that's just like, yeah, look, we're not defining a global time zone registry. implementers may find the TZ database a useful reference, which is, again, a slightly indirect way of saying, like, for the love of God, don't do this yourself. Please share in the globally available TZ database that is wonderful and available. And maybe when the first RFC was written in 98, it was an informal public domain collection, and now it is an incredibly accomplished decades old institution that keeps the world turning. And this is one of those cases, the reason we're finally getting to like why I thought this was a really interesting bug. So from reading the RFC, yes, this validator is correct that if you have a TZ ID, you are required to have a V time zone. It is explicitly what the RFC says. There is nothing uncertain or unclear about that. This has the leading slash, the solidus, so it must have a V time zone. It doesn't have a V time zone. Naughty. Incorrect. this kind of gets at the higher level goal of why rfc exists the point of the standard is interoperability it's so that everyone can speak the same language and what happened since the time that ical was first written and the rfc process not wanting to explicitly depend on one organization that could go away is Everyone in the world basically went, oh my God, nobody wants to re-implement the TZ database from scratch. pinjasaur I'm not able to hang around today, at a Frontend Masters workshop that is about to start but cool to see you going over the ical timezone issue (I sent you that email lol)
Let's all just use it. And in practice, all iCal files, rounds to all iCal files. There is no universality when you're talking about functions that are implemented by millions of programs in nogweii TZDB is run by just a few people, which is just crazy
hundreds of programming languages. But basically, universally, if you download a bunch of iCal files and look at them, you will see the leading slash and you will see the name of a time zone in the TZ database. And you will not see a V time zone because repeating the data that is already available from the operating system in the TZ database is just redundant and the only thing it's going to do is slip out of sync. And so basically, nobody follows the standard. But they follow the standard by all matching. Oh, hey, Pinjasaur. Oh, yeah. So I didn't want to call you out by name, but yes, Pinjasaur is the person who reported the ICAL time zone issue. And yeah, thank you for dropping by. I have been... kind of going over it, because as I said to you in my email, I think it's really just a wonderful example of the high-level purpose of standards is to get all these programs to interoperate. And basically, if everybody politely violates the standard in a mild way, well, that's effectively what the standard is, and that is considered, to me at least, a very, very successful standard. nogweii I don't believe a VTIMEZONE would drift out of date - part of the TZDB is to define a point in time as unchanging
So, Pinjasaur, one of the things I was left with at the end of my email to you was, wondering what program were you importing these iCal files into to see this bug because my intuition was maybe this was a piece of homebrew software, maybe this was something that was in some other way kind of immature or niche and so it didn't yet know the convention of We're going to break the literal RFC by having the solidus, but everybody knows that this time zone is in the TZ database. And if you're still here, I'm really curious what that is, but you don't have to answer. And if it's like software, you home wrote, I don't mean to put you on the spot or embarrass you. This is like a normal process of figuring out interoperability and Yeah, Nogway calls out that TZDB is run by just a few people, which is crazy. Yeah, it's like that classic art XKCD where, you know, the giant entire world is stacked up on top of like three little guys' backs. And Nogway says they don't believe that a V time zone would drift out of date. Part of the TZDB is to define a point in time as unchanging. And yeah, I probably misspoke there. I think... When I say drift out of date, I mean the scenario I was specifically thinking was a program would fetch the iCal at some point and then, you know, put it on the user's calendar. And if this is an event that is six months in the future, it's possible that a government redefines the time zone. And if the user's calendar program continues to use the V time zone data, that is in the iCal format, like they are right in a narrow technical sense, but they're probably wrong in practice because the user is going to expect that their event is going to match the current definition of the time zone. There is a narrow technical argument like, and again, it's hard to speak about any of these things universally because there are so many use cases and these things have been around for decades, but that would probably be a bug. And so, you know, it kind of comes down to, and I've only barely ever interacted with iCal myself, but it would probably be a bad idea to actually put a V time zone in here because everybody already has the time zone data. And almost the only thing you can do with that is have a needlessly bigger file size that may slip out of date. And so I think folks are just omitting the V time zone to avoid that set of errors. So I think that's really interesting. I really love that we can make all computers interoperate in all these fun ways. And sometimes this is what interoperability at scale looks like, where we do the wrong thing so that we can actually do the right thing. I get a kick out of that. So all that aside, I was going to pull up some pull requests. We got Nagwai here in the chat. It's funny, Twitch keeps popping up these pop-ups in the creator dashboard and it says like, you should turn on, what do they call it? Creator sharing? There's some kind of like, pairing mode where two streamers can appear on the same stream. nogweii Oh, yeah, that's new
They are really promoting the heck out of it as a new feature. nogweii I can talk if you want
But I don't think we're going to try and drag Nogwe on stream. The only live pair programmer we're going to get is maybe my cat will come by and I'll turn on cat cam again. He's not in the room right now though. He's off having breakfast. So Nogwe, you opened two PRs and one of them was a really nice Improvement, you can talk. I mean, Nagwa, you're talking in the chat. Do you mean like a Discord or something? I have no idea how wiring up the community thing works and getting a second person in. nogweii yeah I can jump into a voice call if you wanted
It would be neat, but if we wanted to do that, we probably should have done a tech test before we were live here. nogweii but chat works too!
So maybe let's just chat. Jump into a voice call. nogweii lol sure
think there's roughly a zero percent chance i managed to get that working by like live on stream given all the the audio fun i've already had maybe let's try it again for your next pr right i can volunteer you for more prs so all of this was great this This example, database.yaml, I was kind of embarrassed to realize I never included one. And I think this is a great bit of code to make it easier for people to get started with the code base. So I really appreciate you volunteering this one because it wasn't even the thing you put your hand up for. Literally, the only change here is if you could rename this to .sample so it doesn't step on existing database yamls, that would be great because pinjasaur my buddy pinged me back in (don't have audio enabled rn) wrote a blog post about it: https://paul.af/twitch-ical essentially was just trying to debug, found some other people mentioning it, and manually deleted the leading slash from the ical and found it worked (this is in web-based google calendar) https://twitch.uservoice.com/fo…
nogweii I can update `CONTRIBUTING.md` to mention the sample file too
You have to have a config file with this name, and so people would get endless git conflicts if we ship one. The convention seems to be to just name things .sample. I want to say we have a convention. Oh. And Nagoi says they can update contributing.md to mention the sample file too. Yeah, I wanted to talk about contributing because... We're going two directions at once. Pinchasaur is back. So you got a blog post from a buddy about the Twitch iCal thing. And other people mentioned it. And it is in web-based Google Calendar. Wow. That's kind of an incredible bug for Google Calendar to have. Wow. Oh my God. And the blog post mentions me, no way. I'm sorry. I'm going to pause a second. nogweii Google Calendar is picky? At this point I'd say Twitch has the bug lol
If you want to like hack out PR 1302, like we can merge it in five minutes, but this is kind of fun. someone named Paul. literally wrote a blog post that was prompted by me streaming lobsters development. So this is getting very meta and. They wrote up their own example of their own post about what was going on with the leading thing. Yeah. So this is the thing we exactly beat today. Pinjasaur, if your friend Paul is around, please send them a link to the transcript for this stream, because you can see me beating this down. The bulk of this post is that they made this neat little script. I'm not familiar with this Vialtown, but I did look at this yesterday or the day before when Pinjasaur reported the bug to me. they wrote a clever little script that does a search and replace to throw away the leading slash. nogweii val.town is a AWS Lambda-powered-by-Gists idea, typescript only. Neat.
So the reason I kind of rejected this idea of whether Twitch has a bug is if you don't have the leading slash, Let me phrase this differently. If you have the leading slash, the RFC says you are indicating it is in the global registry, which it doesn't define, but like in reality, everyone defines this to mean TZDB. So removing that is a way of saying like, yeah, this is just any kind of name for a time zone it could be anything but then again in practice whatever is consuming the ical feed is going to be like hey look i see america slash chicago that's obviously an entry in the tzdb let's go use that and then they also link to pingasaur also linked to can i just drag this tab over Thank you, Firefox. Someone reporting the bug on user voice, which is Twitch's feature request management. I'm trying to be nice here. Yeah. And they cite the RFC of, yeah, this thing is incorrect with the RFC because it doesn't have the V time zone. And so I'm genuinely really surprised that Google Calendar has an issue with this and I'm of two minds like it is possible for giant companies to have weird little bugs like this but then also it is possible for and more likely that the Google Calendar team has seen horrors beyond my comprehension in terms of weird iCal files and I noticed when I put up the streaming page that Twitch gave one link that they said was especially for Gcal and one that was just a general iCal feed. And I just threw in both without thinking about it. nogweii the URL is the same
I would suppose that the Gcal feed here does whatever Google Calendar expects. There's a weird thing where sometimes people see incompatibilities in programs, especially from big players like Google. Yeah, I see the URL. Yeah, I noticed that the URL says, just go look at this webcal. But if the Google Calendar takes the one correctly and not the other, I don't know what to say. It is entirely plausible that Google Calendar nogweii possibly doing user-agent sniffing on Twitch's part?
parses the domain name in the first way and says, oh, we have a site-specific bit of code we're going to do. That is a thing that happens at scale, kind of like how old versions of, even current versions of Windows recognize individual programs and will work around their memory allocation bugs. There's a famous example with, I think, SimCity in the Windows 3.1 days, where it had a use after free bug in Windows 3.1. was the first really popular graphical user interface and they wanted to make sure the games run and so there was a patch in the memory allocator that specifically recognized when simcity requested memory and when it gave it back it was just like yeah sure you gave it back but then it didn't deallocate it because it knew that simcity had this bug and that is that is a commitment to backwards compatibility and interoperability at scale so i kind of disagree with This bug report and this blog post that Twitch is doing the wrong thing, I think they're probably doing the fine standard thing. But again, this is me kind of getting out over my own skis. I have not contributed to actual calendaring software. I've just every once in a while had one of these issues come up and say, hey, there's a compatibility issue. So anyways, Pinjasaur, thank you for sharing that link. And I'm going to grab that and put that into the chat here. Or I'm sorry, not into the chat, into the Scratch. More detail. Let's put this first. This is probably the most useful link of all of the bunch in my Scratch file. OK. So Nagwe, thanks for your patience. Let's jump back to your two PRs here. So we had 1302, which, excuse me, I'm drying myself out. As soon as this file is ready to go or is renamed, I think I'm ready to merge down this PR and I'll do it live on the stream if you happen to push it now, but otherwise I can do it after. This part, the Docker compose. So this is me experimenting. If you were to search lobsters, I think, I don't remember if it's three times or four, but three or four times I have rejected having a docker file in the repo for things oh yeah somebody asked for kubernetes that was not going to happen and then i think there's a couple of issues that are also asking for it and ages ago maybe yeah 2018 sounds about right 2016 somewhere in here I merged a pull request to give an example Docker file. Because I was like, well, I don't use Docker, but if it helps people run the site, sure. And then it became a maintenance burden because it just kind of immediately fell out of sync. Rather than merge the Docker file into the repo, I put a link in the README that said, hey, this guy maintains a Docker file. That guy chose not to maintain the Docker file. And so then it didn't actually work. And I started getting bug requests that it wasn't working or feature requests of, can it be Dockerized? nogweii I'm filling out CONTRIBUTING to mention the sample
And the answer was, that sounds like a heck of a lot of work for me to learn something I don't know to maintain a feature that is no direct benefit to the site. However, however, This one, oh, Nagoya says they're filling out contributing to mention the sample. Thank you. And I had more to say about contributing. So we'll come back to that. Thank you for the reminder. So this one, I am nervously integrating this Docker compose file because I still don't know Docker. I still don't use Docker. I just run Linux directly, but I know it is only gotten more popular in the years since I removed the link to that Docker repo from our readme. And this is aimed specifically at developers and helping developers get started with making pull requests to the repo. And so that seems totally worth the risk of creating a maintenance burden. Like I can see, you know, there is no way when we upgrade to MariaDB 12, whenever that comes out, there is no way I'm going to remember this exists and we'll come back and fix it. but that's a pretty cheap bug report to get. So hopefully this will be easy. So even though having a Docker file and config even just referenced didn't work out in terms of being a little bit of a maintenance issue, I am, you know, like fingers crossed, helpful and willing to give it another shot here on this pull request, because things that help people contribute PRs to the repo are enormously valuable. nogweii could integrate docker-compose into CI, to have the db run in github actions through the one defined in docker-compose
Nagwe also mentioned the contributing.md file, and I wanted to talk a little about that because their pull requests prompted me to come back and almost totally rewrite the contributing.md a couple of days ago. We could integrate Docker Compose into CI to have the DB run in GitHub Actions through the one defined in Docker Compose. That is totally possible. And I can see how that would make the build run continuous integration on the database. The interesting thing there is, so I love things that make, that test things constantly. I've talked about how I exercise the backup restore system with local development.

40:14I don't have an immediate judgment on whether that's a great idea or not. And I'm a little... Yeah, the GitHub action. Let's go examine it. So the workflow that Nagoya is referring to is this it's called check. It's our build process and it just defines its own thing. And I can see how this is very similar to that Docker file syntax.

...46Oh, look, speaking of, I will never remember to keep that version up to date. nogweii heh CI is running an old version of mariadb
Yeah. This says 10.6 where. we are running 11-something in production. So yes, we immediately slipped out of sync. So that sells me pretty hard on the value of this, Nagwe. If you would like to submit a third PR or expand 1302 to update this check to use that Dockerfile, that seems like it would be a great way to reduce the number of things that are going to slip out of date. Yeah, let's... See, this is how Docker gets you. I'm just going to slowly become dependent on it. And then I will have to actually learn how it works and how to use it. All right. So going back to contributing.

41:47The previous version of the contributing file, which I had edited, was a little bit prickly. Maybe a little bit off putting and that was deliberate that was a choice, because in. 2018 and 2019 there were a lot of people using the code base to start their own sites. And it is wonderful and rewarding that people can pick up the code base and start their own sister sites and I am glad they do. But I am not willing to make a ton of custom functionality and do a ton of maintenance for them because maintaining lobsters is already plenty of work. And as you can guess by the open bug count, it really is plenty of work. And so the contributing doc was written to try to gently dissuade people from coming into lobsters looking for feature requests for their personal site. But that's not great for encouraging people to come and make PRs. And talking with Nogwe about their PRs and how there had to be setup steps, some of which are in the README, some of which are here and contributing, I kind of re-read it with fresh eyes. And I was like, this is just not the right vibe anymore. And I would really like to try to encourage more people. And so... I tried to like soften the language that was here about avoiding wasted effort. Like this is why we do things with, please don't just post feature requests or feature demands and talk about expectations for, well, if you change like this, here's what we're doing. With tests, we don't have giant comprehensive tests, but we're not trying to get to 100% coverage. So let's understand what the idea is so people can write the right amount of tests. And here's what is useful to me is it really, really helps to know it's a big help if you explicitly write in the comment when you think your code is done because sometimes people open pull requests and it's really unclear if i'm looking over their shoulder as they write something or if i'm judging finished work and i don't want to come in like a ton of bricks on something that is a work in progress more than you know everything in life is a work in progress so i hope this contributing md helps make things a little more encouraging

44:24So Nagwa, you've been talking about updating contributing to mention the sample. I think you probably want to update readme.md instead, because it talks about how to create the config database YAML. And I think this is the right place to mention, you know, rather than having a copy of this, it could just go ahead and say, copy config database yaml.sample to config database and change anything you need so that anybody who knows they need a database can, or anybody who knows about setting up Rails sites or can set up a database can go ahead and do so. And then otherwise, you can just say, or if you use Docker, here's how to run one immediately. I have been trying to make this bin setup script do more things so if we look at and i think this i got this idea from a book on maintainable rails applications i can't remember the exact title offhand but it attempts to do all of these steps that you have to do for yourself and one of them I literally put in and commented out boy, I always feel very, very predictable when I recap stuff. And then like I run into my old work and my old notes, I was going to say, Hey, maybe we want to just update bin setup to copy database dot sample to database YAML. And I already have a commented out thing showing. I thought it was a good idea at one point. If I say blame, oh, somebody else wrote it, but I kept it in. Where did this come from? Yeah, that's been hanging out a long while then. It's not even me. So maybe at some point that's the thing to do is just the nicest doc is no doc. It's just running code.

46:47Honestly, the most important line in here is DB schema load, because I have a strong Rails opinion that you should just load the schema rather than try to run all the migrations from scratch. I understand that a lot of projects, the standard Rails way, capital R, capital W, is you maintain your migration so that they can always create the whole database. But that seems like a lot of hassle, especially for an app that's years old. And there are lots of things you have to do about being careful to not reference model files from your migrations. Just load the schema. Don't fret. Don't give yourself a code burden. Just load the schema. Migrations are only live code for as long as it takes everyone to update their database, which is to say, for it to get deployed to production and staging and test and then to each developer's machine. And in a commercial project that can be hours, but also the slow thing there is the individual development environments and they shouldn't have anything important in them. It should always be safe to blow them away and recreate them. So don't maintain migrations. I also, I ended up putting, where was it? in our first one, which is not first lexically. So it's going to be 2012.

48:41No, wrong one. This very first one has a note I had to add that says, like, please stop trying to maintain the migrations. At some point, I am going to just move these into a subdirectory called, like, old migrations. I do think it's handy to have them live as code in the repo. I just don't think it's good to maintain them. All right. So that is a long, digressive look at pull request 1302.

49:22And I will go ahead and merge 1302 basically as fast as that rename gets done. Nagwe, you don't have to do the read me stuff. If you don't want to, I am happy to. And then the primary driver for nogweii just pushed
having Nagwe come by the stream to look at stuff was writing tests for 1303. Oh, you just pushed? Well, let's jump back. I was only just starting. Let's reload. Rename database sample. nogweii github specific
update setup okay let me look at the diff real quick what's this syntax oh did you make it into a footnote i didn't know github markdown supported footnotes

50:29nogweii look at the preview
Copying sample files, look at the preview. Hmm. espartapalma GHFM allow to separate the links from the content on the links
Why don't I see the, you can go ahead and delete this stuff too. We don't need to have a copy of the, database YAML in the readme if it's going to be on its own thing. Separate links from the content on links. Hmm. Okay.

51:10nogweii oh wow their rich diff doesn't show
Nogre, were you referring to this as the preview?

...18Yeah, the rich diff didn't show it. So I'm really unfamiliar with this syntax. And if it makes it a footnote or some other kind of side note, that's totally fine. This is a niche thing. I don't run a macOS desktop. I just had a couple of people inquire about it, and I thought it was easiest to paste this in here to help people get started because I sure don't know how to solve it.

...58nogweii oh wait it's not working on my repo either
nogweii I'll revert
And Nagwe says it's not working on their repo either. Okay. That's fine markdown is a speaking of interoperability and standards that get implemented slightly differently by thousands of different programs. markdown is a pretty incredible example of it, I am glad for stuff like the common mark project alright so i'm gonna leave that PR open I will come back and click merge in a minute.

52:30And the other PR here was a request by someone whose username I have immediately forgotten because they wanted to make an extension that showed them when blogs had been submitted to lobsters already. And so we talked about, so Nagwe put their hand up to write this code and I left him some notes on implementation and It looks like they made sense out of my slightly confused notes because I remember on stream I mentioned like, oh, we have this one function, but then, oh, we have this other function that wraps it. And it turns out that, yes, just using the wrapping function directly is the right call. So I'm glad Nagwe was able to make sense of me to do something very nice.

53:26Yeah, this is all good. This really is a nice straightforward bit of code.

...43I think.

...52I think I have pretty minor, Pretty minor feedback on this PR. This one, why? Oh, I can't. This isn't my personal browser where I'm actually logged into GitHub. So let's grab this. Let's see if I can. Yeah. nogweii switch to `.first`?
As long as Nogway is like physically present here in the stream, rather than try and bring my personal browser on or log into GitHub and leak crap, I'm just going to say it out loud that, if you could, the Ruby idiom here is to just call the method dot first. Yeah, exactly. And then the second thing is it's not clear what happens if similar stories is empty. And I would like to be explicit about that. nogweii hmm. what should we do? redirect to submission?
and probably break this out as if similar stories, any do the redirect else render the four Oh four and. easiest way to do to render 404 would be to raise active record double colon not found redirect to submission oh that would be an interesting option for behavior so this this really gets it do we think this is going to be used by a human with a bookmarklet or by an extension that they write. Because the answer to whether not found should throw 404 or redirect to the submission page really depends on that. And this one was kind of a bonus where I made up that it would be a nice feature to have. I believe over in the the issue about it, because I filed an issue just after the stream. Oh, and speaking of me repeating myself, I am a goldfish sometimes.

56:13I think... Excuse me. I'm going to mute one second so I can clear my throat. I'm going to find the OBS button so I can mute, so I can clear my throat.

...34Well, there's my use case for getting one of those fancy stream decks with the little label buttons that do custom things. Now I'm an art user. Obviously, I should just bind some obscure keyboard command to do it for me. There's some weird thing where OBS doesn't want to take hotkeys unless the window is focused. And then there is a plug-in to be able to send commands to OBS. And then we're back to the Arch packaging issue that I mentioned in the first stream on the 10th, where in addition to the Chromium extension embedding framework, CEF, that particular plugin is not well packaged on Arch right now. Well packaged? I could not make sense of the packaging to get one working. It is entirely possible that's a me thing rather than a packager thing. You know, I mentioned the TZDB folks as a kind of invisible accomplishment. Arch packaging and other ORS packaging sure is an invisible, thankless job. So anyways, because doing a 302 to story is new...

57:59doesn't work for people without accounts. I think the two options here, let's grab the scratch up. So we're talking about 1303. For slash latest, when the URL hasn't actually been, submitted before the two options are to one 404 or two 302 to stories new but this requires a login and so there is kind of a third option we could split the difference and say if logged in 302 else 404 nogweii do we want a JSON version as well?
is a little complicated but this seems like it would be a nice way to thread the needle for making an endpoint that's useful to users where it's like a live user interacting and then also useful to people do we want a json version of one as well of slash latest no because on slash latest on slash all you had it returning an array, correct? Yeah. nogweii yeah it's an array
Find similar URL is going to, you know, I'm not sure you need this map as Jason. I think it might actually, I think format Jason may automatically call it. You could try, I could try running this code without that and see if we get a. and array back as JSON. Well, we're talking about pairing on adding RSpec tests. nogweii TDD woo
So maybe it's a good time to get into that. So I'm going to bring this up here and click Grab my personal browser so I can get GitHub's handy TDD. Yeah. But we didn't do the tests first, right? So let's drop down. Let's see. All right. So I am, I don't need that. I don't need this anymore. Let's grab a terminal. Let's check out Nogway's branch. nogweii I'm a """bad""" programmer in that I rarely do tests first LUL
Oh, why are you sad? I have not been rewriting master with push app.

01:00:56What is this for?

01:01:05This is fine. This is just me being confused about some git setup. Yeah, I don't need to make a merge commit yet.

...25OK, this is the git history I wanted, where we are off on Nogway's branch. Good.

...36So we are going to go over to the story URLs controller. And it is really nice to have this as its own controller. The existing stories controller is kind of sprawling. So we require that.

01:02:02So let's go ahead and make a spec for it. And Nogwe, I want to make sure I don't step on your toes here. In our conversation, you had said you were failing to make RSpec tests and you could use some help. Is that like you good with me just like coding on it? Or did you want me to talk more about our spec and you want to write it? nogweii go ahead and write them
Because otherwise I'll just jump into writing a couple of specs here. And you are not a bad programmer for rarely doing tests first. Okay. Go ahead and write them. All right. So offhand, do we have any specs that already hit JSON endpoints? Because one of my strategies with, yeah, we have check URL do. Okay. espartapalma pair programming on TDD is the best!
One of my strategies with RSpec is, because it's such a dense language, is I usually start by just copying something. So we'll say spec requests, story, URLs. nogweii I tried my hand but was causing weird exceptions of Rails trying to hit .example domains
Paraprogramming on TDD is the best. Yeah, I actually, I find it really rewarding. Sometimes. I think it is best when there is some kind of difference in knowledge between two pairs like one person really knows the domain or one person really knows the language so that that is this scenario and when it's two people with the same level of experience i don't think you really get anything out of it to justify pair programming so spec urls Why are we not finding it? What did I just call that? Spec, request, store URLs. CP failed? Oh.

01:04:02There we go. Can't find the file because I didn't make it. All right. So I was going to... In case anyone's wondering where all this code came from, I just knocked off the stories thing. And this is the kind of setup that I don't like having to remember how to do in RSpec.

...38nogweii closing quote!
And we don't need a moderator. And we are going to describe the all method. We don't need to be signed in. We might come back to that. but we don't for now. espartapalma notice you have routing test, I'd also start there...
And we are just going to say it returns all submissions of the given URL. And it doesn't error if the URL hasn't been submitted. What did I do wrong with syntax here that it's mad about single quotes inside a double? nogweii url in example
espartapalma some people found them routing test redundant, but not sure about you
undefined all right we're gonna let's go ahead and drop this out url in example notice you have routing test i'd also start there i as part yeah i almost never write writing tests i don't see a lot of value to them because most routes are Pretty simple and straightforward. nogweii let story... missing closing single quote
We really only have a couple for if I have already seen a bug, sure, I'll write a routing test. But otherwise, it's not a thing I reach for. It's story missing the closing single quote. Thank you. Yes, it is. Nagoya wasn't already a VIP. nogweii double quote LUL
And then this is standards flipping out of sync. Oh, it's single versus double. Standard would change the single to double anyways. All right. Yeah, we're reaching the point where talking out loud continuously, as I do for streaming, really does just knock 10% off my IQ. So all of those silly little things become harder to see. So I'm going to write this one because it's very easy. So we're going to let's see if this is a request spec.

01:07:00One of the things with our spec is I never remember the difference between feature specs and request specs, and I have to look at it every time. Yeah. Okay. So this one is actually going to raise the error. nogweii @espartapalma personally I like really basic asserts for those, but don't get in-depth with them
The other one, I would be saying that I expect the response to have a particular status code as opposed to, no, the exception comes through. I don't love that it has that difference, but... There we go. So stories URL all, stories URL latest. That's about as much route checking as I do.

...49And we will go ahead and pass the URL with not submitted.net. nogweii extra closing bracket
Oh, and that gets us a big error. That must be a syntax error.

01:08:15nogweii also, missing `/url` in the URL
extra closing bracket yup because i took out that one all right also missing slash url oh i am yeah man let's go ahead and close that close close not useful extra slash i saw it before you could point out All right. New route matches stories URL all. Stories URL all. It wants a format. Let's go. Hold on.

01:09:19nogweii oh post
nogweii not get
Ah, it's post, not get, yup. And this one, I'm debating whether I wanna add the restriction that they request JSON. That's a thing I spend a lot of time mad at in Rails. All right, that's fine.

...48We expected an exception. And what did we get instead?

01:10:13nogweii well you're including the parameter so it won't be missing
And I copied it out of a request spec.

...21I think it has a keyword here or, oh no, no, no. It's not missing. It's colon missing, right? I can just say that.

...35Well, you say I'm including the parameter, but what I am including the parameter, but you have it raising, oh, if it's blank as opposed to 404. Oh, I see what you're saying. There are two error cases. espartapalma expect(response).to have_http_status(...)
All right. So in this case, if not given n, We got two failure cases that we treat differently. Whoa, cursor jumped. nogweii I do like MiniTest over the sheer number of DSL functions in rspec personally, hah
So if we just say we're not passing anything, I'm gonna be explicit about I'm not passing anything. I think this one's gonna say what, 400?

01:11:34yeah i do also like mini test over the sheer number of dsl functions there was a while in rails development where our spec had some limitations yeah all right so this is the one that needs the expect it's funny that the other one will wrap up the exception because find similar by url is just returning nothing anyways Close that. I think at this point, mini test is very nice, but it's been a hot second since I've used it. Great. There's also, and this is kind of a up and coming thing or an in progress thing is, another testing library called QuickDraw by Joel Draper. He runs, what is it, Ruby Rooftop Podcast. He's one of the two co-hosts. The podcast has been kind of inconsistent this year, I think because of life events for them, but he's been working on this Ruby library called QuickDraw. It is definitely too early to use, but it's really attractive. I like that he's made a very small API. This feels like a getting older thing, but more and more I've come to like really narrow APIs for anything that's related to reliability. Like in Ruby, I love that string has like 100 methods on it. It's very practical. I want it to be a Swiss army knife because the string really is the Swiss army knife of programming. It gets used everywhere, even where it shouldn't be. But in like a testing library, man, RSpec has so many moving parts. And we've seen like, even just in the five minutes I've been writing RSpec here, we've seen like four alternate names and odd behaviors. And does it catch this exception or not? And does it have a... And as... S part Palma point out that I can say like oh have http status versus response status, there is a way that i'm not remembering right off, where I can say.

01:14:11there's like a. there's another way to specify that the response status is a 404 and it has like a friendly name like missing. and I'm obviously not remembering it correctly because I swear we use it somewhere. So anyways, I've been keeping half an eye on Quickdraw, and I kind of hassled him about it when I ran into him at Madison Ruby, what, a month ago? And I say hassled, but what I mean is I said, hey, this is really neat. Can I ask you a bunch of questions about where it's going and what's your progress like? And I'm kind of encouraged by it. The other neat thing about it, aside from having... A very strict API is he's doing a bunch of work so that it is parallel by default so that we have this test suite that takes 40 seconds to run and it does all of the tests in transactions and all that kind of stuff. Well, why not run those at least in as many workers as I have CPU cores? espartapalma the `params.require(...)` always raise the exception... I think you can rescue in the ApplicationController, but it's kind of weird
It would be nice if that was out of the box, but that's the kind of thing that's super hard to retrofit. So we're going to say story one, story two. And we got to make lead bangs. nogweii require doesn't validate the content is not blank, right?
Let's at least scope them a little better. Espart says, the params require always raises the exception. I think you can rescue in the application controller, but it's kind of weird. Yeah, I'm fine with that. Require doesn't validate that the content is not blank. Nagoya, what require are you referring to? The over here? You know, if we look at the exact line from this test, We'll know if it's coming from your rays. Here, let's turn on line numbers. We'll know if it's coming from your rays or from rails. So let's just run this test.

01:16:32And it says it's raised by line five. So yeah, your rays here is redundant.

...47So I'm going to comment that back, save, run it again. And I should expect two green dots. That's very nice. So now let's go ahead and grab, well, I'll snag that.

01:17:15Oh, you know the other thing I could check? oh yeah, here it is, is be successful versus be missing or be absent. That's what that other syntax I was thinking of is. But then I bet we're not, yeah, we're not consistent about it. A bunch of them, yeah, we have a couple of places where things say equals 200.

...51So this is gonna be a false screen dot, right? espartapalma i personally preffer the `have_http_status`
Oh, no, it's because I said be successful, but all right, so I didn't change the URL.

01:18:12You prefer have HTTP status? Yeah, I see how you get there. I don't know that we use that.

...25Of course, if there are four ways to say something, we use all four. Yeah, this is one of those places where I would prefer RSpec have a smaller API. I don't think there's any kind of benefit that comes out of having four different ways to do these. And of all of them, I think I like this one the least because I kept calling it missing and it's called not underscore found. This is, and there's no, there's no benefit to knowing this alias over knowing 404. dr3ig you can use the number though, right ?
nogweii IIRC you can use the aliases in Rails as well, rather than the integer
Like the 404 is clear and unambiguous and everybody has to know that one where inventing their own language for it, like colon okay or colon not found is just, I don't know. Not so great. arh68 the numbers lend themselves to 4xx 41x type categories anyhow
So I'm specifying where I've created at because I know off the top of my head that story validations require that things be separated in time. arh68 not sure it works that way ofc lol
Drake, you can use the number though, right? Yeah, probably. Probably you can use that number there. Yeah, the numbers lend themselves to categories like be missing. There is another set of aliases for like bError or... be forbidden even though there are a couple of status codes or be redirect and this is the thing with a wide api is i i honestly just can't remember that's why i would have to be grepping our test suite and be like did we do this somewhere or i'd be pulling up our spec in zeal the docs program why did i say this looks like a real failure actually so we expected nogweii @arh68 there isn't an intentional grouping within a hundreds in the codes
to get successful but we got a 404 like this is this is into the rspec stuff but

01:20:52nogweii it's always defined as "the next number in order"
yeah there isn't an intentional grouping in the hundreds but there kind of is like that's why there is no status code above what 211 or 212 and then there's that gap up to 300 yeah so

01:21:23nogweii yeah, the 100/200/300/400/500 split is intentional. but within the 99 there is no grouping
arh68 now i'm wondering if they're ever gonna change those numbers, like in http3 or beyond
We're just going to add some basic debugging. Because I did expect this test to pass because this code looks fine to my eye.

...41nogweii @arh68 http3 is still the same numbers. no intention to change those
So we requested example one. We got an array. arh68 lol cool @Nogweii thx
And then we got a 404 status back. That's a little confused. dr3ig you need response to be_successful
espartapalma typo?
Let's put response body. This is not telling me anything useful now.

01:22:10dr3ig response.status to eq(404)
You need the response to be underscore successful. Yeah, but it was also saying that there was a 404. And this, that's a 404. So this is Rails being helpful again. Because I didn't request with the content type JSON, it is giving me a 404 at the level of formatting rather than at the level of this guy. So how do we? There is a way this happens over here.

01:23:04Oh, yeah, I can just tag the format on the end of the URL.

...17espartapalma yeah.. .json is easier
OK, so that's progress in that now we're getting an exception from the n plus one query rather than the code itself. So this means the code's actually running. This is positive. What's happening here is performance protection code is firing. We're going to say for presentation, which is the story scope that loads all the associated records. When stories are dumped to JSON, they include things like number of comments, That's going to be an N plus one query in the naive way. if we go look at two Jason as Jason. Yeah. As Jason is going to include stuff like the user dot username. So there's an N plus one query. Cool.

01:24:17He.

...24And if I can't spell successful, I can spell 200. And then we're going to say, what is it?

...41We're going to grab the JSON. call them stories, we expect stories size to equal, we expect to get back both, we expect stories.first.

01:25:06This is interesting. Let's say the short ID two. What I'm trying to express with this last assertion is that they're sorted latest first, which should be the, I don't need this debugging, that should be the output from find similar, but I want to double check it.

...42Rekpons response.

01:26:01How about a green dot? No, undefined method, short ID for an instance of hash. Of course, because this comes back as JSON. That was silly. Oh man, there's that Vim terminal not rewrapping. I wonder if that's an option. All right, so in this case, the stories are definitely not coming back in the order I expected. So let's go look at that definition of find similar by URL, because I want to be clear what the expectation is there, because as an API developer, anybody who hits this as an API is going to expect that order is stable. And so I want to test to nail down that it's stable, because I don't have any of my own front end code hitting it. So let's go over to the story model. And let's go over to find similar. Find similar says you have the URL, where is deleted, but then it doesn't have any order. Yeah, and then the similar stories method has its own Yeah. So I want to add this and just say, order is ID desk. This is the, and this also can change away from string, which I know it's just turning into exactly that string, but I'm happy to let active record. Give me the API for it. Close the old results. There we go. Look at that, a happy little green dot. And all of this looks very nice. Let's make sure that I didn't just blow up anything in the rest of the test suite, but I don't think so. This is all pretty well contained. It's just in the one test file for the one new endpoint. So Nagwe, you can see why I can certainly see why you wanted a hand with RSpec. I got the impression you're not working in Rails every day, or is it just that you're not working in RSpec every day and you use Minitest?

01:28:40espartapalma here I use a single assertion to describe the json... ``` expect(stories).to match( [ { 'short_id' => story2.short_id } ] ) ```
wmoxam I thought you're looking for it sorted by creation date?
nogweii Not using rails every day, use MiniTest wayyyy more
All right.

...47So wmoxim, yes, I am looking for it sorted by creation date. But a thing that is all over the code base is the knowledge that ID is an auto increment primary key on it, and they are allocated in increasing order. And so ID desk is the same as saying created at desk and the code base does it all over the place. So

01:29:18this is i slightly prefer the id and it is not because i am looking for an infinitesimal performance win it's because every time i see a date column and ascending or descending i have to stop and think about which way they run for some reason this has never been especially natural to me where i understand what it means when the idea is more or less And this is the same reason I have hassles with like time dot now is greater than created at it's like, am I saying before, or am I saying after? And so I always tend to lean on like created at. Dot after time now, which like, as soon as I say something like that, oh, right. Obviously I want. arh68 writing > always seems weird
So we'll go ahead and leave that there.

01:30:21Yeah. Okay. So there's store URLs controller. So I think that's a pretty reasonable set of tests for all. I don't really think there's, like, if this was super important software and I was putting a lot through it, I would maybe write another test case of, you know, because this could literally be implemented as story.all and the test would pass still, but we're not going to do that kind of ridiculous thing, so I think it's okay. I think we can just go ahead and say that that's enough. I don't need quite so many negative tests. So let's describe latest. Latest is gonna be real similar. I'm fine with just copying the data. Instead of returning it redirects, to latest submission of the given URL. And, you know, I am not going to repeat this spec. This is that testing philosophy that got nailed down in contributing a bit. Like, yeah, they have the same behavior here, but this is literally one line of code and we're kind of testing Rails itself there. agustinraven hi folks, how are you? what ide's that?
It's nice for an API, but I don't feel the need to drag it out and beat it to death, at least in lobsters. nogweii it's vim!
And then if the user ISO described. Hi, Augustin Raven. This is Vim. There is a link in the about box that has some more info. But it's Vim. I use it as basically a terminal multiplexer, and we are hacking on the Lobster's codebase. Nagwe here has written a PR, and we are hammering out a couple of bugs, hopefully not inserting too many bugs. I don't need these line numbers anymore. And adding some tests, because our spec is big and complicated. Why did I duplicate that? Because I was talking at the same time.

01:32:58Just call it to submit and it. All right. So we'll come back to those and this one, if we say latest.json, we don't expect that we expect a three Oh two. Cause it doesn't give back any thing else. And then what we're really expecting here is that. Does anybody remember this one? nogweii it's `/latest` no trailing json, no?
Is it response dot? Let's just grab that. Okay. We expect the response object to read a script under two.

01:33:50Yeah, I suppose. agustinraven im so used to see vscode that if i don't see colours i get lost haha
So in this case, because we're not rendering a template, it probably can be dot JSON or no JSON. We'll check. And we're just going to say story two dot.

01:34:21There might be a hassle here with like, are we talking about a path or are we talking about a URL? But we'll come back to that in a second. So let's go ahead and say first, let's run this spec. Yeah, VS Code is very popular, but in contrast, I am very old. espartapalma alacritty + tmux + vim... right?
Cool. So we got that green dot immediately there. That's very nice. nogweii no tmux
And alacrity tmux vim. There is no tmux in the middle. I am using vim as the terminal multiplexer. When I am SSH into my home machine, I do run tmux. But like six months ago, I basically stopped using tmux in favor of Vim's built-in terminal. I never used Vim's tabs before a couple of months ago. arh68 i'm generation intellij LUL
And I've slowly gotten the hang of them. And I've let those keystrokes replace my muscle memory for tmux. When I'm SSHed in from, oh, generation IntelliJ, very 90s. I'm generation Cubass.

01:35:41I do use Tmux when I'm SSHed in from like my laptop from a coffee shop because, you know, random coffee shop Wi-Fi drops and it's nice to have it reconnect. But I've kind of stripped away its user interface and tried to beat its keystrokes out of my head so that I just use Vim all the time. It's nice. It's nicer for pasting stuff back and forth. It's nicer for... The big thing it's nicer for is Fugitive, which I've leaned into using more. This is the Git integration. arh68 I loved those desert colors when i used gvim
I'm a big fan of that. Tim Pope for President, Tim Pope for Pope. All right, so this one, we said we were gonna check if it worked without the JSON URL. I expect it will. I don't know if I wanna spec to say that it works both ways. I'm just gonna say without, yeah. If you look in the fairly recent Git history in the last month or two, you will see me griping about how Rails handles MIME types and non-existent templates. That is a thing I have been fighting Rails for like literally a decade on. Oh, yeah, the desert colors. Do I get a copyright strike if I start humming Sandstorm by Darude? I don't know how that works. Probably not. All right. Very stylish colors. nogweii depends on if you're an excellent hummer lol
wmoxam tpope writes vimscript so the rest of us don't have to LUL
What was the other one that was like midnight? No. Yeah. There was like a dark one that everybody liked, too. Yeah, I actually have been increasingly tempted to take some of my enormous VMRC and write bits of it in Ruby because the Ruby API has been pretty stable for a while. And I want to do dumb oh, that's a great reminder. dr3ig do you intend to add pagination to the `all` endpoint ?
If anyone here works at Twitch or knows anyone who works at Twitch, I am begging for an API key. nogweii have you seen command-t ? awesome ruby plugin
Please email me at peter at pushcx because there is a bureaucratic hassle where I am running into their anti-abuse code and can't get a Twitch. I have not seen command T, the awesome Ruby plugin. I don't even have a command key on my keyboard. So let's say... Oh, I want to do the visitors ones first. nogweii @dr3ig I considered it, but figured no particular url was repeated often enough to warrant
It's easier. So this one, we're going to say that a random visitor who tries to submit a story or tries to ask for the latest of not seen Nogway. We're going to put your username in there as a little memorial. nogweii @pushcx yup .net
Actually, Nagwe, do you have a site? I can put your URL. Do you have nagwe.net or anything?

01:38:58That's great. So we expect that to say 404. I like these little memorials. I have some silly stuff in some of the test data. Like a lot of the example comments are You know people griping about tabs for spaces, because that's one that programmers can't settle after 50 odd years that's kind of funny to me that we can't. dr3ig @Nogweii SeemsGood
So let's go ahead and make that refactor like we were talking about, we were going to say if the similar stories is. Well, rather than say empty I like handling the happy case first and then.

01:39:46So I think that'll do it. nogweii @dr3ig but you are right, it's unbounded right now, which can be a problem in the future
Let's run this block to run both of these.

...57Good. And again, we're getting the exception thing. So let's go ahead and just grab, ooh, grabbed way too much code. One line here, Vim, not the whole thing.

01:40:16Not parameter missing, but active record. Record not found. And that's redundant. All right, so let's run these specs real quick. Do I intend to add pagination at the all endpoint? Oh man, if we want to talk about things that have not worked right in the lobsters for like a decade, pagination. No, so the most submitted URL has only been submitted like think 10 times i even know what that url is it's the apple has a url that they use for all of their wwdc keynotes and as kind of a tradition the user kelvin on the site does like a live blog summary of them so if we go to search search And we look for WWDC, however many stories. This is the URL that has been submitted most. Yeah. See it's by Calvin. Cause he does all of these. And so this is, that's not useful. I wanted the comments link. This is the latest one, but if you drop down to see the similar URLs, we have one, two, three. It has been submitted 13 times total, so that's 12 in the past and 13. This is a really fun tradition. Like, product announcements, commercial product announcements are kind of off topic for the site, but this one is just a tradition, you know? It's special cased in. So that is when the largest thing in the array for stories all is 13 and it grows at a rate of two a year. I think we're okay for a second. And pagination is such a complexity and is an open thing. Yeah. Oh man. so in 2020 you know i didn't start a podcast when i was locked into my house i started doing a little twitch streaming then and i did four or five streams and i remember the biggest and longest one was about trying to fix pagination on the site because and i say fix because our pagination is just doing the very naive limit offset thing like if you look at this two three and if i go deep into the thing you might have even seen that that page took a measurably larger amount of time to load and down here it's like yeah sure 299 301 and so people write naive scrapers that hit lobsters this is actually kind of funny it's a lot of people's arh68 i'm surprised it goes up that high
first time writing a scraper, they're like, Oh, what sites do I know to scrape? And then they're programmers and this is a programming site. And so then they write their very first scraper to target lobsters. And so, we see lots of bots with bad behavior where, you know, everything is in a tight while loop and there's no sleep or anything in there. And so they want to hammer the site like a hundred times a second. So I had to add some basic rate limiting and You know, some of it is bad behavior, but most of it is just very naive behavior. So at some point pagination, which I guess is my big white whale for site features, is a thing I will work on on stream, but not today. So where's that code? I'm surprised that goes up that high. We've had something like 100,000 stories submitted. I can check the exact number. arh68 I just search if it's not on pages 1-3
where's all right here let's get production terminal up on screen here i should probably make this one a different color right in the background so i'm less likely to do dumb stuff in prod oh yeah okay so we're over 100 100 000 now i'm out of date we're we're just at about 107 000 stories agustinraven you follow others ruby devs in twitch?
So what is that divided by 25, right? So we have 4,279 pages. So if I go to a lobster slash page slash 4,278, 4,277, did I slip a digit?

01:45:36Oh, these are only a year ago. arh68 deleted count as 1 ?
4260? What did I do wrong? Are there actually 30 a page and I'm looking like a goof? I could just binary search it. Yeah, see, we're only back a year. Deleted count is one. Yeah, that's true. Not many stories get deleted. I say not many, but it is actually at least a single digit percentage. 4060 puts us pretty close, 4160. Oh man, I'm manually binary searching. That's riveting stream content, but now I'm curious and I don't wanna think about writing the query properly. But yeah, these are slower to load. dr3ig what were the issues with pagination in your 2020 attempt? i kinda know you're supposed to use a cursor when implementing pagination, but i've never had to implement it myself, and don't know what are the hard parts
Anyway, there is, nogweii 12 years o_O
Every single day there is some bot that starts counting through pagination. nogweii has it really been that long?!
Drake, the issues with pagination in the 2020 attempt. Yes, I used a cursor and I think it was literally just... you know streaming knocks off that 10 IQ points and then everything was stressed to the red line in the summer of 2020 and so it just didn't quite make enough sense and I eventually blocked bounced off of it it's also kind of embarrassing to flail and in the four years since I have gotten less embarrassed by anything so so yeah Nagwe oh man big typo stream you could tell I didn't sleep well pushcx https://lobste.rs/s/slfdci/one_…
Not great, we just celebrated our dozenth birthday last month. Let me drop that in chat. So let's bring this PR home. So we got this, it raises errors, we expect that. All right, so let's go ahead and say that

01:47:57We expect that to redirect to parentheses. And then where was that other sign in? Yeah. There are like two different ways of let's make a test user and we are saying That looks legit.

01:48:34So that one raises record not found. Did I typo the name? No, this one is, oh, we didn't actually. Yeah, that was me doing TDD and deliberately seeing, not forgetting in all the conversation that I hadn't actually implemented it.

...57Is it redirect? Oh, I can't remember the... Is it new stories path? Let's just ask the routes.

01:49:14Never remember the formatting convention. New story path. All right, so we will say new story path with the URL set to URL, and this has my spidey sense tingling because we are doing a redirect based on, thanks standard, based on user data, but this is fine because we are passing it into the Rails thing that knows how to reformat and export things, so that's fine. All right, let's go ahead and run this. And if this goes green, and it doesn't, undefined method redirect, is it redirect two? Why do I never remember this API? Only worked with it for like 20 years. Yeah, it's redirect too. Had it right the first time, but then RSpec threw me.

01:50:18Cool. All right. Let's... Back in five. I'm going to run to the restroom. I'll be back in about five minutes. I am not a Twitch affiliate, and I'm certainly not for at least two more streams, so there are no commercials. Back in a second.

01:52:16OK. OK.

...26So. Let's find out if I am correctly configured to just push to this branch on the PR. No, I am not. nogweii oop
nogweii I thought I checked that
No way if you didn't stand up I think that's a setting on the pull request that i'm allowed to edit it, and I think you have to enable that.

01:53:10No it's okay Not a big deal. nogweii it's checked
However, I did just push this up. And what's the quickest way to... I never remember the git syntax for deleting remote branches.

...45Don't need that one in the lobsters repo directly. Oh, so if it's checked, why can I not commit directly to this branch? Is it a thing that it doesn't want to take it from my command line?

01:54:13All right, let's just go ahead and do the whole merge here. All right. So I was just complimenting how much I love Fugitive and I've integrated. So let's use this. Let's add this file. Let's look at this diff. So we remove the redundant bit. We got this. Oh, I didn't come back and see if this as JSON was redundant. I think it is. We'll check that in a second. And then we added this behavior that we hashed out around submitting these things or whether the user is logged in, whether to redirect or 404. And then over here, we got explicit around sorting the stories and tidied that one guy. All right, so let's go ahead and check real quick. Run the whole test file. If this doesn't want to work, oh yeah, see, we don't even have to be explicit. Sometimes I love the Rails magic like that, where it's like, yeah, I told you to render JSON. So it knew that it should call as JSON on the array. Sometimes I'm like, oh my God, how does anybody ever learn Rails anymore? Like I learned it because I grew up with it since it was small, but now, all right. So we're going to say add specs. That's good. All right. Let's go back to the master branch.

01:56:19nogweii feel free
This is a style thing, but I'm tempted to just squash this all down. I guess since we have two authors, let's not. nogweii there is Co-authored-by
Let's not. I don't mean to... There is co-authored by... Yeah, but tools don't really show that very well. Wrong tools. I don't even know what that was. nogweii github has support for it (finally after years of asking)
I have a lot of aliases. OK. So now if we hop back to the browser, boom, merged. That's beautiful. nogweii wooooo thanks
I need a double VIP badge for Twitch here to give Nagwe for writing a whole pull request. This is wonderful.

01:57:26nogweii also finished the other PR
dr3ig just expire old VIP badges instead :)
am just leaving a quick comment on my my personal browser that's why expire old vip badges well somebody has told me i am going to run into a limit of the number of vips i am allowed to have at some point i saw a table somewhere on twitch that said that as you increase in followers or subscribers the number of VIPs you can have goes up, but I don't remember if it was followers, the thing I can have, or subscribers, the thing that requires Twitch affiliate. So, I don't know. Just got to punt on that one. nogweii you are limited to 10 at first, and it goes up to... 50 I think?
When it becomes a problem, I don't know. bsandro chikaiLurks howdy pushcx and friends
I kind of think of my streaming page that's actually on my blog as more interesting, and so I would rather call people out here on a place I know I can preserve it. Oh, hey, Bessandra. And there we go. So this is the issue number 1304.

01:58:35And I am just going to say that it was completed in 1303. There we go. So now it's noted. That's really nice. So let's go back and figure out who requested that so we can tell them. Because I don't remember who it was. I remember Nagwe replied to them. Yeah, here we go. dr3ig you need VIPR badges
It was, oh yeah, there was the guy who was surprised my vimrc was older than him. It mentioned having an API. VIPR badges. That's good though.

01:59:38Oh, they mentioned extensions. That's what it was. I guess it wasn't in this stream. So let's go find the stream. Oh, I put it in the summary. Look at me. So that is DLAMs. DLAMs, are you present? pushcx @dlamz
nogweii @dlamz you there?
Can I add them even if they are not currently watching the stream? I don't know that nogweii well twitch highlighted it for me
can i don't think it pinged and i don't know that is there a yeah there is not currently a lobsters user that uses that same username so hopefully they clicked follow on the github issue i didn't think to get any contact info from them is there a GitHub user with that? Yes, but they're not super active. This does not look like an active user of the site. So I am not going to ping them from the issue because I would probably be pinging a rando. And that would be a little rude if that is not the same person. But hopefully they start using that endpoint. I guess I will have to watch the logs to see if it actually sees hits. There is a hassle with all of these kind of API endpoints that we have some of them, but then there's not a lot of discoverability for them. I don't want the read me, I want the about page. Yeah, it doesn't mention JSON. It doesn't mention API. nogweii want a OpenAPI spec? LUL
So there isn't a lot of great place to mention this. So there's kind of no documentation besides if you slog into the code base. Do I want an open API spec? Oh, that. See, I have been really, really, I drag my feet a lot about adding any API endpoint that the frontend JavaScript doesn't use. Because I am just sort of making maintenance problems for myself in that case. And I would rather not make problems. Because, like, the only thing that's going to happen is I break an endpoint that somebody wanted because, you know, I tweaked the story dot as JSON because the front end wanted something different. And then someone is surprised that their script blew up. And then they're mad at me. I think if I dug through the Git history, I've maybe even removed more JSON endpoints than I have added. I don't know. So while I was yammering on and writing RSpec, did you touch 1302, your thing again? Yes. You deleted from the readme. Oh, yeah. You are on the ball today. You should start your own programming stream. Obviously, there's no barrier to entry, and you're good at coding things live. So this, you see this.

02:03:14Beautiful.

...21So this one, if I go and turn off the sidebar. All right. So I'm going to bring my personal browser up because that's not dangerous or anything. And I'm going to wait to make sure the build goes green. Oh, God. Oh, bad Peter. I didn't... I probably got away with it, but I forgot to actually run the full build before I pushed. Let's hope I didn't just break the build on Master. It's always embarrassing. We have the little badge on the readme to shame me. Dots, dots, dots, dots, dots, dots. See, wouldn't it be nice if this happened in parallel and took, you know, two seconds instead of 14? Okay, once again, I ducked it. It is okay that I didn't remember to run that.

02:04:36Yeah, so we've got a sample, we've got this. nogweii oh, I can do that separately
And I see that you didn't make the change that you had talked about to make the GitHub check action depend on this Docker file, but that's totally fine. Oh, wait, let's look in the personal browser. So there's a GitHub thing where if you are not logged in, GitHub doesn't do the fancy live refresh thing it does if you are logged in. So that's why I have to keep reloading things in that other browser. And yeah, Nagwe, I see you saying you can do it separately. Please do. Let's just go ahead and merge this one down. That's the reason I'm bringing up the personal browser here. And this is still running, but I know it's not going to touch any specs. Let's be patient. Let's be good. Oh, it's already on to break, man. It'll be done in two seconds. Wonderful. yep complete yay green build all right this one i am going to squash down because it's one author and it's one thing so very important to always leave friendly comments to encourage people and to rewrite their commit messages

02:06:21You don't need to say to. I have a. You know, it's funny, I realized I mentioned that I was. Hold on. First things first, let's get personal browser off stream. So we reduce the likelihood that Peter does something dumb on stream. And bring up the logged out one. I mentioned that I touched contributing.md, and I just got reminded of this because I didn't call it out the first time. But as I was rewriting this, I was trying to set expectations and help people know what to do. And, oop, dumb typo. One of the things I said was, oh, try and write your commit messages in present tense. But then I just, I tried to write about all the things I look for in commit messages. And so I was just like, you know what? I can't write it in a way that doesn't make me sound deranged. So let me just, instead of writing 200 words about what I look for in a commit message, let me just admit that I'm picky about it. I'm opinionated. I'm like the kid who needs the crusts call off on peanut butter sandwiches. And it's funny because, I'm only this way on open source repos. At jobs, I kind of don't care because it's brutally hard to maintain any kind of standard around commit messages in a team over two. But lobsters, I really care that the commit messages read kind of nice, but I can't explain nice in a reasonable amount of words, so I just call myself picky. I hope that is a useful expectation to set for contributors of, you know, don't be shocked that Peter is going to rewrite your commit message. And, of course, I just immediately did it on that pull request. So, good pause point. Okay. We're only two hours, eight minutes. Great. There is one more thing, not to be Steve Jobs about it. Oh, there's two more things, but I would rather look at the pull request first, because I'm kind of in a rhythm here. The other open pull request is by Colonel 053, who is a recent new contributor to the hejihyuuga Hello chat, hello Mr. Pushcx
lobsters repo and colonel if you're here in the chat please say hi put your hand up if not you don't have to they said they weren't sure but they would try to drop by at some point and that it was okay for me to review this on stream i asked because i don't you know it's kind of fun for me to live stream code as a public performance but i don't think contributors necessarily sign up to that so i wanted to ask And so I haven't looked at this PR, but Colonel did another PR a couple of days ago for hat doffing. And so, ah, hey, Hedgy. The other PR is worth looking at for two seconds. I really like their PRs. They have a really nice use of screenshots, which makes my life so much easier. So Lobsters has these hats that users can use on comments to say that they are officially speaking on behalf of a project. hejihyuuga I keep forgetting that Thursday streams start earlier
so for example i have the sysop hat for lobsters other people will say you know here's just a random lorem ipsum kind of hat and kernel came along and very helpfully added a button for people to be able to doff their own hats yeah the thursday streams start what five hours earlier because i'm trying to be helpful to folks who are east of me I tried to make the Monday one afternoon for folks who are west of me. And then, you know, hopefully that splits the difference and somebody can make it a regular thing to come by, one or both. And the people who are antipodal to Chicago just kind of lose out because I'm not going to do a midnight stream. Sorry, India and Central Asia. So Colonel here, just a week or so ago, added this nice ui so that users can doff their own hats anything this was just a chore that i had to do in the rails production console which means that's another way of saying a thing that didn't get done in a timely fashion letting users doff their own hats is just an enormous improvement because otherwise these pile up and they become that that shame pile in my inbox where my inbox has like the red number of notifications next to it of Things that I haven't worked up the gumption to do, but I definitely feel bad about not getting to. Speaking of which, the other thing is this issue I filed earlier this year about hat doffing because a regular Lobster's user, Andy C, was renaming his project and asked me to rename his hat. And I kind of deadlocked and procrastinated on whether that should mean editing in place or taking off the old hat and putting on the new one. And it's dumb, but it's... It's one of those things where options make everything harder and having the option, I kind of deadlocked on what's the perfect thing to do rather than just picking either of them or stopping to think about and design it properly of no, it really should be two different behaviors because it's kind of two different use cases. This is why if you do anything related to conversion optimization or e-commerce everybody screams you have to with every form get rid of fields get rid of fields get rid of options because anytime someone can stop and think about a field that's a point where they may be like oh i'm not sure if i should ship this package to my house or to my office will i be around next tuesday and that's why the amazon buy now button that just skips that prints money so Aside from me procrastinating on things, Kernel has come along with their second PR related to hats. And we're just going to go ahead and give it a quick review. They got pretty much all of the style stuff for the repo right immediately on their first PR, which was wonderful. I like this old hat, new hat. That's really clear. You know, I'm going to have to bring back that personal browser because I can't leave comments or anything in the logged out one. And I don't want to log into the stream browser. So give me just one second to bring that in. There we go. It also has the side by side if I prefer, which is nice. So we have this edit, edit in place. hejihyuuga I remember reading an article a couple years ago that went to the extreme and basically argued that configurable software was a design failure, and that you should look to give users as little knobs to turn as possible
So speaking of controllers that get sprawling, the hats controller is giving it an old college try because there's this whole second step of you have to request a hat and then you get one. And all of that functionality is rolled up here in the hats controller when it should probably be broken out into a proper hats request controller. Somebody argued that configurable software was a design failure and you should look to give users as little knobs turn as possible. Yeah. I think we call that the Apple design philosophy and, and I kid a little, but Apple has gotten pretty far by being very aggressive about getting rid of options. nogweii @HejiHyuuga wow I *hard* disagree with that idea. whew, I'm actually angry at that LUL
And I think that's why they get the, we know better than you reputation, but it is some kind of a success.

02:14:51Yeah, so when they posted the screenshots, I saw that they had a message I didn't love. But I left them a comment, and they already updated that. So I don't have to say anything there. I am suspicious of this. Why does the controller have to join the messages? Yeah, so as a Linux user, I'm required to prefer configurability. hejihyuuga @Nogweii i did too when i read it. I really wish I had saved the article. I've tried to find it multiple times since I read it, to no avail.
also you know i secretly don't like configurability because whenever i have to maintain it i go crazy so i try to minimize the number of options i provide and i say that knowing that the lobster setting page has like two dozen settings and i'm even considering adding more because there was like a nice feature request for hey what if the comment folder was on the right under my thumb on my phone instead of on the left and i was like Oh man, there are so many conditionals in that template already. This is nice. I like that he didn't try to deduplicate the code. For this kind of simple CRUD operation, it's nicer to just duplicate it. As SandyMet said, duplication is cheaper than the wrong abstraction. I think that was her that said that. If not, I heard it from her. Oh, that's nice.

02:16:27So there's a happy path in Rails where you have kind of a noun obsession where where this controller for hats has the notion of a hat request and hat editing and hat doffing, Rails rewards you if you nounify things in what feels to me like a very Java OO way, where we would say, no, you don't request a hat or approve and deny a hat. Those are not your three verbs. you have a hat request object and it has the standard create, report, update, delete actions. And when you do that, Rails kind of rewards you with very small controllers and straightforward actions and simple routes. And we can see that we have slipped off the happy path with hats. hejihyuuga !faq
And if I just expand the controller a bunch, it's like, oh, oh, yeah. So we have an index, but then also we have a requests index. And then these years are all get kind of complicated. There is no track. There's just me. pushcx https://push.cx/stream#faq
I put a wait. Hang on.

02:18:10hejihyuuga thank you haha
There you go. I am the bot.

...21I put it in the link underneath the video. There's like an about box. I don't know all of the Twitch, but I just looked at Twitch for the first time on my phone yesterday and I realized you basically have zero visibility into those. All right. So we have approve request, reject request, which again, like if hat request was its own thing, This would be like update, and this would be delete, and the URLs would not have to get spelled out in the routes file. So where I'm going with all this rambling is this pull request has really brought it home to me that the hat controller is straying off the happy path. hejihyuuga Does this call for a big refactor?
because now there are two more verbs, edit in place, doffin, create new, where there could be a single edit action, or I'm sorry, a single update action. This is the update. Edit is the form, update is the action. Does this call for a big refactor? So what I'm getting to is it calls for a small refactor. But this is just a very small, well-contained pull request from a newish contributor and I don't want to put it on them I want to put it on me I would much rather that so I didn't really look at the the tests here let's look at them real quick but what I lean towards is if these tests are reasonable I'm gonna merge the PR and then I'm just gonna hack on it after I try So with Nogway, we went a couple of rounds with editing their thing for database.yaml and improving the documentation and moving things into setup because it felt very much the best version of that contribution that they offered. Forcing this person to do a bunch of refactoring just feels kind of mean. I don't want to do that. Yeah. So we expect that they have an edit button. hejihyuuga I've had maintainers for other projects accept my PRs before, then make substantial changes after the fact. I very much appreciated that when it happened
So this is the RSpec style I don't love, where all of this test data is shared between all of the specs.

02:21:21And yeah, Hedgie, you're having the experience that I want to give this submitter of, there's no way you could know this stuff that, you know, I am suspicious of Rails CRUD, or I have this opinion about RSpec syntax. And this is all really nice. Oh, that's interesting. They even made it so that they tested that the comment can be used. All right, they tested that the hack can be used. I'm not sure what came out of my mouth there. Yeah, this is great. Let's merge this down.

02:22:02And then, okay, there's no reason to maintain those as separate PRs.

...16Wait, did I already say that in this PR? nogweii is your website open source, @pushcx ? I love the structure/style of the transcript. Might just copy it if I ever get back into streaming :)
Yeah, okay. I can't spell.

...51Great. I love this button. I love getting to merge PRs from folks. This is super rewarding. So we'll merge that. And then the bugs should be closed. Yup. And there were no loose threads here. beautiful all right so let's get my personal browser back off stream let's get my local repo up to date is my website open source no it's my personal blog you're referring to i'm assuming this is jekyll which is you know a ruby static site builder and then it is moderately i never know moderately customized with a rake file for some common tasks so i wrote i don't think there's anything right i didn't put api keys directly in right not that silly hold on

02:24:17I'm seeing if I can pull something up by reviewing it off stream here real quick. Yeah, so like those stream archives, I automatically save, I have OBS configured to save the format and then like I wrote just a big Ruby script that says, okay, after each i can just run this transcribe script and it grabs the archive page it finds all the matching mkvs it extracts them to mp3s and then also it chunks them into three hour chunks because the transcription service i'm using mandates four hour chunks but i ran into some rounding issues so whatever let's just come in well under and then it pulls all these things out and spits them out and then the I wrote a plugin for Jekyll. It's got a pretty reasonable API. I don't totally know why I have to pass context as this thing instead of it just being an instance that comes in automatically for the class. As long as they're going to make me structure my plugin or make me structure my filter as a class, let me just hack it out. So another one I did was, shoot, what's it called? Yeah, like I insert those scratch files on the templates, and I wanted the links to be links. And so I got to write just literally the most obvious regular expression, and this boilerplate is not too bad. I really like Jekyll. It's working out nicely, much, much, much nicer for a full-time Ruby coder than using WordPress has been. I even made it say like, oh, if it's in development, give me a warning. Anyway, so the website is not open source, because there's, I mean, I didn't want to write it in a nice way. And a lot of this is just based on like, okay, well, I know the file naming convention, and I can enforce it. But I don't want to have to explain that to somebody, I don't have to take my it just literally names my home directory. nogweii makes sense!
So so nagwe if you happen to use jekyll i'll give you a sanitized copy of this but it's not something i want to maintain as a a public open source project yeah i have a a friend who's a twitch partner she streams video games and i showed her what i made and she was like That's the weirdest thing. Nobody hosts archives. nogweii I'd love to get a copy, if you don't mind. On your own time.
But it seems like a terrible shame to spend, I don't know, what, five, six, seven hours a week streaming stuff and then just throw it away when the VOD expires in a week. And then as now, as long as the transcription tools are really nice, Ustream.

02:27:49hejihyuuga I forget you have to be an affiliate, but there are ways to have twitch hold on to your vods indefinitely
Sure. There are ways to have Twitch hold onto your VODs indefinitely. dr3ig does transcript work with videos with music and game sounds ?
Yeah, but I would have to download my own copy anyways, because it seems like it would be a foolish choice to assume that a random for-profit company is going to hang onto my VODs indefinitely for no reward. That's not how business works, especially given the size. Does the transcript work with videos with music and game sounds? No, no, almost certainly not. I have no idea. I have never thrown game sounds or music in to AWS Transcribe. Transcribing my own VODs is literally the only time I have used AWS Transcribe and I picked it because in a private entrepreneurship Slack. Somebody mentioned it in passing a couple of weeks ago and I was like, okay. And I tried to install Whisper and I couldn't get it to install. So I was just like, all right, let me just punt this off to something that costs a couple of cents an hour. That's fine. I know a lot of OBS streamer or OBS, a lot of Twitch streamers send two audio channels up to Twitch. hejihyuuga It's so the VOD doesn't include the music, and they can avoid getting their VODs muted
and it's like one for their voice and one for music or the game sounds and i don't remember why that is off the top of my head just in the last week or so i've read the top 100 posts of the year on our twitch to try and understand the lay of the land a little better so i took in a whole lot of information just to get the vibes but i don't remember why they do that if you do Make two separate audio streams. Well, you know, there's your transcript question. Really easy. So the VOD doesn't include the music. Aha. Yes, that is it. Because apparently, I guess the rights are different for are you live streaming versus are you indefinitely streaming the video? Copyright adds a lot of technical. Speaking of technical complexity, how about those hats?

02:30:16nogweii PERFECT transition, lol
Perfect transition. mjiig I think it's less "the rights are different" and more "it's less likely to get complained about in real time"
Yeah, yeah. I'm getting good at this. All right. Resource. Hat requests. Only. Oh. hejihyuuga you were good since the first stream pushcx haha
Oh. hejihyuuga @mjiig ^^^^^^
I'm not going to... M-J-I-I-G. MJIG? Yeah, no. It is true. You are less likely to get complained about in real time. mjiig I also have no idea how mjiig is pronounced
That was part of why I reached out to... What's their name? The Pefler and Company that made this cursive font, which is Operator Sans. And I sent them an email asking, hey, do you guys care if I stream? nogweii @mjiig there are different rights for streaming vs archive, but also that's true
I know you care if I create documents or websites that use your font, but this is just me and my programming editor. And they were like, yeah, we didn't really consider streaming, but we don't care about you. And having an email from someone that says we don't really care is pretty great. I'm glad I sent that. So where else do I have a resource? It's resources, plural. So I'm going to... Let's let's write down what I'm doing. On this one. Hats controller is getting unwieldy. Cat request should be its own crud resource.

02:31:50Lean on Rails inventions. Every time I make one of those spelling mistakes that's very close to what I'm actually saying, it's just funny. I feel like I'm seeing some of my brain's wiring. So I did that merge, and I remember I had to pull down his work. Their work? I don't remember their gender. All right. So now... Let's go ahead and say resources, hat requests. I'm going to split that out first, and then I'll look at cleaning up the hats controller after. And this only needs to have all of the basic cred verbs. So let's just have all of them. Let's start there. Oh my gosh. So I try not to churn, but Let's get these things on one line. For a while, the code base enforced a line length, and a bunch of this stuff slipped in, and it's no benefit. All right. So let's switch over to hat requests controller. And now I'm going to strip out anything that is not a hat request and rename this. Hat requests controller, you have to be logged in. even the index, and then for update and delete, you have to be a moderator. That's plumbing. This is gonna get used on update and delete. and this doesn't exist for hat requests so build request gets to be just new and nice and short index this goes away because that's hats this is index down here and then create request becomes just create this all stays the same don't worry i won't forget to move the views around and then approve and reject become we'll just update is i mean approve is a little more explicit but i think i'm okay with this we'll say destroy and then doffing entirely comes out there's no concept of Editing alright, so we will go ahead and say that no you don't edit a hat request.

02:35:02Then there's no editing in place. there's no dolphin create new. there's none of that. find at.

...22We don't actually find a hat when we're requesting so that goes away to. However, that does remind me of something else I needed to do with this PR that I didn't want to ask him to do. Hat editing doffing. Needs to use. Well, it's two things. Yeah, needs to use wearable hats. and that should have a short id and i will talk about those when we get to them but i'm going to keep moving on this refactor here which that's roughly done so these custom routes all go away isn't deleting code nice don't need that anymore save all right

02:36:22Alright, so we have the hats and let's go ahead and make a at requests folder and move. Things in there. And move. Cats. Build request to have requests.

...51Alright. And then this guy will render new and if this one fails it goes back to render new. update let's just use the right path here just go and say some of this old code. This very old code was not. written in a super real Z style. And I've tried to minimize churn by not touching it, you know, let that sleeping dog lie. But as long as I'm touching it, let's look at the routes. There we go. See how fast I can go when the chat doesn't talk? Okay. hejihyuuga we'll stay silent in the future DarkMode
That's kind of funny that way. hejihyuuga /joke
Not splitting my attention. All right, so that looks basically fine. Let's see what specs blow up. We'll stay silent in the future. Yeah. Yeah, I realized as soon as it came out of my mouth that that sounded kind of awkward and dismissive. hejihyuuga (i understood what you were saying as a joke haha)
it's it's kind of funny like i know i'm taking a performance hit for streaming because things seem to take roughly double the amount of time i expect but on the other hand it's a heck of a lot more fun to to do this with a live audience and i hope i hope a lot that it takes any mystique out of the site of oh it's just a rails app oh he's just a guy oh he typos like anybody else I typo more than anybody else. I'm a master. OK, let's go ahead and move those specs around. Is it literally only the new specs because we had none? Hold on. I can inspect directory just list.

02:39:18We have a factory, some models, hat page. That is a weird name. Submitting the story. Yeah, OK. hejihyuuga I've noticed for the past year that I don't do a ton of typos. I just substitute words with completely unrelated ones. Which sucks because autocorrect won't help me with that LUL
So that one. All right. Let's just rename that.

...50kind of match thing a little more.

...57Yeah, you substitute words with the wrong words. One of the best things I did for typos was training my muscle memory so that when I feel that I've made a typo, instead of looking at it and backspacing over it, I just hit what is it I'm hitting Ctrl W, which just deletes the whole word and I try again. nogweii I have vim autofix my most common misspellings. :D
And so it's noticeably faster because I don't have to stop and reread All right, so this suite should be just fine. It should only be this new golfing and editing that causes. Yeah, vim autofix your most common misspellings. Yeah, actually, I think I have that too. nogweii abbreviations, yeah
I am, what is that called? It's called abbreviations. hejihyuuga Wait that's so smart. I've stolen so many things from this stream (take notes while you program, Ctrl-w your typos)
I don't remember the name for the Vim feature because I've added some of these for a long time. Abbreviations, yeah. I swear there are some common typos. nogweii https://code.aether.earth/nogwe…
I must have shoved them off in another Vim config because I was just off screen there grepping my own Vim config to see if I have mentions. nogweii here's my list
But you can say stuff like te becomes the. There are some of those words I struggle with. Oh there's your list that's great. yeah, this is such an awesome thing let's grab that.

02:41:44wrong clipboard still the wrong clipboard oh man come on. The i've been using X windows forever and the fact that it has multiple clipboard still trips me up.

02:42:12nogweii I unify the two clipboards because that just trips me up so much
Okay. So this becomes the new hat. hejihyuuga @Nogweii "stagitory" being the common misspelling for "statutory" was very surprising
Speaking of typos, right? That's the name of it. I know I pulled it up a minute ago. Statutory for statutory. I could see that being a typo that you get now.

...48It's not piped to hat. You cannot put the routes in your hat. So yes, that becomes new hat request path. So now the spec should be happy. nogweii @HejiHyuuga don't think I ever made that one myself, but I did just copy a bunch from Wikipedia :)
Yep. And then with hat requests split out as their own controller, that was I'm almost suspicious of how easy splitting that out was. Okay. Let's go do the inverse in the hats controller. And now let's get rid of everything related to requests. So if you are a request, if you are the moderator, we say only that for doff and doff by user. There is nothing here that needs require logged in moderator otherwise. And we only find the hat for these new actions, which I'm going to leave alone for a second. Let's clear out the rest of the request stuff so that I can take stock of what's left. So this is good. That stays. Create request. This just goes away.

02:44:25Quests index goes away, approve, reject. Okay. Edit. Is editing a hat really a different form?

...50Let's compare those. Oh, let's do, oh yeah. All right, let's go. I'm gonna edit you in a second. So let's make a, here we go.

02:45:11We have an edit hat that has our two buttons. x_coding hello
We have a dof that has... Yeah, this... Hi, X-Coding, welcome. hejihyuuga welcome in @x_Coding
We are refactoring a bunch of code for lobsters, it is very sartorial lots of hats. x_coding hey @HejiHyuuga
So. I don't think i'm going to go to the rails noun orientation extreme of.

02:46:15x_coding @pushcx understood
splitting out doffing as like a verb. pushcx https://steve-yegge.blogspot.co…
I've mentioned noun orientation a couple of times, there is an excellent excellent I will bring this over to the chat here an excellent classic blog post about. called Execution in the Kingdom of Nouns by Steve Yeagey. I want to say this is one of his first ones that he got really popular for, where he talks about how all verbs need to be attached to nouns in Java. And this is part of why, I mean, I think of this every time I work on Rails CRUD stuff, because philosophically, Rails CRUD is like this. Let's put that in. rails crud is like java oh is that a good stream title i think so i've been looking for these kind of fun quotes to use as stream titles so there we go let's get rid of the like make it a little spicy Everybody loves that, right? You just troll in your titles and then people who write link aggregation sites get annoyed about QuickBait. I'm not just making problems for myself.

02:47:47All right. So we have. I do like that these two kinds of updates are. split out into their own actions i don't think i want to unify them and having edit be the form but i am going to lean more towards the rails naming because i can't remember edit edit in place doff hat like that's just a little strange for me so edit is the original so we're going to change this to say update in place And this one to say, update by re by recreate. Oh man. Pronouns, is by the right pronoun here should be and update by recreating. It is a little less imperative. That's okay. All right. So we are going to say that there is a resource called hats. And. We do not have a destroy. We also don't have new or update. However, we do have. What is it member? I got to find another example. Do we want to just say get a post? I thought there was like a member. Yeah, so I do want member. All right. You'll say member. Update in. Member do. You can post to edit in place or you can post to update. I've Update in place, man. That's why it wouldn't auto-complete, right? Update and by recreating.

02:50:19And why is standard RB pointing out I have a syntax error? Because I missed a comma. Now let's look at the new routes. And again, let's not. Got a grip. What did I do wrong here?

...44Invalid route name already in use. Edit underscore. Oh, it's. I didn't delete the old stuff because I was like, oh, let's just add the renewed thing. So this goes away. We do have a member where you can get off. And then posted off by user, which. That's one more version of this. Here's all the all the hat stuff. Good. Now we should be happy. All right, so. You can get your hats, you can update them in place, you can doff them. I might come back. These two, I don't love doff by user as a name now that I've looked at it for a few minutes. And then these other ones are on hat. Good. All right. So I'm going to close that. This is the edit form. Good.

02:52:07Let's go back to that edit form. Edit form. We submit with these and. Let's just be explicit on both of these. That this one, the form action. There really isn't a underscore.

...35Is. Dave in lace path with the hat. hejihyuuga !lurk need to get back to work
And this one is update by recreating path. There we go. Okay. Let's go ahead and grab that spec hat.

02:53:19nogweii @HejiHyuuga bah, just overthrow capitalism :P
Why are we overthrowing capitalism on the stream? Oh, because Hedgy has to go lurk. Yeah. I mean, that's fair. Changing the whole system of the world so somebody can watch my stream.

...38nogweii @pushcx as good of a reason as any LUL
Here's editing hats.

...45Good reason to send me. Yeah. You know, I am actually... So lobsters is my fun, free time project. It's volunteer, it's non-commercial. As I have had to say several times, it's not a business and it's not for sale. On the business side, I am starting a open core project called Recheck. And rather than start a standard LLC or a standard C-Corp, I am starting a worker-owned collective nogweii you've gotten offers about lobsters? not surprising
that one is a a personal philosophy thing of it just feels right that the like money should go to the employees who actually run the company and make the money this isn't you know a a grand philosophical tradition or you know a principled economic stand it just kind of vibes Have I gotten offers about lobsters? Yeah. Yeah, it's happened a couple of times. So a really, if I can talk about the competition in a nice way.

02:55:08There is the hacker news that kind of the users know from visiting and browsing around. But the reason that Y Combinator pays Dan Gackley and pays the hosting costs and puts all of this money into running it is not solely out of the kindness of their hearts. It's called lead gen. It's deal flow for Y Combinator. This makes Y Combinator a famous name in early stage startups, which are otherwise very hard to reach. And a big part of... A venture capitalist's job, well, I say a VC, but the juniors at their firm, like their job is to go and source deal flow, to go and find interesting companies to invest in, which is especially hard at the seed stage. Hacker News is an enormous source of deal flow for Y Combinator. It is why they are so dominant in the industry is they have access to all of these early stage startups. I'm not trying to, there's no conspiracy. I believe Paul Graham has said it and it's so many words. I left a comment on lobsters on this somewhere. Somebody could dig for it if they want, but the value of that is enormous. nogweii oh yeah YCombinator has been very clear why HN is what it is
And so a couple of times when I have like been in San Francisco for social things or for work, or talking to people who are in the VC space or adjacent, people are like, oh, oh, lobsters, it's a thing that kind of looks like Y Combinator and has some fraction of its traffic. And to be clear, that fraction is like 1 100th of its traffic, if that. but it feels like a running start on your own source of deal flow. And so that's why I've gotten kind of polished at saying like, it's not a business and it's not for sale. I'm not going to try to monetize it. I'm not going to sell it to you. And I think the only one of those that was truly annoying was I got an email inquiry from someone who asked if they could buy the site. And I said, just, you know, no, they were a VC and they, said but I really want to buy the site and I said no but I would set up an instance of the site so you could run your own sister site that would have whatever stories you want on it because you want to have a lot about entrepreneurship and fundraising and other startup-y kinds of things to attract people. And he was like, oh, yeah, that seems reasonable. And I said, well, let's have a call and let's go ahead and talk about what that would look like and the size of an engagement. And then I can even moderate it for you for the first however long it takes until it grows to the point that you want to bring that in-house. I've worked with entrepreneurs a lot for my career. So that seemed like a really nice fit. Like I was going to potentially make money to work on one of my favorite things, lobsters, and they were going to get a nice site and everyone was going to be happy. And this was all super wonderful. And then on the phone, he only wanted to talk about buying lobsters, which was very frustrating and disappointing that he had fibbed about nogweii pfft, yeah sounds about right
At all being interested in setting up his own site he literally just wanted to get me on the phone, so he thought he could sweet talk me into setting up a site. And I understand that that sales hustle but boy i'm kind of allergic to the hustle culture that comes along with a lot of entrepreneurship. and my philosophy on contracts is very much the point of the contract is to force you to write things down to force you to set expectations and get explicit about things a contract cannot protect you from someone you can't trust because the pain of enforcing a contract is enormous and so that kind of scooched that whole idea of consulting to set up a site for him because if i couldn't trust him with a phone call why would i trust him with a five or six digit cost project, and so that is why you don't know of another VC with a site that looks very much like Lobster's and is maintained by me. God, what was this, 2019, 2020? No, it must have been 2019, because I remember I had the call at a friend's house. In 2020, I didn't go to friends' houses very much, so it must have been 2019. It was such a shame if he had just been upfront and honest like I was. he could have had a nice site and in a couple of years he could have built his own whole thing and had all his deal flow i haven't thought to look him up he did actually seem like otherwise a fairly reasonably pc so i sort of forgive the the sales hustle but it's not something i want to go into business with all right so we have these hats

03:00:32Let's run the spec and if this one is added in place, could not be found.

...49Okay. Let's go ahead and rename that.

03:01:01That's what it is.

...15Yeah. There's one of the things I learned in consulting is that because contracts are so painful to enforce, dr3ig how close to lobsters could you get with a discourse instance ? as in do you think you could get roughly the same functionality with some plugins ?
Don't at all think that a contract will prevent you from having a bad experience with somebody. And there are certain people that there is no contract that you can sign to bring them into line. They won't care about what's written on the form. They won't respect you or the process. All you are doing is setting yourself up to be lied to. There are certain people you just cannot do business with. And so I am sure you can imagine from news headlines some names. Please don't name them in the chat. Let's not have a political fight. But there is a steady string of people who are like, oh, the contract is what it is. Surely I will not get ripped off by this person who infamously rips off everyone they work with. I understand the kind of optimism, but I no longer share it.

03:02:41Now, why isn't this editable?

...51nogweii @dr3ig with Discourse's plugin system, it's very powerful. I'd imagine you could get something pretty similar
So boy, does this need a if moderator link wrapped around it, doesn't it? so drake asks how close to lobsters could i get with the discourse instance and do you think you'd get roughly the same functionality with plugins i don't know the discourse code base super well i have only looked in it a couple of times i have used a lot of discourses and i have seen some hair raising stuff about interacting with the code base it is not a code base i would choose to put into production If you want a real spicy take, where was that? It was on Mastodon.

03:03:41I'll throw this in the chat, but... pushcx https://mastodon.social/@danluu…
There's Dan Liu, who's a somewhat prominent tech blogger, had an unfortunate interaction with Discourse employees about performance in Discourse. Excuse me, trying to do too many things at once, and so that sentence gets tangled up. But some of the stuff they said about performance was just, not particularly sophisticated in a fairly concerning way where it assumed it assumed that really low levels of traffic were like a crushing burden and when there's somebody talking with that kind of disconnect from normal performance it was not not encouraging and also they were just kind of rude about it I understand that running a site, you're going to get a lot of weird criticisms, and having open code like they do, you get especially a lot of feedback. All right, what are we mad about here? The edit in place action could not be found.

03:05:24What line of code is it even mad about? In the hat spec line 11, which was the visit call, but I don't know, could not be found for the find hat callback. Oh, oh, I see. This is actually a great error. Come here. Rails has these before actions and after actions. And it was really easy for them to slip out of sync with the actual actions that you define in your controller. And so that exception was raised to say, hey, you refer to this action, but it doesn't exist. And it doesn't exist anymore because I renamed it.

03:06:26And it's a little irritating to get an exception when it's not the thing you're touching, but I like it. Okay, so edit in place, could not be found. Are you still talking about, oh, I didn't look at the next line. You have to be a moderator for update in place or for update by recreating. And you might think like, well, why not allow people to change their hats, especially by recreating where it's clear what happened. And the answer is, unfortunately, people could put silly or unfortunate things in there, or you could recreate the arch developer hat to say Ubuntu developer hat. And then that's really misleading. So I want to have moderators in a loop on changing those things. All right.

03:07:24What are we throwing exceptions about? We have a syntax error. Oh, I started editing and I didn't finish.

...52Go star.

03:08:00Let's see if we get a green test run out of this one. I've shoved a lot of functionality around and clearly not updated all of the references.

...17An error in the subnav, wow. How is there still expecting a then? No, you're not. Hold on. I typo'd something. If the user is moderator, you don't need a then Ruby. Don't need braces. What is it mad about?

...56It is that line of code, right? Yeah. Oh, it's the equals. You can't print the if because you just run the if. This is why I'm going to rewrite lobsters in Haskell so that everything is an expression. Because that's a reasonable response. Right? Now let's run all the hat specs. And that'll probably shake out another error or two, yeah. Another one of update in place path. Okay, so this is edit hat. This is view, edit, view, hat, edit.

03:09:52App use hats, edit line to update in place path. You don't like... let's remember what that route was named update in place underscore hat path okay let's have more words yeah

03:10:31So I kind of think of this as shotgun surgery where I'm touching so many places in the code to do this refactoring that it is a little bit like using birdshot to fix an internal organ. Dof hat by user path. What did it get renamed? Dof by user. Oh, man, the noun moved around.

03:11:16So it's moved around because of the way Rails route generation works, where if they are member routes, the noun is always at the end, where previously these were just top level get routes. Wow. Is that a green build? I think it is. And these are fairly new tests, so I don't have an enormous amount of trust built up in them. So I kind of want to click around the local dev site and see things. So let's turn on Rails server and bring up localhost. You can go ahead and close that. Boy, I got to figure out that Firefox UI scaling sometime.

03:12:16Just want to put my eyes on it. Yeah, see. We don't have enormous test card. And so this kind of thing of, oh, yeah, I blew up the hat requests page. So this is in.

...38Ah, there it is. It's in application.

...48Wow, it's actually kind of concerning that something in the site-wide footer didn't blow any tests up.

03:13:01And that's a function of... The many levels of rails testing were so many of them because the stack is so big try and cut out layers like do we actually render the whole template.

...21nogweii are you testing if the page is loaded as a logged-in user?
So this becomes half request path.

...35nogweii logged in moderator, even
Am I testing if the page is loaded as a logged in user or moderator? No, I'm not, apparently. You know, I added... nogweii ah
I remember distinctly adding these two features of can you load the site when logged in or logged out because there was some bug, just like the one that I just briefly saw and the homepage blew up. which that was kind of an embarrassing one to not have a smoke test for the homepage. So let's go ahead and say. And, you know. Looking at these. It's called reading a story, but it looks at the homepage.

03:14:53Yeah, see, and now I've got to split it out to its own. Because there's shared stuff. Let's not recreate that pattern.

03:15:26Green dot green dot. Now I go back. I put this back. Come here. Let's put that back and run this again. And I should see the spec fail.

...47And I didn't. Oh, because. It's the next part of this predicate of if there are any hat requests. So this was, I only saw this bug in dev instead of prod because my dev instance has a pile of test data, which includes some example hat requests.

03:16:12nogweii very specific circumstances, hah
So here.

...33All right, it's create hat request. I don't really care what it is. This one should be red, right? Now we should go into that branch. Yes, undefined. So there's the exact exception that I saw. So there's a couple more smoke tests. All right. That is separate enough that it's worth committing on its own. So that is a change to the layout. Why aren't you staged? Unstage. And a change to the spec for the homepage.

03:17:26That's a bad commit. I cannot commit. the layout separate from the rest of the changes. This is just a add a smoke test kind of commit.

...46And then this builds on top of it, but that's part of the refactor because the thing that bugged is the rename. So rename of the route, which is completed, good. Now there should be no failing specs and I should be able to browse around. It's kind of funny when you like don't have a lot of trust in your specs. Which I'm building trust in the lobster specs, but in some areas I have much more than others. OK. So as a logged in moderator, let's go look at slash hats. And that's fine. And if I go look at request a hat. delete action could not be found. It's not delete, it's destroy.

03:18:50And I think I'm okay with not actually having any kind of test of golfing a hat. There's Oh, two places. And this is just an ROI kind of thing. Really? You're going to 404 on me? Oh, look at that. Oh, the template must be missing.

03:19:26But it's very infrequently used. And it's for moderators only, and the stakes are very low. nogweii new.*rb*, not erb
So new HTML RB does exist, but it's throwing an exception. btd_12 since you are working on a web server i assume you know about servers, so just a question what are some uses for a home server i have one and only use it for minecraft lol
That's a weird one.

03:20:02BTD, since you're working on a web server, I assume you know about servers. Just a question, what are some uses for a home server? I have only one in use. nogweii @BTD_12 look up the self-hosting community!
Another good use for a home server is multimedia. There are nice, excuse me, my voice is getting right out. nogweii Jellyfin is amazing
There are nice tools like Plex and Jellyfin to have a home media server. So you can put movies or TV shows on it and watch it on your TV. Oh, Nagwe, that is a great answer, the self-hosting community. nogweii @pushcx your new template is missing the 'e' in the extension
Yeah, they have a big subreddit, don't they? nogweii yeah, r/selfhosted
Trying to find this. hejihyuuga https://reddit.com/r/selfhosted
The new template is missing the E in the extension. Oh my gosh, how did you spot that? btd_12 its on a laptop and its not very powerful if that matters
That's the kind of thing I lose hours to. pushcx https://old.reddit.com/r/homela…
Is it Homelab? Oh, yeah. So there's self-hosted and there's Homelab. Both of these are great. Hedgy, good answer. Yeah, you really don't have to have a powerful server to do things like home media serving. What a typo.

03:21:28How do you even see that with me tabbed away? Do I have it open in a buffer? No. Good memory there. nogweii I noticed it before you tabbed away
So instead of create hat request path, see, this is just the renames rippling out.

...51Create hat path, right? Or no, create. Just go look. I should have just pulled this into the scratch file. It is just a post to hat request. Yes.

03:22:21What do you mean? What do you mean nothing matches? It's right. Hat underscore request. And if I am doing the create, that is a post hat underscore requests plural. You know, it'll never change because it's too deeply embedded. But if I had a magic wand to go back, I would get rid of all of the plurals in Rails. It would be app model. hat request singular it would be app view hat request singular all the tables i wouldn't have a comments table i wouldn't have a hats table i would have a singular singular singular because i can never remember whether it's going to be singular or plural and it is just not the inconsistency doesn't add anything for me there's not a big benefit there so let's request nogweii @BTD_12 your laptop is still powerful. if it can run minecraft, it can run a webserver just fine
the hat of Twitch streamer at Twitch TV or CX. I swear I stream. I am a partner. nogweii minecraft is a very heavy game, despite it's graphics fidelity
I just kind of want to exercise things a little. submitted the hat request i know i'm not pulling up the hat request page here on stream because i know for a fact there's real data in there i'm pulling it up off stream as a moderator and boy which browser is this oh this is my personal one right btd_12 @nogweii if i dont preload chunks it CHUGS but wuth preload its smooth
nogweii yeah, chugging is normal LUL
starting to lose the ability to keep track of windows must be getting close to the end of the stream okay this has another exception let's go look at the hats index this one

03:24:45It's no longer called approve. Now it's just called update, right? So if we have a hat request, yeah.

03:25:09And this one's down here. We can also say update. reject, I think this one is going to have to have a form action of destroy at request path. btd_12 im thinking about buying a usb hdd enclosure and making it some kind of google drive
That's implicit. And that can just be path. We don't need to have a URL when we can just have a local path. It's not called path request. Do I even need this URL? Because it'll be update by default, right? nogweii if you're looking at file hosting / organizing, Nextcloud is great
Nope. And then this guy, instead of being reject, becomes destroy. Yeah, if you can run Minecraft, you can run a bunch. You know, I had put it in the scratch and I forgot about it, but... The title of the last stream was numbers that should not have a decimal in it or numbers that should have a decimal in it and I had one of these with my my home NAS which I use as media server for streaming to a TV. And I was trying to play a show last night and it wouldn't play it just you know sat and gave me the little spinner spinner spinner and. I did a speed test and then I spent like 20 minutes narrowing it down. And for some reason, the home NAS was throttled to 1.5 megs a second, which is not enough to stream, you know, a high quality show. nogweii Holy shit your poor NAS
And I was like, what on earth? And so, you know, I rebooted this and I rebooted that and I rebooted the router and the NAS and the TV and the, you know, rebooted my phone, just for funsies, every last thing. And I didn't know what it was. And so then I went, okay. And I was like, well, if I'm gonna have to debug the NAS, if it's something about the NAS and ethernet, I'm gonna have to touch it. And so then I went deep into the closet that it's buried in and I unplugged it. I shut it down properly, unplugged it. I hauled it all, put it on my desk, plugged it back in, plugged in the ethernet. And then I had a weird moment when it came on and I logged into its dashboard and I went, wait a minute, logging into the dashboard was pretty snappy. And so I walked back to the TV and I ran the speed test again and the speed test said, oh yeah, 150 megs a second. Yeah, just two orders magnitude larger than I had seen with the problem. No idea what it was, but something about unplugging and hauling it across the house. I swear, sometimes debugging just responds to doing the irritating thing of getting set up to properly debug something. And so it just started working again normally. And I have to... okay well let me grab the step ladder and go put it back and i really hope that it doesn't start malfunctioning again when i put it back because then i will cry i am i will take the w if it's one of those where just touching it and physically moving it is enough like i don't know maybe it started in some weird state and it didn't like the power it didn't like the ethernet cable and Hauling things around fixed it. I don't know. It was such a weird one because it was working fine a week or two ago. nogweii is this a whitebox NAS or some retail appliance?
So... Alright. So there is an exception for the mod that this path does not exist. Is it a white box NAS or some retail? It's a... What is it? nogweii ahhh synology is pretty great
It's a Synology NAS. That was a... Pretty easy buy, because it comes with a ton of stuff out of the box, and I didn't want to configure one more Linux box and have weird, squirrely stuff happening all of the time. It was just one of those where I was really happy to not have to throw a little money at the problem.

03:29:43I think that'll do it. I think I just need to say that I'm deleting the hat request. And then this one doesn't... Why are there two forms?

03:30:06So there's one form. For destroy now, I don't. So that's what the issue is here is there's. This form is doing double duty and as nice as the UI is, I almost want to break it out into two so that this becomes. its own form. And then I've got this paragraph tag.

...45But then like the end wants to be here and that's no bueno.

...56So what's the nice way to do this? Doesn't it do this over on the the new hat form? Yeah, we have an F. Whoa, don't search. We have two submits. And this one isn't loading because there is not a path named update hat request path. I think it just wants to say update. And can this just say destroy? I don't remember if I have to pass a path there or if that works. I load. Yeah, that was it. And again, I'm not showing it because I know there is some real broad data. And then in the hat request thing, people put their email address and personal links. And so it would be rude to accidentally dock somebody. All right, so if I click approve, No route matches slash update.

03:32:18It does want to be hat request path, except that doesn't exist.

...27I'm just going to add an as to these routes Destroy hat request. Because rather than keep struggling with whatever Rails' DSL wants me to do here, because it's this, but then it doesn't have a specific name for it. btd_12 also its kind of borked because im running it on wifi and not ethernet
If anybody is feeling real sharp with Rails, you can go ahead and tell me what I'm forgetting.

03:33:16Let's go ahead and. Do that. Not going to keep fighting it. I'm going to say.

...34You can post update, you can post, you can delete to delete. Does that get me a proper name on these? No, it just gets me redundant routes. btd_12 is that ok that its not on ethernet?
Yeah, let's do a symbol and we'll say this as DestroyHatRequest. Destroy is one of those words I typo all the time, so you keep seeing me slow down to typo. Why are you mad? Is it OK that it's not on Ethernet? Yeah. nogweii it's perfectly OK, it would be "better" but it's not a problem
I mean, if you don't have so much packet loss that it interferes with playing Minecraft, you're basically fine. The only the two big differences between by fine ethernet are you have more packet loss so it's a little lower quality and then you have lower. bandwidth. But again that's enough for most things.

03:34:57update hat request destroy hat, why is there a. The Department of Redundancy Department. btd_12 its around 300mbps on wifi and 500mbps on ethernet
And I am sure there is a nicer Rails-y way to do it, but I am getting a little tired and I'm just going to slop it by naming those routes. nogweii 300 is plenty!
nogweii that's a LOT
And you can't see it, but the form approved. So if I click approve undefined method for...

03:35:34Can I delete it out of this one?

...41btd_12 the only reason i want ethernet is for wol
Yeah, this one, it's redundant. That's not a thing that we do. Because it's there at the top of each action. nogweii Wake On LAN
btd_12 wake on lan
What is WOL that you want Ethernet for?

03:36:03Oh, wake on LAN. Yeah, yeah. That does require physical ethernet.

...14So here's that, you look at this kind of dish. btd_12 although im not even sure if the laptop supports wol
There's that shotgun surgery I mentioned. So we have hats. That's all fine. Has a moderator. nogweii check the bios, I guess.
All right, let's go, let's go to my page. Let's go to my, oh, there's still going to be personal intro in there. btd_12 the bios has nothing but the os reports it as supported
My God, never really thought about how much stuff kind of leaks on the site because I view it myself.

...57Let's look at Peter's last hat. There we go. So it's number 348.

03:37:09btd_12 tried to send a packet and nothung worked
So if I bring that in here, there's no show action, but there should be an edit. Yeah, there we go. That's not a useful little helper there. It was on the new form, but it's kind of obvious from context on what the field is for.

...41nogweii @BTD_12 does the laptop have an ethernet port already? or do you need to use an adapater?
And if I click really cool guy two, good. btd_12 no it has ethernet built in
Reload, yeah. And if I say really cool guy three and dolphin create, good. So let's check that the build is green. Because if the build is green, this big refactor is at a reasonable place to commit. So let's move that away so I can see what I'm doing here. All right, so we have, what, 60 seconds before that passes? Ah, nice to have built-in ethernet. Not a lot of laptops do anymore.

03:38:41btd_12 i mean it is a 2016 laptop
For wake on LAN to work, you do have to have it enabled in both the OS and the BIOS. So you've got to check both places there, BTD. All right. A green build. And this is so much code I just pushed around. I really want to get a commit in, even though I know I still have some things outdated. So we are going to add those. Those are all the tests and new things. All right, let's shrink this. btd_12 the bios has no mention of wake on lan or wake on pcie or anything really the only real thing in the bios is intel ptt
So this is the big butchering, the big splitting of the hats controller where we ripped that out. Good. Build request is renamed. So we can add these two that I renamed. Dof is fine. That's just the form models changing. I bet I eat a exception in broad for this. There's gotta be a 500 or two coming my way. Cause like one place I missed renaming. All right. nogweii you may just be out of luck :(
If the BIOS has no mention btd_12 wifi card page reports wol as supported
wake on LAN the two things I would do would be do a Google search for your specific model and wake on LAN and then also look at if you can update the BIOS which is of course a little bit dangerous because you can brick the laptop but they're so reliable now I wouldn't worry too much about it you can look and see if a newer version of the BIOS for your laptop would support wake on LAN

03:40:35The Wi-Fi reports Wake Online has supported. That's a little strange. I didn't think it worked on Wi-Fi for anybody, but this is outside my area of expertise.

...54btd_12 there is wowlan wake on wireless lan
Split hat requests from hats for team better use Rails conventions. btd_12 also i meant the ethernet controller
btd_12 not wifi card
There we go. Oh, it's always nice to have, like, there's something really satisfying about committing such a hairy ball of code. All right, so the other two things I mentioned were that hat doffing needs to use wearable hats. So let's talk about that a second. If you are on the hats controller,

03:41:36It is only the moderators. They're fine. It's just doffing then. Yeah. So this actually is a bug. It is kind of a lookup bug. And I didn't catch it when I first approved the user's kernel's first PR. But this should say wearable hats. so that when someone is attempting to doff a hat, they can't doff a hat they have already doffed. The very bad version of this looks like, you know, hats. Now, singular hat dot find params ID, which is like if you know a hat's ID, you would just be able to look it up and doff anybody's hat for them. That would be very bad. This one, at least you could only do it to your own, but you could do it to your own multiple times, which was weird. And so I knew that it had to get an update to say wearable hats there. And we're going to do that for doff and doff by user. btd_12 the bios update thing on the laptops page is windows only ;(
btd_12 its an exe
And edit because, yes, even moderator shouldn't be doing well moderators take the left side of this so that's fine. So that should all be fine I expect we'll have a green build. Right.

03:43:21arh68 bin file ?
nogweii cab file?
btd if your bios update is only an exe do a search for bios update for that hardware model and throw in linux or arch because it is possible that the exe is just like actually what's the term i'm looking for here not a zip file literally but or a cabinet but a a file that compresses many others nogweii zip? archive?
and that maybe you could extract the actual bios bin from it and run some scary dd command to dump it in the right place no there's a i'm blanking on the general term for a file that's not really a file it's a archive of multiple files maybe archive is the word i wanted yeah i don't know what but what i'm saying is maybe that they are able to extract the bin. Look for what the Linux nerds do. There's very often, you search for anything in Linux and you will find someone trying to run Linux on their toaster. And I mean, worst case scenario, maybe you could just borrow a Windows CD and boot to Windows for a minute, run the BIOS update, go back. btd_12 it is a lenovo so there is alot of linux support for it
I think it's possible to make bootable Windows USB keys, right? Is that a thing? I only have Windows around for video games, so I don't actually know anything about rescuing Windows installs anymore. Yeah.

03:45:09arh68 i bought the usb when i paid for windows, but idk otherwise
There's that. arh68 i'm sure you can get-r-done
All right. So we're coming to the home stretch now where hats should have a short ID. One thing you may have seen as I was flipping through things is the raw table PK is leaking all over the place. Any place that you can put on a hat or edit a hat, you can see the integer ID and that's just kind of tacky. We have this short ID that we use on stories and comments. And so I wanted to bring that over to hats. It's not super urgent, but the code is really straightforward for it. So we would just make a migration.

03:46:18string and it can't be false which means i'm gonna have to add it and then migrate it find each do and then what is it alter column this now it'll default to np string and then let's grab from comment i've been in story a bunch so we have a hat model oh you're mad i modified model hat and we're going to say or create sign short ID. This is the sort of thing that now that there are three of them, I start wanting to extract it to its own helper because, you know, story and comment and now also have are repeating this code.

03:47:40There we go. This is the call I was looking for.

...48btd_12 f this all the software to make windows live usbs are windows only
sign short id good and we're gonna we shouldn't be overwriting those definitely shouldn't be doing that on comment god are we doing that on is that allowed on story yeah yeah no don't do that we're gonna have to touch the hat factory This is going to need, let's just steal for the factory for the comment, right? btd_12 maybe wine couod work
I mean, coding is basically copy and pasting. OK, it's automatically doing it. That's fine. And then maybe wine could work. Boy, I would be careful about running low level hardware stuff in wine. btd_12 not bios update thing the thing i said above
That just kind of raises the hair on the back of my neck of a BIOS update from Wine. Like, maybe it would work. But Wine is, well, Wine is not an emulator. Oh, the thing you said above for making a Windows guy. Yeah. Yeah, that. Knock yourself out. I definitely wouldn't download a Windows Live USB from, like, btd_12 i know about rufus from my windows days and that has a live usb option
pirate site that would be that there's no way that wouldn't have a virus in it all right so we're also going to add a to para to return the short id and then over in the routes do i have to touch any of these i don't think so i think that'll just start using id automatically go over to the hats controller and anywhere it mentions id instead of saying fine we're going to say find by short id all right this one is getting everything long. I'm going to go ahead and... You like that? There is some nice vim. That is a nice plug. I think split-join is very Ruby. All right. Let's see if that blows anything up. But I think it might be literally that simple. All right. It helps to run the migrations. It's not enough to write them. You have to run them. Oh, and then when you run them, you also have to write them.

03:50:42So for each one of these hats, we want to call hat dot. And I know I don't have it as a variable block yet. Here we go.

03:51:01Daniel Katz- duplicate column named duplicate Oh, because it's so the first time I ran the migration it created the column. Daniel Katz- And because not all relational databases will do. Daniel Katz- schema redefinition in. Daniel Katz- A transaction, none of them do by default, and so it did add the column on the first attempt that succeeded, and then the next line of code immediately blew up. So now the database is in an inconsistent state. So I will go ahead and revert the migration by hand.

...48I always get thrown by seeing an alter table say zero is affected. Like, no, you just affected every row. But I understand why it's like that. Here is a current undefined method, alterColumn, for instance. It's not alterColumn. ChangeColumn. ChangeColumn. Yes, of course, Rails. We have to invent all of our own names for things so that they can be ever so slightly different.

03:52:27Data truncated, an error has occurred.

...36Now I'm suspicious.

...47Let's put it in quotes so I can... I see the missing object.

03:53:03Oh, I don't have to. When I assign a hat, it helps to save the data. There we go. All right. Fingers crossed. Eighth try is the charm. And I didn't back the thing out.

...26Ninth try is the charm. God bless it. Short odd, short odd. Oh, my debugging code is breaking things. That's ignominious is what that is.

...59Oh, beautiful. All right. Let's check the build. Watch every last thing is going to blow up on me. Yeah. Yep. Actually, I loaded a page over there. Model hat wants to be self short ID to access that. That's going to save a few exceptions.

03:54:41Okay, that's going to be some kind of typo or syntax error if half the suite fails. What did I do? Validation failed. Short can't be blank. Oh, this is, why is story mad? Didn't like this. I have to overwrite what was there. I wonder if there's something not so great. No. Boy, am I suspicious of that not being or equals. And did it complain about comment too? No, these are all stories. I am so suspicious of that failure. Hold on. We're going to write that one down.

03:55:56All right. That was kind of an opportunistic improvement. I am okay with throwing it away, but I'm going to come back to it because I don't understand it. And when I don't understand stuff in our God object, I get real suspicious. Now, is this the same thing about comment now? I bet it is.

03:56:27username has already been taken what on earth url has been submitted this is i'm creating users this has got to be something weird in comment like here's the comment thing so let's go this is the the danger of opportunistically changing code

03:57:05I don't mind hunting on that. See, now we're down to just a couple. This is probably just hat code. I wonder if I have to make the same change to hat. That's so weird because it can't have anything that uses this brand new thing. I wonder if short ID I wonder if short ID is getting initialized to empty string and then the or equals wouldn't fire and then there isn't a short ID. And then we would get this error, short ID can't be blank.

...54Did I mess up the before create hook on the model? Hmm. It's still mad at comment, but I put that back. Didn't I put that back? Yes. There are no changes to the comment or the story model anymore. Hat is using self short ID. This name is the same.

03:58:27What's the exception?

...33validation let's just have that new okay so hat has to have a user hat and a short id so h dot hat is test hat h dot user is admin h dot save bang granted by user okay but then short can't be blank did the before create not fire

03:59:31Let's go ahead and make a new one. Test 2. User is admin. Granted by user is also admin. My callback didn't run. Boy, that's improper. Is this one of those things where the running Rails server has cached the model in some way? Definitely not.

04:00:13So it's complaining that... It's weird to me that it's not including the word ID in that error message, but Rails occasionally does those helpful things like not do that. Well, here's a good chance to earn VIP if anybody can spot the bug. We have this before create, assign short ID, and then short ID just fires and runs the... So the short ID model is a little bit of metaprogramming that goes ahead and makes a bunch of random IDs. But this isn't even firing. arh68 what's the difference between before_creat & before_validation on: :create
All right, let's look at, I mean, when in doubt, read the manual when all else fails. What's the difference between before create and before validation on, before validation? Boy, they run in different times. That might be it. Let's look at the callbacks. Because I want to say there's a table in here of the order they run in. But I snagged that from the comment model. So create goes before validation, after validation. So yes, it does need to be before on validate. Let's go look at where I snagged that from, because I must have just snagged that again. I must have missed that it said on. Yeah. That's exactly what it is. ARH, you are double VIP, I guess. Actually, I think you might be up to triple by now.

04:02:26hejihyuuga triple vip!!!
arh68 HahaCat
And the onCreate makes sure it only runs once when the model is initially prepared. There we go. I really suspect the... Okay, I probably don't need that debugging anymore. Let's go ahead and toss that and look at one of these failures. Undefined method user for true. Boy, that's going to be a funny error where I have a Boolean instead of a user model. Only user had our moderator. So that's going to be in the... hats controllers only user moderator function, right? Where did I slip up and put a Boolean? If the hat user is the current user or the current user, let's go ahead and say hat. So this value is a returning true. Does something manually call that? So look at this trace back. So line 76 is the suspicious one. This feels like I'm missing something obvious. Only the hat user or moderator are allowed to do those things. Undefined method user for true. So hat is equal to true. So the bug isn't here. The hat is down here.

04:04:04Oh, my little thin plugin didn't modify correctly. There we go. We don't need the result of the predicate. I'm surprised standard RB didn't complain about not having parentheses on that because it catches those.

...25If you heard a little pop there, that is my 20 year old air on chair, it pops like my knees do. Undefined method hat for nil. That's fine. I wonder if this is the form. No, this is the spec. The spec is out of sync because it's going to say hat.id when it needs to now say at short ID. Yeah. There's so many different layers of abstraction you can test at that I get a little suspicious of, do I want to be building a string URL? Because that also tests the routing. But if I test the path thing, if I had called visit edit hat path with the hat dot short ID, this bug wouldn't have happened. I don't know. So this sort of is an implicit test of the route. I don't know. There's issues both directions.

04:05:49So I think, fingers crossed, but we're probably back to a green build. And if we are, I can commit and deploy this stuff and we can, oh, four hours. Ran a little longer today. That's fine. This has been fun code. And if there's, yeah. So now is a great time to ask, does anybody have any kind of questions or other stuff about the site, the code base? This is kind of last call for questions. Yeah, I'm going to satisfy this really quick. Change column is not reversible. which is, what do I call instead? There's add, there's change, remove, add, update call, not at all. I really don't wanna write a separate down, cause I'm never gonna run it. Just write a separate down. That's fine. I agree, it's short ID to hats.

04:07:25okay it is now mad that i have multiple versions of ruby installed and do different things but that's not a failure so we're going to ignore that let's run breakman the dash q is for quiet so it's only going to print 50 lines of output good let's review the diff so there's the new migration i just looked at that it's fine the db schema I ran the migration, so that's what we see there. In the hat itself, there is, thanks ARH, the new validation on create. And I'm so suspicious that if this isn't or equals, it's because I'm getting an empty string. And then the parum, yep, all of that is good. Let's add this whole file. And then this stuff is going to be all... This is me being a little paranoid. That's fine. This is me breaking it out to multi-line because I don't want it so long. That's fine. This is that short ID change. This is that short ID change. Good.

04:08:55You know, there's one more thing I want to see. There's one more thing I want to see. Hold on. Hold on. Let's go here and pick a recent... Oh, I stopped the Rails server. Let me just start that. That's one of those. There was this hassle in Rails 1 where occasionally you could... see code in the console that was getting cached in the server because it like connected to the server process i'm misremembering the details of this but it made me forever suspicious of having a rails server running i just wanted to see yeah you know i'm seeing hat id instead of short id yeah all right i knew i had to so let's go look at the Comment form. Views, comment form? No. It's called the comment box. It is not called the comment form. Slight inconsistency. That's okay. So here we are making this. This wants to be short underscore ID. So now if I reload, I said reload.

04:10:31Come on, Firefox. Now it's putting those short IDs in here. Good. Let's say test comment one with test two, no hat. So then comments controller has also got to look up things by the hats. Is it still going to be called the hat ID parum? Let's find out swap you over here so I can just make you big.

04:11:25Yes. So the hat is the form key is still named pad underscore ID. So if I swap it to say, find by short ID, And then I happen to know that this is also over in the messages controller. Because you are allowed to use hats on private messages.

...56And why don't I see a mention of the hat here?

04:12:05Belongs to hat. Next if hat blank. Yeah, it's going to need the same. Inbox sent create.

...41I'm going to do that. There we go. On the home stretch. Now the message form needs to be updated to use it.

04:13:01To use the hack short ID. Let's run the build again. I think this is last call for lobsters or code base questions, queries, inquiries.

...30There we go.

...37So there's the change to look up hats by their short ID. to look up message hats by their short ID to have the form. Good. All right. Let's make a hats use short ID instead of leaking ID. And as leaks go, that's a pretty minor one. Man, busy stream. So this is kind of nice. Grab this and go. That's nice to add.

04:14:36Push it real good. All right. So with all of that pushed, Let's deploy.

...54All right. Man, big day. That's three pull requests merged. And then some nice cleanup work on top. I never got to investigating the heap dump. That's going to have to be for the next one. Lobster seems to have exercised a memory leak in YJIT. And I ran into Aaron Patterson at RailsConf. And I was like, wouldn't you like to help me fix this? pushcx https://github.com/Shopify/ruby…
And we debugged it for a while, but you can read the whole thing for yourself. But the gist of it was we needed to grab a memory dump from production, which was a lot easier said than done because it takes a minute to do. And if you attach to a running Puma worker and start dumping the memory after it's unresponsive for a little while, the Puma management process will just kill the worker mid-dump. So Byroot, who I believe works at Shopify and is on the Ruby core team, I'm pretty sure both of those things helped out to write a command to dump a heap. I ran it in production and I have to analyze those, which is a little intimidating, but I will probably do over the weekend because by email, he was very helpful at giving me a, command to sanitize the dumps so they don't include things like user passwords or emails or other PII kind of stuff, but still have enough data to debug. So I'm probably going to play with that over the weekend. If I wasn't starving for lunch and kind of beat up and tired after performing for a couple hours, I would want to jump in. But I think that's going to have to be a weekend or a Monday thing. And I'm a little leery of doing a big debugging session on screen, because it's impossible that it's just a couple hours of me being confused and stumbling around. I don't know what's super interesting to folks. arh68 idk that sounds interesting
I mean, obviously, you must be at least somewhat interested in watching me stumble around, because I do it constantly here. But this would be more stumbly than useful. Or than usual. arh68 probing the yjit underneath
All right, well, one vote from the triple VIP for watching Peter learn how to debug Ruby heap dumps. Probing the widget underneath. Yeah, I don't know a heck of a lot about widget. One of the really neat things that I am kind of quietly proud of lobsters for, he said on a programming stream, very quietly, is this note here in the trivia that we have real world complexity, as you've seen, as I've kind of rolled into repeatedly on stream. But people pick up the code base and use it for interesting things. And so one of them was that Shopify grabbed, I just literally, like I saw the toot go by on Mastodon that the Shopify rails team picked up lobsters and packaged it up into use it as a benchmark. Oh man. It's almost a year ago to the day. I don't know. I find this really heartwarming. This is a way of lobsters giving back to the Ruby and rails community. That's been so incredibly valuable for it. I mean, it's just infinite amounts of work from folks like Shopify and, Basecamp and all of the other contributors. arh68 would be a good anniversary stream PopGhost
And so that Lobster's is open source, mostly, you know, when Lobster started a dozen years ago, there were way more conspiracies about how Hacker News worked. A good anniversary stream. Let's see, today is Thursday. I'll be like one day late, but yeah, I guess that says I have to. And now the question is, do I make some time this weekend to like cheat and peek ahead of the time? Or do I just jump in and only do it live? If I could run one of those polls, this would be pretty tempting to say, like you can vote on whether I should be prepared or whether you can watch me stumble. I do see the allure of watching somebody stumble into this stuff. It's, I don't know. byby42 If the hours match, I can guide you trhough.
I think part of the value of this is it's not polished. It's just me knocking around. I typo stuff all the time. And if you are a programmer who has byby42 (byroot yes)
any amount of imposter syndrome bye-bye 42 are you by route bye-bye 42 there's a similar name but i don't remember your username super well until i see them yes you are okay well it is you i am thinking so the hours i would be doing it i'm starting on monday at 2 p.m Go back to one of my favorite tools. And so 2 p.m. Well, there's, you can compare. It's fairly late for European time zones. But I guess what I'm saying is if 40 minutes from now on Monday works for you, 40 minutes from now on Monday is the plan. All right. byby42 Yeah, I can make it work, just need to have diner early
I think that's a good place to call it. Thanks very much folks for dropping by. It's been a lot of fun. arh68 later y'all HypeLurk
byby42 (or late_
I will have the, assuming my transcript, have dinner early. Oh boy. Assuming my transcript thing doesn't bug out on me and it is just a hundred lines of Ruby soup, I'll have the recording and the transcript up in probably an hour or so. Take care, folks. I will see you on Monday, I hope. Add the calendar with its questionable iCal time zone to your own. Take care.