All Posts

  • LONG READ: My 2023 Advent Of Code SolutionsLONG READ: My 2023 Advent Of Code SolutionsAdvent of code is a fun way to practice your problem solving skills, get some coding practice, or even picking up a new language. I am planning on solving this years problems in Go, so I can learn more about the language Day 1 Part 1 The first part of day 1 of AoC basically consists on the following. Given a file input like this one: 1abc2 pqr3stu8vwx a1b2c3d4e5f treb7uchet Find the first and last number of each line, in this case 12, 38, 15, and 77. Add them together to get the answer of
  • RANT: Youtube is changing the homepage for users with history disabledRANT: YouTube is changing the homepage for users with history disabledIn case you haven't seen this, YouTube announced a "new viewer experience that better corresponds to your YouTube watch history preferences", but I can't help but feel they are just trying to bully me into turning watch history on UPDATE: Still using YouTube with my history off! Still no recommendations. I don't see them ever rolling this back sadly :( While I wouldn't describe myself as someone who overly cares about his online privacy, I am definitely conscious about the ways I give data to
  • Implementing API Rate Limiting With Upstash and Next.jsImplementing API Rate Limiting With Upstash and Next.jsRatelimiting is an important concept when developing APIs, but it can also be a little scary if you've never done it before. In this article, I'm going to show you how simple it is implement API rate limiting with Upstash and Next.js. Introduction If you've ever developed an API, you may have heard of the term "ratelimiting". Ratelimiting is a way to prevent your API from being abused. For example, if you have an API that allows users to create posts, you may want to limit the number of posts
  • Implementing Server Side Auth With Firebase and Next.jsImplementing Server Side Auth With Firebase and Next.jsI was recently working on a Next.js Application. I normally use firebase-auth for authentication, but the main library runs client side, and I needed to implement server side authentication. Here's how I did it. Introduction If you've used the firebase package when implementing auth in your web application, you may know that it provides client side authentication. It provides an easy way to log your users in and out, but some extra work is needed if you need to authenticate your users server
  • Writing a Typesafe getServerSideProps Wrapper for Auth RedirectsWriting a Typesafe getServerSideProps Wrapper for Auth RedirectsI have been learning more about Typescript recently, and I wanted to practice some of the concepts I have been learning to write a typesafe wrapper for getServerSideProps that redirects to a login page if the user is not authenticated. Introduction As I shared in my previous post, I recently had to implement server side authentication in a Next.js application. I wanted to write a wrapper for getServerSideProps that would redirect to a login page if the user was not authenticated. I also wante
  • How I sped up my website's deployments by 60%How I 2x my website's deployments migrating to ViteI started this site nearly 2 years ago using Create React App when I didn't know any better. Yesterday I migrated to Vite and was amazed by the performance and DX gains without putting in that much work. About 2 years ago, I started making some freelance/webdev work and one of my first websites was a simple landing page for a client. At the time, I decided that Create React App was the best tool for the job. I was just getting comfortable with React so it seemed like the obvious choice. Howe
  • An overview of Big O Notation and an example at Amazon scaleAn overview of Big O Notation and an example at Amazon scaleIn computer science, big-o-notation describes how the runtime of an algorithm scales as it's input size gets bigger. This matters a lot, specially when you're dealing with the scale of a company like Amazon. What is Big O Notation big-o-notation is a tool used in fields like mathematics and computer science to describe how a function scales according to it's input. In software development, it is normally used to describe how the runtime of an algorithm will scale as it's input size grows. Tak