teef's blog

teef's blog

I'm Tyler (39, he/him, loves hockey and delicious beers), and this is the jamstack(-ish) version of an old wordpress blog. I was looking for a way to only pull newer posts from said blog, and with GraphQL it's super, super easy.

In case you don't care about one of these topics, filter the posts with these links:

Latest Posts:

  • ishedeadyet.us (part 2)
    Wednesday, December 9, 2020 6:09 PM

    It’s live at https://ishedeadyet.us! The day before the Thanksgiving break I got the inspiration to start and mostly finish this thing that started out as a joke, and still is a joke, but there’s actual code there now. I read something the other day about how we should be ok with drawing a line when it comes to our own empathy. It’s true. There are some people, that just suck. That’s it. It’s not even schadenfreude, it’s reality. One of the most liberating moments of my life was when my mom said, ‘you don’t have to like everybody‘.

    Holy. The freedom I was given when I heard that (c’mon I was like 8 at the time). Before that, if I didn’t like someone, it was my problem, there must be something wrong with me, something I needed to figure out about myself. Yes, continue to contort yourself mentally and emotionally until you can like literally everyone. No that person just sucks, spend your time thinking about and being around people that don’t suck.


  • Lazily checking for empty objects and arrays
    Thursday, November 19, 2020 11:13 AM

    Pro Tip: Don’t.

    I’m doing a lot of checking API responses for empty objects or empty arrays in order to render a spinner or some kind of feedback message in the case that the API returns nothing or fails. Handling these cases is pretty important, but what I was doing was fundamentally flawed. I was *only* checking the length of arrays, and for objects I would use the following

    {Object.keys(theObject).length === 0 ? : }

    and call it a day.

    What’s wrong with that? Well, if your API returns a response message, say something to the effect of {"result": "FAILURE"} – it’s an object, and it has a length, so your code is then saying ‘go ahead and render the page’. And then your app crashes.

    In my case I’m going to check both for an empty object or array, AND for a clear sign that even if I come upon ‘not empty’, that I’m also checking for a clear sign that the response *is not* a green light to render away. Here’s what I landed on for my use case:

    const failureCheckObject = (obj) => { 
      const result = Object.entries(obj).filter( 
      ([key, value]) => value === "FAILURE");
      return result.length === 0
    }

    I’m not guaranteeing something like this will solve all of your problems, but I do think it’s wise to walk through your use case and come up with an as-bulletproof-as-possible-in-the-time-available way to check something else about that object or array so that if it kind of actually does meet your definition of ’empty’, you’re handling it well.


  • ishedeadyet.us
    Saturday, October 10, 2020 8:49 AM

    kinda unreadable as far as urls go, but… I’m working on it as a site dedicated to booleans


  • Quarantine Parenting
    Saturday, October 10, 2020 7:34 AM

    I wish I had better advice for anyone trying to raise young kiddos right now(during a pandemic, where almost everything is f**ked), but here are a couple things I’ve learned that might be helpful: Tell your kids that you love them a lot(as in frequently), even if it’s only to remind yourself that you actually do love them. Try to lean into the good parts, when everyone is happy in the moment, and if you’re struggling to identify ‘good parts’, try ice cream.

    On the whole, the anxiety, fear, and doubts about how this is going to affect your kids… it is overwhelming. One last thing to remember though: You’re not always going to have to do this parenting thing during a pandemic. One day, this stupid period of time will end.


  • Oh Shit, Git!
    Saturday, October 3, 2020 7:04 PM

    Oh Shit, Git is brilliant. Not only is it an incredibly helpful resource for when you step in it with git, like when your eyes were crossed at the end of the day, and you committed to master. What pushes it over the top is that the language *perfectly* captures the way you will feel in those moments, like when you were going too fast, and the thing you tried to do to fix your mistake made it waaay worse.

    It’s knowledge and therapy at the same time. If you’re not into the foul language, dangit, git has you covered.


  • Blog post 2020
    Thursday, October 1, 2020 5:25 PM

    My last post was 7 years ago. Since then, I’ve had two kids, moved, and got a job as a software engineer. I’ve also cringed pretty hard at the old posts that were on this blog.