<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dylan Carver on Medium]]></title>
        <description><![CDATA[Stories by Dylan Carver on Medium]]></description>
        <link>https://medium.com/@dylancarver14?source=rss-94315be0dcc1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eVXREcmlZTSyeOFcMmDkFA.png</url>
            <title>Stories by Dylan Carver on Medium</title>
            <link>https://medium.com/@dylancarver14?source=rss-94315be0dcc1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 09:16:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dylancarver14/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Verify Site Ownership for Google AdSense in a Next.js 15+ App]]></title>
            <link>https://medium.com/@dylancarver14/how-to-verify-site-ownership-for-google-adsense-in-a-next-js-15-app-c7d9a80e0964?source=rss-94315be0dcc1------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7d9a80e0964</guid>
            <category><![CDATA[google-adsense]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[google-ads]]></category>
            <dc:creator><![CDATA[Dylan Carver]]></dc:creator>
            <pubDate>Mon, 31 Mar 2025 01:17:26 GMT</pubDate>
            <atom:updated>2025-03-31T03:12:28.144Z</atom:updated>
            <content:encoded><![CDATA[<p>When setting up Google AdSense for your website, one of the first steps is verifying that you own the site. While Google offers several verification methods, the meta tag approach is one of the simplest and most reliable methods, especially for Next.js applications.</p><p><strong>I tried the script tag method</strong>, and while that is an easy method in JavaScript frameworks like React, Next.js seems like it is <strong>not</strong> built to support that method. Luckily, AdSense supports the meta tag method.</p><p>At the time of writing, this method worked on <strong>Next.js version 15.2.4</strong></p><p><strong>Step 1</strong>: Log into Google AdSense and add a <strong>New Site</strong> and enter the domain of your hosted Next.js project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0BeQmDXH78fdCx3BFDdr8w.png" /></figure><p><strong>Step 2:</strong> Copy the <strong>name</strong> and <strong>content</strong> values from the Meta tag parameters</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*ANWLPflxK3Eq3KP2D3n6-A.png" /></figure><p><strong>Step 3: </strong>Go to your Next.js app and <strong>open layout.tsx</strong> to add your meta tag info</p><p>Add an <strong>other</strong> key to your metadata export object and add the following object as the value of that key:</p><pre>import type { Metadata } from &quot;next&quot;;<br>import { Suspense } from &quot;react&quot;;<br>import { PostHogProvider } from &quot;./providers/posthog&quot;;<br>import { Navbar } from &quot;@/components/navbar&quot;;<br>import { Toaster } from &quot;sonner&quot;;<br>import { Inter } from &quot;next/font/google&quot;;<br>import &quot;./globals.css&quot;;<br><br>const inter = Inter({ subsets: [&quot;latin&quot;] });<br><br>export const metadata: Metadata = {<br>  title: &quot;Example App&quot;,<br>  description: &quot;Example App&quot;,<br>// HERE --------------------------------<br>  other: {<br>    &quot;google-adsense-account&quot;: process.env.NEXT_PUBLIC_GOOGLE_ADSENSE_ID ?? &quot;&quot;,<br>  },<br>// -------------------------------------<br>};<br><br>export default function RootLayout({<br>  children,<br>}: Readonly&lt;{<br>  children: React.ReactNode;<br>}&gt;) {<br>  return (<br>    &lt;Suspense&gt;<br>      &lt;html lang=&quot;en&quot; suppressHydrationWarning&gt;<br>        &lt;body className={inter.className} suppressHydrationWarning&gt;<br>          &lt;PostHogProvider&gt;<br>            &lt;Navbar /&gt;<br>            {children}<br>            &lt;Toaster position=&quot;top-right&quot; /&gt;<br>          &lt;/PostHogProvider&gt;<br>        &lt;/body&gt;<br>      &lt;/html&gt;<br>    &lt;/Suspense&gt;<br>  );<br>}</pre><p>Optional: Add this to your projects <strong>.env</strong> file and replace this default AdSense id with the one from Google AdSense you copied earlier. This only is for local development testing and does not affect the verification process, but is a good habit to have:</p><pre>NEXT_PUBLIC_GOOGLE_ADSENSE_ID=your_google_adsense_id</pre><p><strong>Step 4:</strong> Deploy your application</p><p>If you are using a cloud hosting service like Vercel or AWS Amplify, be sure to <strong>update the Environment Variables</strong> for that project with these values.</p><p><strong>Step 5:</strong> Verify the site in Google AdSense</p><p>When the new deployment is live, go back to Google AdSense where we left off. In the <strong>Meta tag</strong> tab, check the box saying “I’ve placed the HTML &lt;meta&gt; tag” and then click <strong>Verify:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/809/1*HddZ1sPj4hjRYmzWbEoJjA.png" /></figure><p>You should receive a pop-up saying this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*hFDh_QxQGFUvo2gGeC9r0w.png" /></figure><p><strong>Step 6: </strong>Done! Congrats!</p><p>Upon clicking <strong>Next</strong>, be sure to click <strong>Request Review</strong> to allow Google AdSense to fully review your site which usually takes a few days, but can take up to 2–4 weeks according to them</p><p>I hope this helped. I felt like I should share this solution since I spent nearly an entire workday sifting through articles and solutions for older versions of Next.js that didn’t apply to me and didn’t work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7d9a80e0964" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Make a Simple Sign-Up Page That Checks if the User’s Email Includes ‘@’ and ‘.com’]]></title>
            <link>https://medium.com/@dylancarver14/how-to-make-a-simple-sign-up-page-that-checks-if-the-users-email-includes-and-com-6ee57e002769?source=rss-94315be0dcc1------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ee57e002769</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[activerecord]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Dylan Carver]]></dc:creator>
            <pubDate>Mon, 24 Oct 2022 02:59:54 GMT</pubDate>
            <atom:updated>2022-10-24T15:00:33.181Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Make a Simple Sign-Up Page That Checks if the User’s Email Includes ‘@’ and ‘.com’ &amp; Other Things using Ruby on Rails Regex Backend Validators</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/340/1*_f5Afi2NO4znanEV5IXOQw.png" /></figure><h3>What to expect:</h3><h4>Please Read the Following Paragraphs Before Inserting Code!</h4><p>If you are here it means you need help with your sign-up page. Maybe you want your app to perform actions common web apps have for validating users on the sign-up page. Well, you are in luck because I have just the thing…mostly.</p><p>For some methods, we will be using Rails Regex (Rails Regular Expressions). For others, we are forced to install a gem to get that functionality. This code is running on a Ruby on Rails backend server. We will test functionality using the rails console.</p><p><strong>Disclaimer:</strong> Some of the methods in this article should not be deployed to a commercial app due to low-level security measures put in place. These methods should only be used for low-functionality projects with limited user interaction to avoid malicious use. They are, however, great for practicing validations on the junior level. The good news is I will also show you how to make a secure app for commercial deployment.</p><h3>Items covered:</h3><ol><li>Requiring users to use proper email format (text@text.text)</li><li>Checking if an email has been used before</li><li>Character minimums and maximums for passwords</li><li>Requiring fields to not be blank</li><li>Requiring users to make a password with at least 1 capital letter, 1 number, and 1 special character*</li></ol><h3>And Now the Good Stuff!</h3><pre># <strong>Requires email in text@text.text format</strong></pre><pre>validates :email, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i }</pre><pre># <strong>check database to see if email has been used before</strong></pre><pre>validates :email, uniqueness: true</pre><pre># <strong>requires password to be a cretain length</strong></pre><pre>validates :password, length: { in: 11..17}</pre><pre># <strong>this will require that these fields not be blank</strong></pre><pre>validates :name, :password, presence: true</pre><pre># <strong>Requiring users to make a password with at least 1 capital letter, 1 number, and 1 special character requires a gem</strong></pre><h3>Advanced Password Validations</h3><p>As of the time of writing this, I could not find a reliable source for a Rails Regex validation that will require users to make a password with at least 1 capital letter, 1 number, and 1 special character. To do this you must install a gem. The one I found that comes highly recommended is the <a href="https://github.com/phatworx/devise_security_extension">Devise Security Extension</a>. I highly recommend installing their gem to get full security and validation for your app. This will make it ready for commercial deployment without the risk of malicious users.</p><h3>That’s it! You are done!</h3><h4>However, I would recommend testing your data using the steps below</h4><h4>Pro Tip: Try to break your code by inputting criteria outside of the validations to test their…well…validity!</h4><ol><li>Open the console using rails c</li><li>Run User.create(email: “name@gmail.com”, password: “BlueTiger812#”) and there should be no issues</li></ol><h3>Conclusion:</h3><p>It is very easy to format an email because it will be in the same format every time. It is also easy to check if it exists in the database already because it isn’t technically sensitive data. Passwords, however, are in different formats and, therefore, harder to restrict. Although you can, by default, include capital letters, numbers, and special characters in a password in Rails, I have found no way to force the user to input one without installing a gem. It is for the best though because installing the gem will give you practice implementing secure practices for password strength. Just with the methods listed above, you will definitely be able to implement a smart sign-up page for your app.</p><h3>Happy Coding!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ee57e002769" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ruby with Active Record is just Microsoft Access Without the Visuals]]></title>
            <link>https://medium.com/@dylancarver14/ruby-with-active-record-is-just-microsoft-access-without-the-visuals-48c6b9981d57?source=rss-94315be0dcc1------2</link>
            <guid isPermaLink="false">https://medium.com/p/48c6b9981d57</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Dylan Carver]]></dc:creator>
            <pubDate>Mon, 03 Oct 2022 21:49:19 GMT</pubDate>
            <atom:updated>2022-10-03T21:49:19.901Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*amcZbkaapy0_vmmroNPQDQ.png" /></figure><h3>Transfer Your Skills Easily! But First…</h3><h4>What is Ruby in a Nutshell?</h4><p>Ruby is a diverse language used for many backend applications and has many associated layers to make coding easier. This language is used to create a dynamic backend <em>database </em>for front-end applications and essentially is used to create an API. Notice I said <em>database. </em>Isn’t Microsoft Access an application to develop and manage a database? The similarities will shock you.</p><h4>What is Microsoft Access in a Nutshell?</h4><p>Access is a program used to manage data in a database. People rarely use this application regularly, but as a business major, this was overly taught to us.</p><p>Essentially, from a programming perspective, Access allows tables to hold data and can pull data through multiple tables using primary and foreign keys. More on those later…</p><p><strong>Basically, if you know Access well, you have an advantage in learning Ruby!</strong></p><h4>Ruby and Active Record Associations</h4><p>Active Record is one of the layers mentioned that makes coding in Ruby easier. But how exactly? One of the things active record does is help create <em>associations</em>, or relationships, between tables of data.</p><p><strong>Take this Microsoft Access relationship chart for example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*PxCDjOUHEfZtj1kDZLvVVg.png" /></figure><p>In this scenario, we have <strong>Transactions</strong>, <strong>Orders</strong>, and <strong>Inventory</strong>. The database is set up so that we can access (pun intended) the <strong>Inventory </strong>from <strong>Transactions</strong>. We do this by going through <strong>Orders </strong>to get to it. This could also work reversed if we wanted to access all of the <strong>Transactions </strong>of an item in our <strong>Inventory</strong>. Again, going through <strong>Orders</strong>.</p><h4>Primary and Foreign Keys</h4><p>I’m not going to dive too deep into this, but for simplicity&#39;s sake, primary and foreign keys connect tables in a database by a specific value. In the example above, Order ID is the <strong>primary key</strong> of Transactions and SKU is the <strong>primary key</strong> of Inventory. Those are the values we have chosen to represent that table and to be easily identified in other tables. The <strong>foreign keys</strong> in our “join table” is Order ID and SKU. Think of foreign keys as the bridge from one table to another.</p><h3>So How Does Any of This Relate to Ruby?</h3><p><strong>Ruby has primary and foreign keys which are essential to accessing data.</strong></p><p><strong>Take this Ruby with Active Record example below:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*SMv4W5ziqtkUCVEZsbQIlw.png" /></figure><p>When coding in Ruby with Active Record, creating a table will automatically assign IDs to items in that table. The <strong>primary keys</strong> in the Customer and Movie models are their IDs. The <strong>foreign keys</strong> are held in the Rental model because it is the join table. This is better shown here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*UFG1qlA9IGVilIQr-wkKRA.png" /></figure><h3>Main Takeaway</h3><h4>It finally paid off</h4><p>For all 4 of us out there that have a lot of experience with Microsoft Access and are now learning Ruby, take it slow and absorb. And if you think Ruby is hard to learn and doesn’t seem useful, think about all the times you said that about Access. Now it is finally paying off that you learned Access. There are a ton more similarities between Access and Ruby, but this post just went over the relationships between tables.</p><p><strong>Other topics to cover later:</strong></p><ol><li>Access Queries are Ruby Aggregate Methods</li><li>Access Forms are frontend POST/PATCH requests from Ruby database</li><li>Access Reports are frontend GET requests from Ruby database</li></ol><h3>Happy Coding!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48c6b9981d57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Properly Set Your Path/Directory of Imports for React Apps in VSCode]]></title>
            <link>https://medium.com/@dylancarver14/how-to-properly-set-your-path-directory-of-imports-for-react-apps-in-vscode-8b4707e94bdf?source=rss-94315be0dcc1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b4707e94bdf</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[jsx]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react-jsx]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Dylan Carver]]></dc:creator>
            <pubDate>Fri, 26 Aug 2022 22:04:20 GMT</pubDate>
            <atom:updated>2022-08-27T01:00:09.293Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Example code for imports in React" src="https://cdn-images-1.medium.com/max/586/1*_Ii2VR8CI6ckH4dWHCjSlw.png" /></figure><h4>Disclaimer:</h4><p>I am a software engineer in training and my skills and terminology are not very defined.</p><p>This solution is for an issue I ran into when learning React and found no material when searching for a solution.</p><h3>What Are Imports?</h3><p>Imports are used in React to path components to other components so their functions and other resources are “linked” together. This is useful to separate different areas of your app and condense the amount of code occupying your screen space at a given time. This can only be achieved if you correctly set the path between one file and another.</p><h3>Let VS Code Do It For You!</h3><p>Vs Code has a lovely built-in feature that will autocomplete the path when importing. Follow these steps:</p><ol><li>Have a file already created that you want to import. In our case, we are attempting to link our Header component to the App component.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/1*dxeswqgWl5CSHlCIndCfoQ.png" /></figure><p>Notice that both files are located in the same folder in VS Code. This is best practice to ensure clean and easy-to-find code.</p><p>2. Type “import ” and the first letter of the component you wish to link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dhP4Z9rhiW0XbYw0jvEB7Q.png" /></figure><p>3. Hit Enter or click the Header component in the drop-down list to autocomplete the path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*6KUE194xdsX70Q9NmZ9bwg.png" /></figure><p>It is important to know that the “./” means the file was located in the same folder as the component you are importing to.</p><h4>4. That’s It! All done!</h4><h3>More Information About Import Paths In Vs Code</h3><h4>Moving Files</h4><p>Files can also be moved without fear of having to know the path to your main component. Upon moving a file that was already imported to a component, you should see this message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*oSbIp6OeWz5g1Z02NKKRCg.png" /></figure><p>Then after confirming the move you should see this lovely message:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*kURgYZgUY_dqze7fBqT_Lw.png" /></figure><p>When accepting this change, all other imports of your file will be changed to the correct directory path so you don’t have to go back and adjust it manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*bxZMvBMefKQZ4uYm7Plo7g.png" /></figure><p>Observe the new path is “../Header” instead of “./Header”. This means the path moved one directory (folder) upstream. Theoretically, this could be done more than once. For example “../../../Header”.</p><h3>Conclusion</h3><p>As mentioned before, it is best to keep your components in React in the same folder, but other files could be used as an import that wouldn&#39;t make sense to be kept in the same folder as your React components. For this, it is important to know how files should be correctly linked together to ensure a properly working app. Happy Coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b4707e94bdf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Event listeners bridge the gap between developers and the user.]]></title>
            <link>https://medium.com/@dylancarver14/event-listeners-bridge-the-gap-between-developers-and-the-user-111ab69d33f6?source=rss-94315be0dcc1------2</link>
            <guid isPermaLink="false">https://medium.com/p/111ab69d33f6</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[event-listener]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Dylan Carver]]></dc:creator>
            <pubDate>Thu, 04 Aug 2022 21:29:12 GMT</pubDate>
            <atom:updated>2022-08-04T21:44:28.391Z</atom:updated>
            <content:encoded><![CDATA[<h3>Event Listeners Bridge the Gap Between Developers and the User</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJp3oRfNZCVobI_mjbVsUQ.png" /><figcaption>Credit: <a href="https://www.thatsanegg.com/blog/what%E2%80%99s-the-difference-between-event-handlers-addeventlistener-in-js/">https://www.thatsanegg.com/blog/what%E2%80%99s-the-difference-between-event-handlers-addeventlistener-in-js/</a></figcaption></figure><p>Think about every website you&#39;ve ever gone to. Let’s take Facebook for example. If the user wants information from that website or wants to interact with the features associated with the site, event listeners are there to well…listen! Everything that is typed into, clicked or even hovered over usually has an event listener tied to it to perform a particular function after that action is completed. Users know what they want when they use a website. Developers need to predict how their website is used to keep customers satisfied. Developers are smart, but they can’t predict the future. They can, however, have anything the user will need on their website upon request with event listeners.</p><h3>What Are Event Listeners?</h3><p>Event listeners are functions in JavaScript that use the input of the user and display a result upon the completion of that action being completed. Think of them as that friendly neighbor who always has that cup of sugar anytime you ask. They aren&#39;t asking you if you want the sugar every time you talk to them but will fulfill the request for the sugar when needed. Event listeners hide in elements of a webpage we use every day. Every form we submit to enter our username and password, every click of the mouse to interact with the webpage, and even some that make the website usable on certain devices and browsers are all event listeners. They are everywhere and are needed to make life on the internet faster and easier for all users.</p><h3>Why Do We Need Event Listeners?</h3><p>Let’s imagine someone went to a website that claims to have the best recipes. This person was told by their friend that if they didn’t know what to cook, they should try <em>this </em>website because it has every recipe imaginable. The person takes the advice to find out what they should make for dinner and…BAM! It is one big page with <em>EVERY </em>recipe the site has to offer with a scroll bar so tiny it is hard to grab with the mouse pointer. This is not a productive website. Did the friend of this person lie? No. Every recipe imaginable is readily available. Since this person is hungry and doesn&#39;t have all day to search the infinite list of chicken parmesan, crab cakes, and meatloaf, they will probably just order takeout.</p><h3>How Can Event Listeners Get Us To Our Information Faster?</h3><p>Back to the recipe analogy from above. If the maker of the website would have used event listeners, this whole situation would have been avoided, and that person wouldn&#39;t have gotten heartburn from their takeout jalapeno poppers. Event listeners use the input of users to perform an action. The creators of websites have to predict how their website will be used so the user is fully satisfied with their experience and come back.</p><h4>So what event listeners could we use to get information faster?</h4><p><strong>Form </strong>event listeners could be used for a search bar to narrow down a specific recipe or even a category of food. Forms could also be used to submit your great grandma’s secret lasagna recipe to spite your sister!</p><p><strong>Click </strong>event listeners could be used to display an image of the recipe when the user clicks it.</p><p><strong>Speech </strong>event listeners can read out the recipe to you. Very useful when you are chopping onions with one hand and wiping away tears with the other.</p><h3>What did we learn?</h3><p>Event listeners are functions associated with a website that performs an action when a user interacts with it. They are how websites allow the user to get in and out ASAP while being satisfied enough to come back. I hope the owner of that recipe website takes my advice and uses event listeners!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=111ab69d33f6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>