<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Killian McGrath</title>
    <description>The latest articles on DEV Community by Killian McGrath (@killianmcgrath7).</description>
    <link>https://dev.to/killianmcgrath7</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F351142%2F7feaccb3-1a6b-47f9-9980-0a2d056ede49.jpg</url>
      <title>DEV Community: Killian McGrath</title>
      <link>https://dev.to/killianmcgrath7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/killianmcgrath7"/>
    <language>en</language>
    <item>
      <title>Stop Leaving Yourself Open to Massive Cloud Bills</title>
      <dc:creator>Killian McGrath</dc:creator>
      <pubDate>Tue, 19 Mar 2024 23:40:14 +0000</pubDate>
      <link>https://dev.to/killianmcgrath7/stop-leaving-yourself-open-to-massive-cloud-bills-49ka</link>
      <guid>https://dev.to/killianmcgrath7/stop-leaving-yourself-open-to-massive-cloud-bills-49ka</guid>
      <description>&lt;p&gt;It's relatively easy to build a web app. However, it's far more difficult to build one that's secure, scalable, and does not expose the user to DDOS/cost attacks.&lt;/p&gt;

&lt;p&gt;In this article, I'll cover some important things I've learned as a self-taught programmer who hosts my own web apps.&lt;/p&gt;

&lt;h2&gt;
  
  
  The motivation for this post
&lt;/h2&gt;

&lt;p&gt;The following video popped into my YouTube feed the other day: &lt;a href="https://youtu.be/-lNpF0ACe1Y?si=bzVhmGh8aPwXD8Jw"&gt;I got my first DDoS (and what you can do to help prevent it)&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A YouTuber, Web Dev Cody, racked up a $269 AWS bill when his Icon Generator &lt;a href="https://www.icongeneratorai.com/"&gt;website&lt;/a&gt; got hit with over 200,000,000 requests in about an hour.&lt;/p&gt;

&lt;p&gt;The $269 bill is honestly quite tame compared to what's possible. For example, here's a &lt;a href="https://old.reddit.com/r/webdev/comments/1b14bty/netlify_just_sent_me_a_104k_bill_for_a_simple/"&gt;$104k bill for a static Netlify website&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Public cases, such as the Netlify one above, often have the bills forgiven. However, there's no guarantee of this. You may also leave yourself open to smaller, less obvious ways in which you're paying too much for cloud services.&lt;/p&gt;

&lt;p&gt;While Web Dev Cody's bill wasn't particularly massive, it's a great example of unnecessary exposure to runaway cloud bills.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Cloudflare for Static Assets
&lt;/h2&gt;

&lt;p&gt;After reviewing Cody's bill, I found that he incurred costs for Amazon CloudFront (AWS's CDN) requests and bandwidth.&lt;/p&gt;

&lt;p&gt;The pinned comment on this YouTube video currently reads:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;from all the comments I've read from people smarter than myself, you should probably just use cloudflare.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I could not agree more.&lt;/p&gt;

&lt;p&gt;AWS charged him $269 because a (presumably bad) actor repeatedly made requests to a static page on his website. &lt;/p&gt;

&lt;p&gt;Had I been building the same website as him, I'd have used &lt;a href="https://pages.cloudflare.com/"&gt;Cloudflare pages&lt;/a&gt; to host the static assets... And my bill would still be $0 after the attack.&lt;/p&gt;

&lt;p&gt;I don't want to pick on Cody at all, but I quickly learned when reading/watching tutorials that content creators usually fail to take into account or explain how to avoid massive bills. When Cloudflare launched its Pages product, it was a game changer for me when launching personal sites, prototyping, and hosting MVPs.&lt;/p&gt;

&lt;p&gt;For example, I recently (re)built a game sensitivity converter &lt;a href="https://gamesensconverter.com/"&gt;website with thousands of pages&lt;/a&gt;. As it's currently just a static website, I was able to host it with Cloudflare pages at $0.&lt;/p&gt;

&lt;p&gt;Even if you're using another server or cloud platform to host/generate your content, you should still utilize Cloudflare's (free or very cheap) &lt;a href="https://www.cloudflare.com/application-services/products/cdn/"&gt;CDN&lt;/a&gt; and proxy services to cache static assets. Unlike other CDNs, Cloudflare does not charge for bandwidth (at least until you reach enterprise levels), assuming you're abiding by their very legitimate TOS.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compute
&lt;/h2&gt;

&lt;p&gt;To be honest, I haven't looked too much into Cody's website, but presumably, it also needed compute.&lt;/p&gt;

&lt;p&gt;When it comes to compute, I unfortunately haven't found an overwhelming obvious choice like with Cloudflare for static assets.&lt;/p&gt;

&lt;p&gt;There are always tradeoffs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Serverless is easy but absurdly overpriced once you reach scale (go beyond free tiers, etc).&lt;/li&gt;
&lt;li&gt;Companies like Heroku, DigitalOcean Apps Platform, Netlify, etc. do indeed make things easier, but again, they're overpriced.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Whatever you do, make sure you thoroughly read through companies' billing terms.&lt;/p&gt;

&lt;p&gt;If there's no guaranteed fixed cost, make sure there are ways to programmatically monitor your billing and limit/stop services if you reach a certain threshold.&lt;/p&gt;

&lt;p&gt;It's also important to choose a service that updates usage/billing in real-time. This &lt;a href="https://www.theregister.com/2020/12/10/google_cloud_over_run/"&gt;$72,000 Google Cloud bill&lt;/a&gt; was partially a result of the Firebase Dashboard taking 24 hours to update.&lt;/p&gt;

&lt;p&gt;While likely not the optimal choice, I usually use Heroku for prototyping, personal projects, and MVPs. It's not cheap for what you're getting, but they offer fixed prices and don't charge overages on basic plans (as far as I understand).&lt;/p&gt;

&lt;p&gt;However, you can use anything as long as you can monitor your usage/billing. But whatever you do, don't expose yourself to potentially massive runaway costs.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>cloud</category>
      <category>hosting</category>
      <category>aws</category>
    </item>
    <item>
      <title>Breaking Away From Bootstrap CSS Framework</title>
      <dc:creator>Killian McGrath</dc:creator>
      <pubDate>Tue, 13 Oct 2020 08:13:23 +0000</pubDate>
      <link>https://dev.to/killianmcgrath7/breaking-away-from-bootstrap-css-framework-229b</link>
      <guid>https://dev.to/killianmcgrath7/breaking-away-from-bootstrap-css-framework-229b</guid>
      <description>&lt;p&gt;I began teaching myself how to code a little less than a year ago to give myself the ability to start any website I wanted without having to hire a programmer.&lt;/p&gt;

&lt;p&gt;While I've genuinely enjoyed figuring out how to solve the logical problems required to make certain tools and apps, I absolutely loathe working on any front-end aspects dealing with UI and design.&lt;/p&gt;

&lt;p&gt;Due to my hate for front-end programming and the fact that I had experience working with Bootstrap in the past WordPress websites I made using page builders, I just assumed using Bootstrap or another CSS framework was my best bet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bootstrap Does Speed Up Development
&lt;/h2&gt;

&lt;p&gt;For my first coding projects, I used &lt;a href="https://react-bootstrap.github.io/"&gt;React-Bootstrap&lt;/a&gt; ("The most popular front-end framework Rebuilt for React") and &lt;a href="https://react-select.com/home"&gt;React Select&lt;/a&gt; (for easy dropdown selection fields).&lt;/p&gt;

&lt;p&gt;As you'd hope from something calling itself "Bootstrap," it did make it incredibly easy to shit out a halfway decent looking website. From memory and a bit of "ctrl + fing" the docs, I could knock out most of the design work for a new website in less than an hour.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problems With Bootstrap
&lt;/h2&gt;

&lt;p&gt;The problems came whenever I wanted a unique look for a React-Bootstrap component. For Bootstrap to work, you need to use its CSS. This means that I had to overwrite the existing CSS any time I tried to custom style a bootstrap component.&lt;/p&gt;

&lt;p&gt;Glossing over unused and duplicate code issues, this is a pain in the ass, at least for someone as awful at CSS as myself.&lt;/p&gt;

&lt;p&gt;When adding a bootstrap component, you end up with a bunch of "phantom code." You write one line of code, that's actually a component with multiple lines. While this is the entire benefit of Bootstrap, it actually makes it a colossal pain to even find the correct element to target in your CSS.&lt;/p&gt;

&lt;p&gt;I'd end up spending more time and writing as much CSS than if I'd just written custom code for everything.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSS is Easy. What was I thinking?
&lt;/h2&gt;

&lt;p&gt;I've been working on a new website recently in the golf niche. One type of content on the site is product round-ups (e.g., The best XYZ).&lt;br&gt;
A requirement I had was a scrolling carousel of all the products in each guide. This allows readers who want a quick breakdown of each product to find answers to their questions above the fold. It also doesn't require too much scrolling down the page for readers who want more info (e.g., Things to Consider When Choosing XYZ).&lt;/p&gt;

&lt;p&gt;If you're not sure what I'm talking about, here's a not quite finished but functional example I built, as you can see in &lt;a href="https://golfbit.com/best-golf-rangefinder"&gt;this article&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--L-5WcwLx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jmno4u0su6jy14u3jac0.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--L-5WcwLx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jmno4u0su6jy14u3jac0.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anyway, after hours trying to figure out how to make this utilizing Bootstrap, I cut my losses and decided to rewrite all of the front-end code for my website.&lt;/p&gt;

&lt;p&gt;I watched a video on CSS Flexbox and spent about 10 minutes reading a couple of articles on the subject before beginning my start from scratch.&lt;/p&gt;

&lt;p&gt;Well, it ended up taking me only a couple hours to rewrite all the front-end code I had and create the product carousel.&lt;/p&gt;

&lt;p&gt;While I definitely need a web designer's help if I want to improve the looks of everything, I'm now confident I could make just about anything UI related in a somewhat reasonable amount of time. My code is also much cleaner and there are no risks of serving unused CSS.&lt;/p&gt;

&lt;h2&gt;
  
  
  I Should Have Done This Sooner
&lt;/h2&gt;

&lt;p&gt;What's the point of this article?&lt;/p&gt;

&lt;p&gt;I should have taken a few minutes to learn the basics of CSS a long time ago! After a few weeks of this, I actually find it far more straightforward than using a CSS framework.&lt;/p&gt;

&lt;p&gt;I'm now preemptively kicking myself for the next major mistake I'll find out I've been making a year from now.&lt;/p&gt;

</description>
      <category>css</category>
    </item>
    <item>
      <title>Have Projects In Mind When Teaching Yourself to Code</title>
      <dc:creator>Killian McGrath</dc:creator>
      <pubDate>Tue, 17 Mar 2020 00:49:58 +0000</pubDate>
      <link>https://dev.to/killianmcgrath7/have-projects-in-mind-when-teaching-yourself-to-code-45oe</link>
      <guid>https://dev.to/killianmcgrath7/have-projects-in-mind-when-teaching-yourself-to-code-45oe</guid>
      <description>&lt;p&gt;Though I have a VERY long way to go in becoming a good programmer, I feel my progress teaching myself to code has exceeded what the average beginner achieves in a similar time frame.&lt;/p&gt;

&lt;p&gt;While you could argue that I could have learned more in this time, I think it's at least safe to say I've put in more time over the last few months than the vast majority of other people on a similar journey (many 12-18 hour days).&lt;/p&gt;

&lt;p&gt;In this article, I want to talk about how I've managed to stay focused on learning and coding almost all day every day for the last few months.&lt;/p&gt;

&lt;h2&gt;Yes, Not Everyone Has As Much Time to Invest&lt;/h2&gt;

&lt;p&gt;Yes, I'm aware not everyone has as much time to invest in learning to code. I've fortunately set myself up over the last few years by creating low maintenance websites (WordPress sites that didn't require any real programming knowledge) that generate enough monthly revenue that I feel comfortable taking time off to learn a new skill. I've also drastically cut down on my spending.&lt;/p&gt;

&lt;p&gt;This article isn't necessarily about spending all day learning to code. Instead, it's about finding the motivation to stick with it when the initial excitement wears off.&lt;/p&gt;

&lt;h2&gt;Have Real Projects In Mind&lt;/h2&gt;

&lt;p&gt;Whether spending 12-18 hours a day or just a couple hours a week learning to code, I think it's extremely helpful having projects in mind that you want to build.&lt;/p&gt;

&lt;p&gt;As you learn the basics of your programming language, start thinking of simple projects you'd like to use yourself. If you can't think of anything unique, try to recreate or even improve an existing tool.&lt;/p&gt;

&lt;p&gt;My very first JavaScript coding project was a recoil calculator for a &lt;a href="https://gunpros.com/" rel="noopener noreferrer"&gt;firearms review website&lt;/a&gt; I've run for a couple of years. While I figured out how to implement the logic in a text editor, I didn't actually know how to implement it on a website... so I ended up &lt;a href="https://gunpros.com/recoil-calculator-charts/" rel="noopener noreferrer"&gt;making it&lt;/a&gt; with a WordPress plugin.&lt;/p&gt;

&lt;p&gt;Despite not using the code I had written, I was hooked and wanted to learn how to build a full website 'from scratch.' This led me to learn React &amp;amp; &lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;NextJS - "The React Framework."&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Aside from shooting firearms, video games are one of my favorite ways to &lt;span&gt;waste time&lt;/span&gt; have fun and relax. I've always wanted to create a website to do with gaming and eSports, so I started working on individual tools in that space.&lt;/p&gt;

&lt;p&gt;My first project was a very simple sensitivity converter that allows you to find the &lt;a href="https://calculatorandconverter.com/video-games/mouse-sensitivity-converter" rel="noopener noreferrer"&gt;same sensitivity in a different game&lt;/a&gt;. It's not going to change the world, but it felt great to code and release my first useful project to the world after around a month of learning.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IDnKXf-0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://killiantmcgrath.com/wp-content/uploads/2020/03/Mouse-Sensitivity-Converter-Example.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IDnKXf-0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/http://killiantmcgrath.com/wp-content/uploads/2020/03/Mouse-Sensitivity-Converter-Example.png" alt="Mouse Sensitivity Converter Example"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Since then, I've continued adding additional tools to the website and am in the process of building an event organizer that helps users find eSports match streams and tournaments, starting with the game Counter-Strike: Global Offensive (CS:GO).&lt;/p&gt;

&lt;p&gt;With the goal of creating a functional and useful gaming website, I've been able to maintain my passion for learning and writing code.&lt;/p&gt;

&lt;h2&gt;Learn By Doing&lt;/h2&gt;

&lt;p&gt;When I started doing online coding courses (&lt;a href="https://www.codecademy.com/" rel="noopener noreferrer"&gt;Codecademy&lt;/a&gt; and &lt;a href="https://codewithmosh.com/" rel="noopener noreferrer"&gt;Code With Mosh&lt;/a&gt;), I took diligent notes in Google Docs. As I tried to progress, it was incredibly frustrating to forget what I'd learned and constantly having to look over my notes before writing any code.&lt;/p&gt;

&lt;p&gt;Beginning to work on real projects forced me to repeat what I'd learned and write code without a guide.&lt;/p&gt;

&lt;p&gt;Initially, this was a huge struggle, but it led to me memorizing core concepts and learning how to efficiently search for coding answers on Google.&lt;/p&gt;

&lt;h2&gt;Final Thoughts&lt;/h2&gt;

&lt;p&gt;Weeks 3-6 of learning to code were a huge grind for me. If I hadn't begun working on real (yet simple) projects that interested me, there's a good chance I'd have given up.&lt;/p&gt;

&lt;p&gt;Think of a project you want to build, search Google for project ideas, or expand on projects you're learning to develop in online coding courses.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
