<?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 Joshua Hawks on Medium]]></title>
        <description><![CDATA[Stories by Joshua Hawks on Medium]]></description>
        <link>https://medium.com/@jdhawks?source=rss-e29a59895f8b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lEngNRAl6COVhW_QFc8DuQ.jpeg</url>
            <title>Stories by Joshua Hawks on Medium</title>
            <link>https://medium.com/@jdhawks?source=rss-e29a59895f8b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 19 May 2026 08:48:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jdhawks/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[Locking Cells in Excel]]></title>
            <link>https://medium.com/@jdhawks/locking-cells-in-excel-652167e1ec01?source=rss-e29a59895f8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/652167e1ec01</guid>
            <dc:creator><![CDATA[Joshua Hawks]]></dc:creator>
            <pubDate>Fri, 26 Aug 2022 21:10:32 GMT</pubDate>
            <atom:updated>2022-08-26T21:11:36.264Z</atom:updated>
            <content:encoded><![CDATA[<p>If it is only the one cell that needs locking, I’d start by selecting the entire worksheet. Once selected, right click and choose FORMAT CELLS:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NBxn2Jpe0TxtwGf0Th_3kg.png" /></figure><p>On the Protection tab, deselect Locked:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*dGPABLkFzFMMUIXOjFy4vg.png" /></figure><p>Select the cell(s) you would like to lock, right click and choose Format Cells:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*-W1rxsLm6SIM5XOA2mI1uQ.png" /></figure><p>On the Protection tab, make sure this is locked:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*HwzQ0pBHuf80Ue7_n-4_Kg.png" /></figure><p>From the Review Tab, select Protect Sheet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4e9WxdcPfJHieefR1xLjg.png" /></figure><p>Here you can add a password:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*_lA4rs_XmXe3e7U5LmKYvQ.png" /></figure><p>Locked cells cannot be edited but unlocked cells can be updated:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*CZ4iXcmEUp4edLe6lvL6Aw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=652167e1ec01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Communicate Effectively with GitHub Projects]]></title>
            <link>https://medium.com/@jdhawks/communicate-effectively-with-github-projects-e3c6750ed184?source=rss-e29a59895f8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3c6750ed184</guid>
            <dc:creator><![CDATA[Joshua Hawks]]></dc:creator>
            <pubDate>Sat, 20 Aug 2022 21:48:16 GMT</pubDate>
            <atom:updated>2022-08-20T21:48:16.574Z</atom:updated>
            <content:encoded><![CDATA[<p>GitHub projects is a great way to communicate with a team as you collaborate. Easily link your issues to a project, read and add comments, assign roles, and update project status all in one place.</p><h3>Step 1. Create a Project Repository and Add Collaborators</h3><p>From the Settings Menu, add your group members so they can access your Group Project Repo by clicking on <strong>Collaborators:</strong></p><figure><img alt="github settings screen" src="https://cdn-images-1.medium.com/max/1024/1*b7WVsgmXrzQcpuAtioHR1g.png" /></figure><p>Add users by searching their GitHub name or email address associated with their account:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/1*2Ake5fatMTp6lTcm3zrF6A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*i5Lf7MMVaDZP8dqRgKxMvw.png" /></figure><h3>Step 2. Create Issues</h3><p>You can create a few issues at this stage so that you can populate your Project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umv4XZQ6IeKrRoizlUHA5w.png" /></figure><h3>Step 3. Create a Project</h3><p>From your <strong>Profile</strong> menu, navigate to “<strong>Your projects</strong>” and create a <strong>New project</strong> by clicking on the green button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*XmQSdiuMYeUvASCKvGyP7Q.png" /></figure><h3>Step 4. Add collaborators to your GitHub Project</h3><p>By clicking on the ellipsis (<strong>…</strong>) in your Project home page, you can select the Settings Menu. From there select <strong>Manage access:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gldBs1y0tYllWy_Pw3OirQ.png" /></figure><h3>Step 5. Import Issues into your Project</h3><p>By clicking on the plus sign, you can opt to import existing issues from your repository:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*q3nV0sJClOFHYOyw8eC9sA.png" /></figure><p>Import any/ all issues you would like to track in your Project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*4PhO00awzWM7W3Pvdr7VhA.png" /></figure><p>Now you can easily track all your issues and update their status by dragging and dropping them on the kanban board:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nWlpKsWUeqrhl_2Ztpu0uA.png" /></figure><h3>Step 6. Create new Issues from your Project!</h3><p>You can draft new Issues from your Project! If you start typing you are able to save a draft issue that you can later assign to your repo:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2xXJTBwdW4Rld6k36OlDmw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3c6750ed184" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[VS Code Extensions I Wish I Knew About Before My Bootcamp]]></title>
            <link>https://medium.com/@jdhawks/10-vs-code-extensions-i-wish-i-knew-about-before-my-bootcamp-a1f1e1183a15?source=rss-e29a59895f8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1f1e1183a15</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[bootcamp]]></category>
            <dc:creator><![CDATA[Joshua Hawks]]></dc:creator>
            <pubDate>Tue, 12 Jul 2022 12:43:27 GMT</pubDate>
            <atom:updated>2023-01-31T17:47:50.557Z</atom:updated>
            <content:encoded><![CDATA[<p>Learning a new skill can be incredibly daunting. Having these tools helped me tremendously but I didn’t know about most of them until half way through my coding bootcamp. Here are some extensions that I use in my set up that you may find useful.</p><h3>Code Spell Checker</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xWGd8ek_NWKIuhuQWDS8Jw.png" /></figure><p>Though it seems simple, this extension has caught more bugs than probably any other tool I use! Your code can’t compile if you typed calss instead of class — Code Spell Checker will catch those little typos by underlining them in VS Code.</p><h3>Auto Rename Tag</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VvfVbQGSKMsvrd0MK20EQQ.png" /></figure><p>If you need to rename an HTML element tag this extension allows you to edit both the opening and closing tags at the same time. It also works with JSX so this extension will come in handy with React as well!</p><h3>Prettier — Code Formatter</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xVdjVyle0D-IDKusq30X9w.png" /></figure><p>Prettier is a code formatter that will parse through your code and leave it more readable. This extension helped me to write cleaner looking code and understand best practices.</p><h3>Live Server</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hUrkFYO5ii9hEDHt1hh87g.png" /></figure><p>Live Server allows you to right click on an html file and open a locally served browser window. The best part is that the connection is live — every time you save your file, those changes are visible in the browser window without needing to refresh.</p><h3>HTML CSS Support</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FOgUmqG1TKw-RByk-PDwRw.png" /></figure><p>This extension offers code completion and other support features for writing HTML/CSS in VS Code — very helpful!</p><h3>JavaScript (ES6) Code Snippets</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cZ9ijt0w_WPdjIk6ahJQ7Q.png" /></figure><p>This extension is incredibly useful when learning JavaScript basics. It will provide code snippets that will improve your workflow.</p><h3>vscode-icons</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9z1TzkTtJUz9fJ8JUajr9g.png" /></figure><p>This extension improves the file icons that appear in your code editor and can be very helpful when searching for specific file types. It helps everything stand out.</p><h3>Simple React Snippets</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XBweuRDUmnnZRw00Rav31A.png" /></figure><p>This extension will come in handy when learning React. I use this extension every day of my professional developer life! It provides commands and snippets to set up React components quickly.</p><h3>GitLens</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*70sA2SF__DaP_HVbX3bv5A.png" /></figure><p>This is a powerful tool especially for collaboration — it will show you information about the the changes to code inside your editor. Super handy to track down commits.</p><h3>Path Intellisense</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bmQ78EUJqVOJ-YmLLnTP-Q.png" /></figure><p>Autocompletion suggestions for file paths. You will do a lot of linking and importing of files within your projects — this extension reduces errors in your path names.</p><h3>Markdown All in One</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wYL_3ayl_8YCgo2WLU8oFg.png" /></figure><p>A large percentage of your grade depends on having a quality README.md — this extension helps with mardown syntax highlighting, keyboard shortcuts, and auto completion.</p><h3>Where To Add Extensions:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j79QWVqm2YyPaxdsxNvlCw.png" /></figure><p>By clicking on the extensions icon (fifth one from the top) you can search extensions in the Market place.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1f1e1183a15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Docker]]></title>
            <link>https://medium.com/@jdhawks/getting-started-with-docker-7a73bc66563d?source=rss-e29a59895f8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a73bc66563d</guid>
            <dc:creator><![CDATA[Joshua Hawks]]></dc:creator>
            <pubDate>Sat, 05 Feb 2022 03:41:05 GMT</pubDate>
            <atom:updated>2022-02-10T15:44:25.517Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*QImUFk6EacvpbRSZZpA80w.jpeg" /></figure><p>What is Docker? Docker is a platform for building, running and shipping applications. A common issue developers run into is that their programs run perfectly in a local environment but doesn’t somewhere else. Missing dependencies, mismatched versions, and differing configuration environments can cause major bugs. This is where Docker really shines.</p><p>Docker enables you to package your application and run it on any other machine that runs Docker! If you have a new team member or are using a different machine, you can be up and running without taking hours to set up a local environment.</p><p>Also, when are done working on a project you can remove the application and all of its dependencies. This definitely helps remove the clutter that inevitably takes up space on your development machines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*tjjljrzbtNQKzAGPKYU4Uw.png" /></figure><p>Docker utilizes Containers to create isolated environments for running applications. Containers are lightweight, allow for the running of multiple applications, and utilize the operating system of the host machine. Unlike virtual machines, containers also start quickly and need far less hardware resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/389/1*Xvysttf8ODXqOEuwbgiMBg.png" /></figure><p><strong>Installing Docker:</strong></p><p>Docker can be downloaded by clicking <a href="https://docs.docker.com/get-docker/">here</a>. There are options for Mac, Windows and Linux. Once downloaded and installed, double click the Docker.app to run the Docker Engine. The whale logo should appear on your status bar (see below, second from left). If it doesn’t, Docker is not running on your machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/1*7ZLxLeXcMHLW8LxM_1SwZA.png" /></figure><p>Check that Docker is working by opening a terminal window and running the following command:</p><pre>docker version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*nk6O4-Tidc5EkjZYdHjZEA.png" /></figure><p>You should see something similar to the output above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*k41ad5biRMFQfdjoc2JiXA.png" /></figure><p>From here, you will need to create a Dockerfile in an application. A Dockerfile is a plain text file that contains instructions needed to run your application. It can include: Operating System, runtime environment (like Node), application files, dependencies and environment variables.</p><p>For illustration, I am going to create a simple JavaScript application in VS Code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*l2QRQhRStdE37tOfkiytPQ.png" /></figure><p>To Docker-ize this simple application we will need to do four things:</p><ol><li>Start with an OS</li><li>Install Node</li><li>Copy the app files</li><li>Run node app.js</li></ol><p>We can easily write these instructions by adding a Dockerfile to the project:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*X8m0xKkHmMm1_UxCPzJrUQ.png" /></figure><p>With these simple instructions, we can now create an image by going to the terminal and typing:</p><pre>docker build -t &lt;application name&gt;</pre><p>Here is a look at the terminal response:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iD9oKDLCs1RimHyEk9kC0Q.png" /></figure><p>You can see a list of all current images by typing the command:</p><pre>docker images</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*iUNOE06cam2Y_L9iEgvUeQ.png" /></figure><p>Now we can run this image on any computer running Docker by entering the command:</p><pre>docker run example</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*J0zXd9ZAOp5scju2-lEQpQ.png" /></figure><p>Our application can now be uploaded to Docker Hub and pulled down to any machine running Docker. Of course this is a very simple example, but having these variables spelled out for larger projects saves valuable time and energy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a73bc66563d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redux Toolkit and RTK Query with React]]></title>
            <link>https://medium.com/@jdhawks/redux-toolkit-and-rtk-query-with-react-js-14e34be65622?source=rss-e29a59895f8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/14e34be65622</guid>
            <dc:creator><![CDATA[Joshua Hawks]]></dc:creator>
            <pubDate>Mon, 27 Dec 2021 07:45:40 GMT</pubDate>
            <atom:updated>2022-01-05T10:15:29.936Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*7R_rC94oDvtOU_kZg2roMQ.jpeg" /></figure><p>After a deep dive into Redux, I was feeling pretty overwhelmed. The boilerplate required to make an API call was daunting. Most docs and sources prompt you to answer the question “Is Redux needed for this project?” Considering the scale of my project, the answer was a resounding no— but I wanted to learn and implement it if I could. Luckily, I came across Redux Toolkit. You can implement Redux Toolkit in a couple of ways:</p><p>You can create a React application from scratch:</p><pre>npx create-react-app <strong><em>my-app</em></strong> --template redux</pre><p>Or add Redux Toolkit to an existing app:</p><pre>npm install @reduxjs/toolkit</pre><p>Redux Toolkit comes with time saving features like:</p><ul><li><a href="https://redux-toolkit.js.org/api/configureStore">configureStore()</a>: wraps createStore to provide simplified configuration options and good defaults. It can automatically combine your slice reducers, adds whatever Redux middleware you supply, includes redux-thunk by default, and enables use of the <a href="https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd?hl=en">Redux DevTools Extension</a>.</li><li><a href="https://redux-toolkit.js.org/api/createSlice">createSlice()</a>: accepts an object of reducer functions, a slice name, and an initial state value, and automatically generates a slice reducer with corresponding action creators and action types.</li></ul><p>In addition to these tools, Redux Toolkit features RTK Query which allows you to create a slice to handle fetch requests. To demonstrate this functionality, I will be creating an API slice that fetches a list of users from <a href="https://jsonplaceholder.typicode.com/users">https://jsonplaceholder.typicode.com/users</a>.</p><p><strong>Step 1 </strong>— Add the Redux packages. CD into the root directory of your project (if it is an existing application) and type the following code into the terminal:</p><pre>npm i <a href="http://twitter.com/reduxjs/toolkit">@reduxjs/toolkit</a> react-redux</pre><p>This will bring in both React-Redux (needed for Step 4) and Redux Toolkit.</p><p><strong>Step 2 </strong>—Create the API slice in a new file (I have named mine usersAPI.js) and import the tools needed from Redux Toolkit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1s2KEV2p0rjoW7IAunS6HQ.png" /></figure><p>Next, write out the API slice using createApi(). CreateApi accepts an object that includes your baseQuery/ baseUrl. Most projects will likely only need one API slice. As you will see, we can specify many endpoints within this same slice. As long as you are only communicating with one server, this will be the only slice you need.</p><p>After the baseQuery is established, you can add your endpoint(s) and export your slice. Whatever you name your endpoint will be concatenated with the word <em>use</em> and <em>Query</em> to become the dispatch for our fetch. As you can see, my users endpoint became <em>useUsersQuery </em>(oof).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cw9_uSj558xBKIsenXcOyA.png" /></figure><p><strong>Step 3</strong> — Create the store by adding a store.js file in your project and import the necessary dependencies:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VlCNIKWUCkPRTTtdXIBdnw.png" /></figure><p>Now we can define our store by calling configureStore as an exported constant. You can add multiple reducers here but so far, we only have the API slice and its reducer to add. Configure Store does a lot for us under the hood — it automatically connects the app to Redux DevTools and it comes with the necessary Thunk middleware that allows us to perform asynchronous functions like fetches. In lines 8 &amp; 9 of the code block, we will specify that we will use the default middleware as well as the API middleware. If you have your own middleware (logger, toast etc) you can also add that here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pxqioxjLw-LT4x-vwJ-UNQ.png" /></figure><p><strong>Step 4 — </strong>Now that the store is created, we need to wrap our application with a Provider Component so that any child component can have access. In your Index.js file, import Provider from ‘react-redux’ and store from our store.js file. The store is passed a prop to all children components.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*Svr5YqyFvOoIYhyJyc7Ltg.png" /></figure><p><strong>Step 5</strong> —We can now dispatch the useUsersQuery in the App.js file to fetch data from our ‘/users’ endpoint. First we will need to import the query at the top of the component:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XNaPmNJOvIuSBXcCnNCcTg.png" /></figure><p>Using destructuring, you can see all of the information that we will get back (along with our data) without having to manually write out catch statements:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Sy5LVGeUoFCupAwmNqqpHA.png" /></figure><p>Here is the completed return block to needed to fetch, deal with potential errors/ loading, and iterate through the data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7VOYxvZtTqbj-NFwFFvo1w.png" /></figure><p>On the front-end the fetch was successful:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*EsrDJ7ji1dQpRvcfnXDxBQ.png" /></figure><p>By using Redux DevTools, we can look under the hood to see what happened during our API call. Under the Action tab we see that the application connected with Redux DevTools, the API call was pending, and finally fulfilled:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*bzC0U_LRmE7Sdm9Ciov3QA.png" /></figure><p>In the State tab, we see the data payload along with status, start/fulfilled timestamps and other information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*TcIIbDDrAvxHmcbGmrY7LQ.png" /></figure><p>RTK Query will also automatically unsubscribe, cache your data, reject unnecessary server calls, and make tons of julienne fries. Ok just kidding about the fries but the rest amazing. If you have been avoiding Redux, I encourage you to check out Redux Toolkit.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14e34be65622" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create Automated Tests in React]]></title>
            <link>https://medium.com/@jdhawks/create-automated-tests-in-react-754be8756f63?source=rss-e29a59895f8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/754be8756f63</guid>
            <dc:creator><![CDATA[Joshua Hawks]]></dc:creator>
            <pubDate>Sat, 25 Dec 2021 19:45:22 GMT</pubDate>
            <atom:updated>2021-12-27T05:04:00.061Z</atom:updated>
            <content:encoded><![CDATA[<p>Being able to test your code is incredibly important. Test Driven Development (TDD) is the process of converting software requirements to test cases before software is fully developed. TDD is a core Agile and DevOps practice that generally follows five steps:</p><p><strong>The TDD flow:</strong></p><ul><li>Read, understand, and process the feature or bug request.</li><li>Translate the requirement by writing a unit test.</li><li>Write and implement the code that fulfills the requirement.</li><li>Clean up your code by refactoring.</li><li>Rinse, lather and repeat.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*sRxbmUyBKDD3-nE71KL3Vw.jpeg" /></figure><h3>Types of Automated Tests:</h3><p><strong>Unit Tests</strong> — Testing the application without its external dependencies (files, databases, web services. Testing of this sort relies on using Mock APIs and resources to run your tests. This allows the Unit Tests to run very fast — as you are refining and refactoring code, you don’t want extra time as you make calls to an external server. You want most of your tests to be in this category because they are the fastest to run.</p><p><strong>Integration Tests </strong>— Test the application along with its external resources. These tests are slower than Unit Tests but will give you more confidence that features are working together. Integration tests will touch more than one React component as it is testing the interconnectivity of your application features. These tests are slower than Unit tests but should still be run during major milestones like implementing new features and getting ready for production.</p><p><strong>End-to-End Tests</strong> — Testing involves launching the application and driving it through its user interface. These tests give developers the most confidence but are also the slowest and most fragile. Developers should be selective about the functions of the application tested with End-to-End tests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*jkOdHY9S1NyV1CbJIeBtgQ.jpeg" /></figure><h3>Setting up the Testing Environment</h3><p>For this blog, we will be creating a few simple Unit Tests using Jest. Jest is an automated testing framework developed by FaceBook built on top of Jasmine.</p><p>First, install Jest in your project:</p><pre>npm i jest @types/jest @babel/core @babel/preset-env babel-jest -D</pre><p>What does all of that code do? First we are installing Jest along with intellisense so we can utilize some handy snippets &amp; autocompletion. Babel allows us to compile our React code into backward compatible code that browsers can understand. By adding -D, we install all of these libraries as development dependencies. If you open your package.json file, these new dependencies will appear there and will not be shipped with the deployed with the application.</p><p>Second, create a new file in your root directory called babel.config.json and add:</p><pre>{</pre><pre>&quot;presets&quot;: [&quot;@babel/preset-env&quot;],</pre><pre>}</pre><p>Next, create your spec file. Usually the test file is namespaced to reflect what we will be testing. For the sake of our example, I will be building a simple math.js module. Therefore, my test file will be named math.spec.js — you can name yours whatever you’d like!</p><p>In my math.js file, I have written a simple function, isEven, that returns a boolean:</p><pre><em>export</em> const isEven = number =&gt; number % 2 === 0;</pre><p>Back in math.spec.js, I can write a simple test to see if my function is behaving like I expect it to:</p><pre><em>//in math.spec.js</em></pre><pre><em>import</em> { isEven } <em>from</em> &quot;./math&quot;;</pre><pre>it(&quot;first test&quot;, ()=&gt; {<br>   const result = isEven(2);<br>   expect(result).toEqual(true);<br>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BabDvhY0FdOrxKALq4makw.png" /></figure><p>In the example above, Jest is providing us quite a few methods: it, expect and toEqual are all coming from Jest. toEqual is a matcher method in Jest. <a href="https://jestjs.io/docs/expect">Here is a link to all the matcher methods offered when using expect.</a> Below, I will add another test and do a better job with name spacing:</p><pre>it(&quot;should return true if given an even number&quot;, () =&gt; {</pre><pre>  const result = isEven(2);</pre><pre>  expect(result).toEqual(true);</pre><pre>});</pre><pre>it(&quot;should return false if given an odd number&quot;, () =&gt; {</pre><pre>  const result = isEven(1);</pre><pre>  expect(result).toEqual(false);</pre><pre>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2wUTF5VeYhCFjVyoa3k7Ww.png" /></figure><p>Now our labels clearly reflect exactly what we are testing! Finally, we can use the describe() function from Jest to group related tests together:</p><pre>describe(&quot;isEven&quot;, () =&gt; {</pre><pre> it(&quot;should return true if given an even number&quot;, () =&gt; {</pre><pre>   const result = isEven(2);</pre><pre>   expect(result).toEqual(true);</pre><pre> });</pre><pre> it(&quot;should return false if given an odd number&quot;, () =&gt; {</pre><pre>   const result = isEven(1);</pre><pre>   expect(result).toEqual(false);</pre><pre> });</pre><pre>});</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oY_6mhBxzRBgnxxM10hTSw.png" /></figure><p>So far we are passing all of our tests! What happens if we fail one of our tests? To illustrate this, I will change my isEven function to something I know will cause my test to fail:</p><pre><em>export</em> const isEven = number =&gt; true</pre><p>Running my tests now show which test failed and the specific line in the testing code that caught the failure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qv0RKMSfPbeMN6fsAxeN2Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*VTgAIELm70KxSG9vr3ITbQ.png" /></figure><p>As you can see, automated testing gives you quick feedback about your code!</p><p>Creating tests along with my application enables me to really think about what I want my code to be able to do on a granular level. By abstracting the intention behind the code, I have a clearer idea of what I need my code to do for the application and user. I hope you write some tests of your own!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=754be8756f63" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting React to Firebase 9]]></title>
            <link>https://medium.com/@jdhawks/setting-up-a-react-app-with-firebase-9-748ed4c6849b?source=rss-e29a59895f8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/748ed4c6849b</guid>
            <dc:creator><![CDATA[Joshua Hawks]]></dc:creator>
            <pubDate>Sun, 19 Dec 2021 19:54:01 GMT</pubDate>
            <atom:updated>2021-12-21T17:30:59.698Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Jt9YVrK1LzsU5L6qvfgW_g.jpeg" /></figure><p>In this blog, I will be walking through the steps necessary to connect Firebase 9 with a React frontend.</p><p>New to Firebase? Firebase is a NoSQL database created by Google. It is completely free and offers several services: real-time databases, authentication, document publishing, hosting, and analytics. Every Google account can access the Firebase Console by going to:</p><p><a href="https://console.firebase.google.com/">https://console.firebase.google.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/327/1*ycFwV6rP3uFT87EEY8ffFg.png" /></figure><h4>Step 1 — Create a new Project in your Firebase Console by clicking on the Add Project Button.</h4><p>You will be prompted to give your project a name:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x55oBwu3q8UItdr4X619SQ.png" /></figure><p>After you have chosen a project name and click continue, you will be be able to create your project. Depending on the scope of your project you can elect to turn Google Analytics on or off. Since I am creating this project for demonstration purposes, I have elected to turn them off.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zq470-LggT-S6ggLU9EWcg.png" /></figure><h4>Step 2 — Linking your project to your React application. Once your project has been created, navigate back to the console. To add Firebase to a web application, select the &lt;/&gt; icon:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29ac5KyzWXpIav85Wc4LxQ.png" /></figure><p>You will need to Register Your app by giving it a nickname — naming convention is completely up to you. You can also elect to set up Firebase Hosting at this stage. If you would like to deploy your app on Firebase, you can do this now or add it later. Deploying to Firebase is incredibly easy, so I chose the optional hosting now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D_1uJqR_rkRJdYMogcqyTg.png" /></figure><p>Back in your console, your project’s waffle menu will now show that you have 1 app currently attached to the project. Click on this icon:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yD5YtLU-vMhG3UBU8gcO8A.png" /></figure><p>A small menu will appear — click the cog to access your configuration specs. Click the cog and scroll down to find your SDK Set up and Configuration. Select the config radial button and copy to bring it into your React Application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VgJk3hoxyGZL3GmjpcKr1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*guWVqOZWZdw3spkyJ_UqPA.png" /></figure><h4>Step 3 — Install and setup Firebase in your React App</h4><p>Back in React, create a config.js file to hold your firebaseConfig constant that you just copied. In your terminal, install Firebase in your project by typing:</p><pre>npm install firebase</pre><p>Firebase 9 has a more modular approach to its features. For our purposes, we will be importing initializeApp (to connect to Firebase) and getFirestore to access our database. I have collapsed my firebaseConfig const for security reasons. Here is what your config.js should look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*dherBxOy6_aMdO53l2Prmw.png" /></figure><h4>Step 4 — Create your data in Firebase/Firestore</h4><p>In your Project dashboard, click on Firestore Database and click on the Create Database button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*op1MeFCqoGqYPpHqvE78BQ.png" /></figure><p>Select test-mode and click next:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*YEavSv1zLSRfLkCEv4K4DQ.png" /></figure><p>Select a server close to your geographic location. YOU CANNOT CHANGE LATER! It will likely default to the closest one to you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*yT5S1ACYQSnOGduj46yJ-A.png" /></figure><p>Click on <strong>+Start Collection </strong>to create your data. Your collections are parallel to a table from a SQL database. You can name your collection and then create your individual records. In this area you can also set up rules for your database as well as Indexes that handle compound queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XGOENKn773Axm1T5C5vgmA.png" /></figure><p>Give your Collection a name and click Next:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*bOVegOXsA7CUXXKGp6idnQ.png" /></figure><p>Add fields (keys), types, and values to your collection and click Save. Firestore can generate ids for you (see below) or you can assign your own. Being NoSQL, Firebase is schemaless. However, that means you need to be consistent with naming conventions and types. Once you click save, it will also create the first document in your collection. To add more documents, click on <strong>+Add document</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*PekFl-cD9m-qRWtnedZBcw.png" /></figure><p>Below, you can see that the books collection now contains three documents that I have created. By clicking on a document, you can see the data in the right column. You can edit the collection, documents and individual data fields at any time by using the Firebase GUI. Now that my collection is populated with a few documents, we will return to React to write the code to query our new collection of book titles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o91zTIUmQeLJiFbSHI29MA.png" /></figure><h4>Step 5 — Fetching our Data in React.</h4><p>In the component that will hold the state for my data, I import the variable that I used to initialize <strong>getFirestore</strong> in my <strong>config.js</strong> file along with <strong>collection</strong> and <strong>getDocs</strong> — both from ‘firebase/firestore’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*jzHNChRh6_11V9tWRCoY8A.png" /></figure><p>The fetch for a Firebase is similar to that of a standard API but with some differences. Instead of listing an HTTP endpoint, you will use the connection through your config.js file to link to your collection.</p><p><strong>First:</strong> Declare a variable to hold a reference to your collection.</p><p><strong>Second:</strong> Use that variable with getDocs to retrieve a snapshot of your collection’s data.</p><p><strong>Third: </strong>Iterate through the data to set it in state.</p><p>I have used a variable (booksRef) to contain a reference to my books collection. Using the getDocs method from Firestore, I am able to access a snapshot object and iterate through it to set my data in state:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*_a1n3aQgD-6iYsuuSgc8WQ.png" /></figure><p>Snapshots were new to me before working with Firebase. A snapshot is an object that contains all the data and metadata from our collection. Here is a console log of the snapshot. You can see that the docs section contains an array of the three books I entered into my collection in step 4.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*kJQ78jXOvffZqRU4oMKQTw.png" /></figure><p>Now that my data is in state, I can pass it on to be rendered in by my components:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*Lh8nw5iA8_QBqT3ecmhj6A.png" /></figure><p>After launching my React App, I can see the data has been successfully fetched and rendered by the components!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*PJn__77vjlBiYRGve5xPdg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=748ed4c6849b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Useful SQL Queries for Data Analysis]]></title>
            <link>https://medium.com/@jdhawks/sql-the-orthopedic-oxford-of-code-cad96cf767c7?source=rss-e29a59895f8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cad96cf767c7</guid>
            <dc:creator><![CDATA[Joshua Hawks]]></dc:creator>
            <pubDate>Wed, 08 Dec 2021 06:01:36 GMT</pubDate>
            <atom:updated>2021-12-14T15:57:22.773Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdr0GHCMyf1ilQu9A0E8gQ.jpeg" /></figure><p>After a brief introduction to SQL, I was perplexed as to why so many companies and data scientists still rely on it after more than 45 years of existence. SQL is far more powerful and exciting than I gave it credit for! Here are 5 fast and powerful queries that allow you to analyze and manipulate your data quickly.</p><p>The following examples were run with MySQL in MySQLWorkBench.</p><ol><li>Arithmetic operators within SQL queries</li></ol><p>You can easily manipulate numeric values while performing a query. In the example below, a discount is being calculated within the query based on a customer’s loyalty points. Using basic arithmetic operators, we can easily manipulate the data to reflect a ($ generous $) discount.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*m4o74L4Bq7yA565h_yHT6w.png" /><figcaption>Calculating a discount based on loyalty points</figcaption></figure><p>2. Running Totals</p><p>Finding a total is a common task in data management and SQL has a great tool built in. By using OVER, we are able to loop through our data and produce a running sum invoice_total.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*3SaxK7OQYvX6azBWJaZ2FA.png" /><figcaption>Running total example</figcaption></figure><p>3. Subtotals and Grand Totals with GROUP BY</p><p>GROUP BY is a great way to organize your data. By adding WITH ROLLUP, we can create subtotals based on our data. Below is a sample of employee data (fictional, of course!). There is a running sum of salaries based on office location that also displays job titles. The null values at the end of each group of office ids reflects subtotals and the final row reflects the grand total of salaries at all locations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*JHUrzSn-yVaXL5T0FZbQww.png" /><figcaption>GROUP BY with ROLLUP</figcaption></figure><p>4. Ranking Data</p><p>Rank allows you to quickly assign a ranking based on a column value. In the example below, we are ranking our products based on price. The RANK() method allows us to iterate over our data and provide an integer rank.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*-cetrzZRfOaF6GxjqjGECw.png" /><figcaption>Ranking data</figcaption></figure><p>5. Creating Functions in SQL</p><p>I was surprised to learn that you can actually create and save custom functions in SQL. The following example shows the creation of a simple function that concatenates first_name and last_name columns into full_name. First, the function set up:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/916/1*x5uOlhJDD_W4sZSu-BGPOA.png" /><figcaption>Create a stored function</figcaption></figure><p>Next, call the function on existing data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*Y4neCa2OgjPCOsiTLogmUg.png" /></figure><p>All of these queries were fast and relatively easy to learn. Sure, its not new and shiny but it still gets the job done!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cad96cf767c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make Fetch(s) Happen]]></title>
            <link>https://medium.com/@jdhawks/make-fetch-s-happen-5022fcc2ddae?source=rss-e29a59895f8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5022fcc2ddae</guid>
            <dc:creator><![CDATA[Joshua Hawks]]></dc:creator>
            <pubDate>Fri, 05 Nov 2021 22:06:53 GMT</pubDate>
            <atom:updated>2023-02-07T19:28:58.393Z</atom:updated>
            <content:encoded><![CDATA[<p>Handling Multiple Fetch Requests in React JS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BUU0aS4cTaXi6zrYjY4CIQ.png" /></figure><p>If you need to call two endpoints at the same time, utilizing Promise.all is a quick and efficient way to make a call and set state without relying on third party packages.</p><p><strong>Step 1.</strong> Import useState and useEffect into your React Component:</p><pre>import { useState, useEffect } from &#39;react&#39;;</pre><p><strong>Step 2.</strong> Inside your functional component, set up whatever state variables you will need to hold your data. You can keep your data sets separate or combine them based on your needs:</p><pre>import { useState, useEffect } from &#39;react&#39;;<br><br>const App = () =&gt; {<br>  <br>  // Data for Users<br>  const [users, setUsers] = useState([]);<br><br>  // Data for Posts<br>  const [posts, setPosts] = useState([]);<br>  <br>  // Or combine them into one state variable<br>  const [combinedData, setCombinedData] = useState([]);</pre><p><strong>Step 3.</strong> Using useEffect and Promise.all, you can now hit multiple endpoints to fetch your data and resolve the corresponding promises. I have name-spaced the responses for clarity:</p><pre>import { useState, useEffect } from &#39;react&#39;;<br><br>const App = () =&gt; {<br>  <br>  // Data for Users<br>  const [users, setUsers] = useState([]);<br><br>  // Data for Posts<br>  const [posts, setPosts] = useState([]);<br>  <br>  // Or combine them into one state variable<br>  const [combinedData, setCombinedData] = useState([]);<br><br>  useEffect(() =&gt; {<br>    Promise.all([<br>      fetch(&#39;https://jsonplaceholder.typicode.com/users&#39;),<br>      fetch(&#39;https://jsonplaceholder.typicode.com/posts&#39;),<br>    ])<br>      .then(([resUsers, resPosts]) =&gt; <br>        Promise.all([resUsers.json(), resPosts.json()])<br>      )<br>      .then(([dataUsers, dataPosts]) =&gt; {<br>        setUsers(dataUsers);<br>        setPosts(dataPosts);<br>        setCombinedData(dataUsers.concat(dataPosts));<br>      });<br>  }, []);</pre><p><strong>Step 4.</strong> A quick console log reveals our double fetch happened! 💁‍♂️:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/1*NuCiTlhB6ES-wsYeqUp5IQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*FwUtPwrT5JatXKQpqOpcjg.png" /></figure><p>We can see the array of 10 Users, 100 Posts, and the Combined Array which includes them both.</p><p>Here is a final version of the App component:</p><pre>import { useState, useEffect } from &#39;react&#39;;<br><br>const App = () =&gt; {<br>  <br>  // Data for Users<br>  const [users, setUsers] = useState([]);<br><br>  // Data for Posts<br>  const [posts, setPosts] = useState([]);<br>  <br>  // Or combine them into one state variable<br>  const [combinedData, setCombinedData] = useState([]);<br><br>  useEffect(() =&gt; {<br>    Promise.all([<br>      fetch(&#39;https://jsonplaceholder.typicode.com/users&#39;),<br>      fetch(&#39;https://jsonplaceholder.typicode.com/posts&#39;),<br>    ])<br>      .then(([resUsers, resPosts]) =&gt; <br>        Promise.all([resUsers.json(), resPosts.json()])<br>      )<br>      .then(([dataUsers, dataPosts]) =&gt; {<br>        setUsers(dataUsers);<br>        setPosts(dataPosts);<br>        setCombinedData(dataUsers.concat(dataPosts));<br>      });<br>  }, []);<br><br>  console.log(users, posts, combinedData);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5022fcc2ddae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grid Your Way to Great Layouts]]></title>
            <link>https://medium.com/@jdhawks/grid-your-way-to-great-layouts-93bef82b7b48?source=rss-e29a59895f8b------2</link>
            <guid isPermaLink="false">https://medium.com/p/93bef82b7b48</guid>
            <category><![CDATA[html]]></category>
            <category><![CDATA[grid-layout]]></category>
            <category><![CDATA[css]]></category>
            <dc:creator><![CDATA[Joshua Hawks]]></dc:creator>
            <pubDate>Mon, 25 Oct 2021 01:43:10 GMT</pubDate>
            <atom:updated>2021-10-25T13:07:50.587Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the biggest challenges I face when creating a website is placing everything where it belongs. This process can feel like herding digital cats but CSS Grids will help you actualize your vision. We will walk through the process by using this simple landing page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/962/1*taMITaugDcm5iNkM1CawQw.png" /></figure><p>Like most websites, it already has a grid-like feel. The first step is visualizing where you naturally see columns and rows occurring in the design. Some sections may span multiple areas — that is ok!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4-1g6ydcW5Rr-KTWyRcULw.png" /></figure><p>We can see that this landing page can be easily broken up into a simple grid with 3 Columns and 3 Rows. Before turning this mockup into code, I like to identify the main areas of the page. This will be directly reflected in our CSS code later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IbuFqrZCa5vt6HDTikuraQ.png" /></figure><p>Now that the grid elements are identified, I will set up the skeleton code in HTML to reflect the elements needed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dJuqMfsuOc-wuejvB0JMOw.png" /></figure><p>Outside the boilerplate, this is all the HTML code needed to get started. Now on to CSS to code our grid attributes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e374XG1klrfMl1iFh3M9Xg.png" /></figure><p>In the HTML, I have given the container element the id tag of <strong>#container</strong>. I will use this identifier to add our CSS attributes. The <strong>display</strong> is <strong>grid</strong>… because… that is what this blog is all about! The <strong>grid-template-columns</strong> setting is <strong>repeat(3, 1fr)</strong> indicating that we will have 3 columns, each taking up an equal fraction of the grid (shorthand for 33.33% 33.33% 33.33%). <strong>Grid-auto-rows</strong> will allow your rows to auto populate as needed — I have included a min of 100px so they will be easy to visualize. <strong>Grid-gap</strong> will put padding between your grid elements but not on the outside perimeter. Next we will define our <strong>grid-template-area</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OXtvSA_nIGkEOKQDacf1jw.png" /></figure><p>This is where the magic happens. Remember our graphic above? We can literally translate that into our code by typing out what that looks like. You don’t have to tab like I have, but it helps me stay organized. The variables you choose are completely up to you. I chose a naming convention that reflects my HTML elements. After those areas are mapped, we can assign them to our HTML elements in CSS by referencing tags, classes or ids.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Jxhb6KjLhHUyzN-OCA8gg.png" /></figure><p>Add some background color and our grid already looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sIzBxYQfSTgQgcgDVkgtiQ.png" /></figure><p>It is very close to our original design, but we can make some adjustments to our grid template area to reflect that “main” and “logo” are actually much larger sections according to our landing page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*flTYVysfR8rWl8UqzrO72A.png" /></figure><p>By adding one more row for “main” and “logo” in our <strong>grid-template-area</strong>, they now span an additional row. I also set the <strong>height</strong> to 100vh (viewport height) so that our grid will fill up the whole page. It looks very similar to our landing page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VI5uGTJU0G8MKACS7Njrkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IbuFqrZCa5vt6HDTikuraQ.png" /></figure><p>Now that these areas are defined, you can use them to easily populate and format your remaining HTML elements. Happy gridding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93bef82b7b48" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>