<?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: Darian Nocera</title>
    <description>The latest articles on DEV Community by Darian Nocera (@darnocer).</description>
    <link>https://dev.to/darnocer</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%2F457309%2Ff837283f-1d5b-49c6-8007-cf59768fe795.png</url>
      <title>DEV Community: Darian Nocera</title>
      <link>https://dev.to/darnocer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/darnocer"/>
    <language>en</language>
    <item>
      <title>How to Find Simple, Personalized Color Palettes</title>
      <dc:creator>Darian Nocera</dc:creator>
      <pubDate>Fri, 08 Jan 2021 15:59:21 +0000</pubDate>
      <link>https://dev.to/darnocer/how-to-find-simple-personalized-color-palettes-4opf</link>
      <guid>https://dev.to/darnocer/how-to-find-simple-personalized-color-palettes-4opf</guid>
      <description>&lt;p&gt;I am honestly not great at picking out color combos that look good together, but at the same time, I do know what I like (lots of blues &amp;amp; greens 😊).&lt;/p&gt;

&lt;p&gt;I came across an awesome tool called &lt;a href="http://khroma.co/"&gt;Khroma&lt;/a&gt; that helps you narrow the color options down.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bGrmGBaM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610067105911/35YYZSNsM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bGrmGBaM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610067105911/35YYZSNsM.png" alt="image.png" width="800" height="2645"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Khroma 🌈
&lt;/h2&gt;

&lt;p&gt;&lt;a href="http://khroma.co/"&gt;Khroma&lt;/a&gt; is an AI tool that helps you find simple, personalized color combinations. By selecting 50 (yes, 50) of your favorite colors, you train Khroma on essentially what you like and don't like. &lt;/p&gt;

&lt;p&gt;After calculating, it produces an infinite scroll of color combinations or palettes tailored to your preferences. &lt;/p&gt;

&lt;p&gt;If you don't like your results, you can always edit your colors. &lt;/p&gt;

&lt;p&gt;You can even select "favorites" of your color combinations and palettes. &lt;/p&gt;

&lt;h3&gt;
  
  
  Features ⭐
&lt;/h3&gt;

&lt;p&gt;In additional to text/background color combos, you can also get recommendation for the following styles: &lt;/p&gt;

&lt;h4&gt;
  
  
  Gradients
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YOlXgLRY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610120689400/WiHe0kV5i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YOlXgLRY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610120689400/WiHe0kV5i.png" alt="image.png" width="800" height="251"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Image Filters
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dnHCnhOZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610120745999/QP1Spmxn-.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dnHCnhOZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610120745999/QP1Spmxn-.png" alt="image.png" width="800" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Palettes
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mt9bzih4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610120819629/BfAdV7OfE.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mt9bzih4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610120819629/BfAdV7OfE.png" alt="image.png" width="800" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Considerations 🤔
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;After generating your infinite scroll, you might be overwhelmed with options. I recommend immediately spending a couple minutes selecting your favorites, and then bookmarking the favorites page to come back to! &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Note Khroma uses local storage rather than relying on logins. You preferences will be saved on only your current browser on your current device. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  ✨ TL;DR: Use &lt;a href="http://khroma.co/"&gt;Khroma&lt;/a&gt; to get simple, personalized color combinations based on your actual color preferences.
&lt;/h4&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;Thanks for reading. Feel free to connect with me on &lt;a href="https://linkedin.com/in/darian-nocera"&gt;LinkedIn&lt;/a&gt;!&lt;/em&gt;
&lt;/h4&gt;

</description>
      <category>design</category>
    </item>
    <item>
      <title>How to Quickly Add a Contact Form to a Static Website</title>
      <dc:creator>Darian Nocera</dc:creator>
      <pubDate>Fri, 08 Jan 2021 15:23:42 +0000</pubDate>
      <link>https://dev.to/darnocer/quickly-configure-a-contact-form-on-a-static-site-4d14</link>
      <guid>https://dev.to/darnocer/quickly-configure-a-contact-form-on-a-static-site-4d14</guid>
      <description>&lt;p&gt;A backend is typically required to handle form requests. So if you want to add a contact form to your serverless static site such as your portfolio or personal website, you'll likely need to use a third party service to handle the requests. There are many services like this, but I recommend using &lt;a href="https://app.99inbound.com" rel="noopener noreferrer"&gt;99inbound&lt;/a&gt;— it's free and easy af. &lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the Account ⚙
&lt;/h2&gt;

&lt;p&gt;Note— When you create an account, use the email you'd like the contact form to send emails to, as you will &lt;strong&gt;not&lt;/strong&gt; be able to change this once your account is created on the free plan. &lt;/p&gt;

&lt;p&gt;You will be taken to your dashboard where you can configure your forms and end points. &lt;/p&gt;

&lt;h2&gt;
  
  
  Forms vs. Form Endpoints 🤔
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Forms
&lt;/h3&gt;

&lt;p&gt;You can create a form directly on 99inbound using their UI. This will provide you with a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; containing your form and a &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; to handle the request. &lt;/p&gt;

&lt;h3&gt;
  
  
  Form Endpoints
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;Form Endpoints allow you to use your own forms but have submissions processed by 99Inbound.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For full customizability, I would recommend just building your own form with HTML/CSS and using the provided Form Endpoint as a POST action for the form. &lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring the Form Endpoint ⚙
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a new end point by clicking the '+' button. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fill out the title and submission text. You can leave the redirect URL blank.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scroll to deploy. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy the endpoint&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Within your form element, paste the endpoint as an &lt;code&gt;action&lt;/code&gt; attribute, with a &lt;code&gt;method&lt;/code&gt; of &lt;code&gt;POST&lt;/code&gt;: &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;

&lt;span class="nt"&gt;&amp;lt;form&lt;/span&gt; &lt;span class="na"&gt;action=&lt;/span&gt;&lt;span class="s"&gt;"ADD_ENDPOINT_HERE"&lt;/span&gt; &lt;span class="na"&gt;method=&lt;/span&gt;&lt;span class="s"&gt;"POST"&lt;/span&gt; &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;When a user submits the form, they will be taken to your submission message. Use &lt;code&gt;target="_blank"&lt;/code&gt; like above to launch this in a new tab. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1610118226990%2F5N-oRxYJq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1610118226990%2F5N-oRxYJq.png" alt="image.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I assume you're already proficient enough with HTML to build forms, but I provided an example below. &lt;/p&gt;

&lt;h3&gt;
  
  
  Building the form 🛠
&lt;/h3&gt;

&lt;p&gt;Creating your own HTML form is especially easy with &lt;a href="https://getbootstrap.com/docs/4.0/components/forms/" rel="noopener noreferrer"&gt;Bootstrap&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here's one built with Bootstrap using FontAwesome icons to get you started:&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/darnocer/embed/mdrKjpv?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Stopping Spam 🚫
&lt;/h3&gt;

&lt;p&gt;It's highly recommended you also include the provided &lt;em&gt;"honeypot field"&lt;/em&gt;. This works as a hidden field to normal users, but is designed to trick spam bots into filling out the "fake" field so that spam can be filtered from your inbox. &lt;/p&gt;

&lt;h2&gt;
  
  
  Testing 🧪
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Add your form to your site / app. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can test your form even in the development environment and verify that an email is sent to the email you signed up with to ensure it's configured correctly. It may take a few moments for the email to go through. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You will also be able to see all of the submitted form entries directly from your dashboard. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  ✨TL;DR: Use free service &lt;a href="https://app.99inbound.com" rel="noopener noreferrer"&gt;99inbound&lt;/a&gt; to create a form endpoint, and add this as the POST action to your HTML form.
&lt;/h4&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;Thanks for reading. Feel free to connect with me on &lt;a href="https://www.linkedin.com/in/darian-nocera/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;!&lt;/em&gt;
&lt;/h4&gt;

</description>
      <category>serverless</category>
    </item>
    <item>
      <title>How to Lazy Load an Embedded Youtube Video</title>
      <dc:creator>Darian Nocera</dc:creator>
      <pubDate>Thu, 17 Dec 2020 19:08:29 +0000</pubDate>
      <link>https://dev.to/darnocer/lazy-loading-responsive-youtube-video-with-image-thumbnail-fake-play-button-7l3</link>
      <guid>https://dev.to/darnocer/lazy-loading-responsive-youtube-video-with-image-thumbnail-fake-play-button-7l3</guid>
      <description>&lt;p&gt;This is an example of how to display the image thumbnail for a Youtube video and only load the video once the user interacts with the video.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/darnocer/embed/YzGVQZO?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic Steps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Grab the Youtube ID from the URL of any Youtube video&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqdlxma88yw92ncgjr7d6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqdlxma88yw92ncgjr7d6.png" alt="Youtube ID in URL"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The image path for the thumbnail is &lt;br&gt;
&lt;code&gt;https://i.ytimg.com/vi/{Youtube ID}/maxresdefault.jpg&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The embed URL for the &lt;code&gt;iframe src&lt;/code&gt; is&lt;br&gt;
&lt;code&gt;https://www.youtube.com/embed/{Youtube ID}?autoplay=1&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Typically you would not want to include &lt;code&gt;?autoplay=1&lt;/code&gt; to autoplay the video because that's annoying af, but in this case, we're loading the video only once the user has already clicked on it to play it&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Using Javascript, swap out the image container with a responsive video container and the iframe with the embed URL&lt;/li&gt;
&lt;/ul&gt;

&lt;h6&gt;
  
  
  Credit to &lt;a href="https://github.com/paulirish/lite-youtube-embed" rel="noopener noreferrer"&gt;this repo&lt;/a&gt; for the idea for the play button css.
&lt;/h6&gt;

</description>
      <category>youtube</category>
      <category>embed</category>
      <category>lazyloading</category>
      <category>javascript</category>
    </item>
    <item>
      <title>If Bob Ross had a modern, responsive, web development portfolio, what would it look like?</title>
      <dc:creator>Darian Nocera</dc:creator>
      <pubDate>Wed, 16 Dec 2020 21:11:57 +0000</pubDate>
      <link>https://dev.to/darnocer/if-bob-ross-had-a-modern-responsive-web-development-portfolio-what-would-it-look-like-a3p</link>
      <guid>https://dev.to/darnocer/if-bob-ross-had-a-modern-responsive-web-development-portfolio-what-would-it-look-like-a3p</guid>
      <description>&lt;p&gt;I wanted to do a project to get more comfortable with Vue.js &amp;amp; Sass, so I designed a developer portfolio template from the ground up. Of course, Bob's works are just a placeholder — it can be used by anyone with coding knowledge that can't be bothered with front-end design. Check it out! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live Demo:&lt;/strong&gt; &lt;a href="https://vue-portfolio-template.netlify.app/"&gt;https://vue-portfolio-template.netlify.app/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Repo:&lt;/strong&gt; &lt;a href="https://github.com/darnocer/vue-portfolio-template"&gt;https://github.com/darnocer/vue-portfolio-template&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vue</category>
    </item>
    <item>
      <title>How to Set Your Project Up With Sass</title>
      <dc:creator>Darian Nocera</dc:creator>
      <pubDate>Mon, 14 Dec 2020 23:35:19 +0000</pubDate>
      <link>https://dev.to/darnocer/how-to-setup-your-project-with-sass-scss-ip4</link>
      <guid>https://dev.to/darnocer/how-to-setup-your-project-with-sass-scss-ip4</guid>
      <description>&lt;p&gt;If you're here, I'm going to assume you already know what &lt;a href="https://sass-lang.com/"&gt;Sass&lt;/a&gt; is and just want to do the damn thing. &lt;/p&gt;

&lt;p&gt;This guide is also specific to the &lt;a href="https://sass-lang.com/documentation/syntax"&gt;&lt;code&gt;.scss&lt;/code&gt; syntax&lt;/a&gt; of Sass. &lt;/p&gt;

&lt;h1&gt;
  
  
  Install Sass 🌎
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;This assumes you already have a &lt;code&gt;package.json&lt;/code&gt; file. If not, run &lt;code&gt;npm init&lt;/code&gt; and enter through for the default values. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run &lt;code&gt;npm install node-sass&lt;/code&gt; to install node-sass&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup Your File Structure ⚙
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In your root directory, create a &lt;code&gt;styles&lt;/code&gt; folder with an &lt;code&gt;scss&lt;/code&gt; folder and a &lt;code&gt;css&lt;/code&gt; folder&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;/sass&lt;/code&gt;, create the file &lt;code&gt;main.scss&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In &lt;code&gt;/css&lt;/code&gt;, create the file &lt;code&gt;style.css&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├─ styles/
│  ├─ sass/
│  │  ├─ main.scss
│  ├─ css/
│  │  ├─ style.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;See Organizing Sass Files section for more details on recommended file structure.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Watch Changes To Sass Files 🔍
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In &lt;code&gt;package.json&lt;/code&gt;, within the &lt;code&gt;"scripts:"&lt;/code&gt; section add &lt;code&gt;"sass": "node-sass sass/main.scss css/style.css -w"&lt;/code&gt; like so:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"sass"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"node-sass styles/sass/main.scss styles/css/style.css -w"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="err"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The watch flag &lt;code&gt;(-w)&lt;/code&gt; tells node-sass to watch the &lt;code&gt;main.scss&lt;/code&gt; file in the &lt;code&gt;styles/sass&lt;/code&gt; directory for changes and output them in &lt;code&gt;style.css&lt;/code&gt; in the styles/css directory. &lt;/p&gt;

&lt;p&gt;This also assumes your &lt;code&gt;styles&lt;/code&gt; folder is in the root directory. You may need to adjust these filepaths if you're using something like React or Vue and have your &lt;code&gt;styles&lt;/code&gt; folder in the &lt;code&gt;src&lt;/code&gt; directory, for example. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;In a terminal instance, run &lt;code&gt;npm run sass&lt;/code&gt; to watch for changes to your .scss files and automatically compile them into css.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Partials 🔸
&lt;/h2&gt;

&lt;p&gt;The &lt;em&gt;only&lt;/em&gt; thing in your &lt;code&gt;main.scss&lt;/code&gt; folder should be imports of your other .scss files, also known as &lt;em&gt;partials&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;All partials begin with an underscore (_).&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create another folder within your &lt;code&gt;/scss&lt;/code&gt; directory such as &lt;code&gt;test&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add an .scss file within the /test directory such as &lt;code&gt;_test.scss&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Import the partial file into your &lt;code&gt;main.scss&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"test/test"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;You do not need to include the underscore or the file extension in the imports.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Test it out 🧪
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In your &lt;code&gt;_test.scss&lt;/code&gt; file, add something like:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="nv"&gt;$red&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// declare a variable&lt;/span&gt;

&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nv"&gt;$red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Save the file. You shouldn't see any errors in the terminal if sass compiled successfully. You should see the h1s on your page update to red. If you go to &lt;code&gt;css/style.css&lt;/code&gt; you should see the compiled css:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If you do not see the color update or the compiled CSS, ensure you have &lt;code&gt;npm run sass&lt;/code&gt; running in a terminal instance. &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Organizing Sass Files 📚
&lt;/h3&gt;

&lt;p&gt;There are many ways to organize your Sass files, and it really comes down to personal preference. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;7-1 Architecture&lt;/strong&gt; is a popular structure for larger projects, although I personally find it a bit overkill for smaller personal projects. &lt;/p&gt;

&lt;p&gt;However, you will thank yourself for having a solid file architecture in place if your project ever grows or scales. &lt;/p&gt;

&lt;p&gt;Here's what I usually start out with, and then add from there:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;├─ styles/
│  ├─ sass/
│  │  ├─ abstract/
│  │  │  ├─ _variables.scss      // variable declarations
│  │  │  ├─ _mixins.scss          // mixin declarations
│  │  ├─ base/
│  │  │  ├─ _base.scss             // &lt;span class="k"&gt;*&lt;/span&gt;, html, body styles / CSS reset
│  │  │  ├─ _typography.scss  // typography-related styles
│  │  ├─ components/             // reusable components styles eg. buttons
│  │  │  ├─ _component1.scss
│  │  │  ├─ _component2.scss
│  │  ├─ layout/                        // layout components styles
│  │  │  ├─ _footer.scss
│  │  │  ├─ _header.scss
│  │  ├─ pages/                        // styles specific to pages 
│  │  │  ├─ _page1.scss
│  │  │  ├─ _page2.scss
│  │  ├─ main.scss
│  ├─ css/
│  │  ├─ style.css
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then your &lt;code&gt;main.scss&lt;/code&gt; file would look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight scss"&gt;&lt;code&gt;&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./abstract/variables"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./abstract/mixins"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./base/base"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./base/typography"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./layout/section"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./layout/header"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./layout/footer"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./pages/page1"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./pages/page2"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./components/component1"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;@import&lt;/span&gt; &lt;span class="s2"&gt;"./components/component2"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  ✨TL;DR: Install &lt;code&gt;node-sass&lt;/code&gt; and use a script to watch for changes in your SCSS files to automatically compile them to CSS.
&lt;/h4&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;Thanks for reading. Feel free to connect with me on &lt;a href="https://linkedin.com/in/darian-nocera/"&gt;LinkedIn&lt;/a&gt;!&lt;/em&gt;
&lt;/h4&gt;

</description>
      <category>sass</category>
    </item>
    <item>
      <title>Essential Design Resources for Developers</title>
      <dc:creator>Darian Nocera</dc:creator>
      <pubDate>Mon, 14 Dec 2020 21:08:05 +0000</pubDate>
      <link>https://dev.to/darnocer/design-resources-the-essentials-4fm6</link>
      <guid>https://dev.to/darnocer/design-resources-the-essentials-4fm6</guid>
      <description>&lt;p&gt;Do you have so many bookmarks that you actually don't use any of them? There are a million free design resources out there. And a million and one resources compiling those resources. If you're overwhelmed by all of the options, then here's some more! 😉 &lt;/p&gt;

&lt;p&gt;These are my personal essentials. &lt;/p&gt;

&lt;h2&gt;
  
  
  Images
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Free Photos and Background Images
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://unsplash.com/"&gt;Unsplash&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Take and Edit Screenshots
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://getgreenshot.org/"&gt;Greenshot&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;TIP: There may be a better way to do this, but I sometimes use this screenshot tool to estimate the size or aspect ratio an image needs to be. I have "Capture Region" configured to use the &lt;code&gt;PrtSc&lt;/code&gt; hot key. You can then select a region and it gives you the dimensions.)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fUApwHxZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610737162832/aFbVWgQ2W.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fUApwHxZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610737162832/aFbVWgQ2W.png" alt="image.png" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Illustrations
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Free Vector Illustrations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://undraw.co/illustrations"&gt;Undraw&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;TIP: You can select the hex code for the illustrations&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GXyCyv72--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610736735729/1GCuvZlTR.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GXyCyv72--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610736735729/1GCuvZlTR.png" alt="image.png" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  More Free Ilustrations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.drawkit.io/"&gt;DrawKit&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Icons
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Free .svg Icons of Popular Brands
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.simpleicons.com/"&gt;SimpleIcons&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1srHTV4E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610736941807/TzfmIXryp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1srHTV4E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610736941807/TzfmIXryp.png" alt="image.png" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Free Vector Font Icons
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://fontawesome.com/"&gt;Font Awesome&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Fonts
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Heading &amp;amp; Body Fonts That Look Good Together
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://fontpair.co/"&gt;FontPair&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Identify a Font
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.myfonts.com/WhatTheFont/"&gt;What The Font&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Colors
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Simple, Flat Color Palettes
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://flatuicolors.com/"&gt;Flat UI Colors&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Generate a Color Palette From an Image
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.canva.com/colors/color-palette-generator/"&gt;Canva Color Palette Generator&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Generate the CSS for Gradients
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://uigradients.com/"&gt;UI Gradients&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Identify HTML Hex Codes of a Pixel Anywhere
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://instant-eyedropper.com/"&gt;Instant Eyedropper&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Js-MSsLN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610736894390/Sk7K3yej8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Js-MSsLN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1610736894390/Sk7K3yej8.png" alt="image.png" width="485" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;TIP: Once downloaded, setup your hotkeys. I like to use &lt;code&gt;Alt+Q&lt;/code&gt; to easily bring up the eyedropper.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h4&gt;
  
  
  &lt;em&gt;Thanks for reading. I hope these are helpful for you! Feel free to connect with me on &lt;a href="https://linkedin.com/in/darian-nocera"&gt;LinkedIn&lt;/a&gt;!&lt;/em&gt;
&lt;/h4&gt;

</description>
      <category>design</category>
    </item>
    <item>
      <title>React Basics For Beginners</title>
      <dc:creator>Darian Nocera</dc:creator>
      <pubDate>Fri, 09 Oct 2020 16:09:15 +0000</pubDate>
      <link>https://dev.to/darnocer/getting-familiar-with-react-18ao</link>
      <guid>https://dev.to/darnocer/getting-familiar-with-react-18ao</guid>
      <description>&lt;p&gt;&lt;a href="https://reactjs.org/"&gt;&lt;strong&gt;React&lt;/strong&gt;&lt;/a&gt; is a powerful, component-based JavaScript library that allows efficient building of large applications with rapidly changing data.&lt;/p&gt;

&lt;p&gt;There's a ton to learn with React, but here's some of the basics to get you familiar with the framework. &lt;/p&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Benefits&lt;/li&gt;
&lt;li&gt;Basics&lt;/li&gt;
&lt;li&gt;JSX&lt;/li&gt;
&lt;li&gt;Components&lt;/li&gt;
&lt;li&gt;Props&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Benefits
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Virtual DOM
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;React is efficient because it employs the use of a &lt;strong&gt;Virtual DOM&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Typical DOM manipulation is slow and inefficient as it requires rebuilding of the entire DOM for each update (for instance, if you have a list of 10 items, update one item, it updates the entire list rather than only that item).&lt;/li&gt;
&lt;li&gt;A Virtual DOM, however, acts as a lightweight representation of the real DOM.&lt;/li&gt;
&lt;li&gt;All updates are instead made to the Virtual DOM, which then compares to a snapshot of the Virtual DOM prior to the update, in a process called "diffing". Through diffing, React can know exactly which DOM objects have changed, and then update &lt;em&gt;only those objects&lt;/em&gt; on the real DOM, which in turn updates the user interface.&lt;/li&gt;
&lt;li&gt;This greatly increases the speed of processing large data changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Other Functionality
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Webpack&lt;/strong&gt; functionality is taken care of by default with React. Webpack functionality is essentially used to minify and then bundle Javascript files together to allow the application to load more efficiently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Babel&lt;/strong&gt; functionality is also built in with React, which allows Javascript to be written in ES6, ES7, or ES8 and converts it to ES5 which all modern browsers can understand.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Basics
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;To create a React application, run &lt;code&gt;npx create-react-app my-app-name&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;npx&lt;/code&gt; is not a typo. It is a package runner tool that comes with &lt;code&gt;npm&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;There is no need for a &lt;code&gt;server.js&lt;/code&gt; file with React. Instead, run &lt;code&gt;npm start&lt;/code&gt; to start the application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Nearly the entirity of the code is written within the &lt;code&gt;/src&lt;/code&gt; directory (with the exception of adding fonts and other CDNs such as Bootstrap or jQuery to the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag in &lt;code&gt;index.html&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Rendering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;/public/index.html&lt;/code&gt; contains only one line of native HTML: &lt;code&gt;&amp;lt;div id="root"&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;. The entire virtual DOM is rendered in this element.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;This is done in &lt;code&gt;index.js&lt;/code&gt; employing &lt;code&gt;ReactDOM.render()&lt;/code&gt;, which is considered the &lt;em&gt;entry point&lt;/em&gt;:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ReactDOM.render(
    // What to render
    &amp;lt;App /&amp;gt;,
    // Where to render it
    document.getELementbyId("root")
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;App /&amp;gt;&lt;/code&gt; refers to &lt;code&gt;App.js&lt;/code&gt;. This is where you can begin building the app with your components.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  JSX
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JSX&lt;/strong&gt; (JavaScript XML) is a syntax extension to JavaScript which allows us to essentially write and visualize HTML in JS.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;JSX is not specific to React, or required in React, but it makes things a lot easier. It is using &lt;code&gt;React.createElement()&lt;/code&gt; behind the scenes.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;JavaScript expressions are written in &lt;code&gt;{}&lt;/code&gt;. With the exception of &lt;code&gt;if/else&lt;/code&gt;, &lt;code&gt;switch statements&lt;/code&gt;, and &lt;code&gt;for loops&lt;/code&gt; that must be written in methods in class-based components, or using "hooks" (advanced concept). &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Class" is a reserved keyword in JavaScript. All instances of the "class" property must be updated to &lt;code&gt;className&lt;/code&gt; in JSX.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Any self-closing tags in HTML (such as &lt;code&gt;&amp;lt;img&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;lt;input&amp;gt;&lt;/code&gt;) need to be updated to a closing tag in JSX: &lt;code&gt;&amp;lt;tag / &amp;gt;&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Comments in JSX can be written as &lt;code&gt;{/* comment here */}&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Only one element can be returned by &lt;code&gt;return()&lt;/code&gt; at a time. Can wrap in an empty &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; container or use a &lt;em&gt;fragment&lt;/em&gt; &lt;code&gt;&amp;lt;&amp;gt;&lt;/code&gt; that will not add bloat to the DOM.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Inline Styling in JSX
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Style property must be an object rather than a string like in HTML&lt;/li&gt;
&lt;li&gt;All property names are camelCase, and values are strings&lt;/li&gt;
&lt;li&gt;Numbers default to "pixels" (eg. height, margin, padding, etc.)&lt;/li&gt;
&lt;li&gt;Styles are passed in as a prop&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Exmaple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const styles = {
  card: {
    margin: 20,
    background: "#e8eaf6"
  },
  heading: {
    background: "#9a74db",
    minHeight: 50,
    lineHeight: 3.5,
    fontSize: "1.2rem",
    color: "white",
    padding: "0 20px"
  }
};

function Navbar() {
  return (
    &amp;lt;div style={styles.card}&amp;gt;
      &amp;lt;div style={styles.heading}&amp;gt;Home&amp;lt;/div&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Components
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Components are essentially reusable functions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Each component must import react:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from "react"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Each component must include &lt;code&gt;export default componentName&lt;/code&gt; to be used in other components, similar to the concept of &lt;code&gt;module.exports()&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;There are two ways to write functions in components:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Functional Components&lt;/strong&gt; - these are just plain JavaScript functions and are &lt;em&gt;stateless&lt;/em&gt; (unless you're using "hooks" which I don't cover here). They are easier to read and test than their Class counterparts and require less code.&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Typically functions native to React are written with regular functions:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function componentName(){
    return ( JSX here );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Otherwise, functions should be written as arrow functions:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const componentName = () =&amp;gt; {
    return ( JSX here );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Arrow functions are important due to the scope of &lt;code&gt;this&lt;/code&gt;: In this case, &lt;code&gt;this&lt;/code&gt; is not restricted to the scope of the function itself but rather belongs to the outside object.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Class Components&lt;/strong&gt; - The below is identical to the above functional components. However, Classes allow the use of &lt;code&gt;setState()&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class componentName extends React.Component {
    render() {
        ( JSX Here )
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Props
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Props&lt;/strong&gt; are like inputs into components which are like functions, allowing you to pass data from component to component. &lt;/li&gt;
&lt;li&gt;Props can be an arbitrary property name passed into the component:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;componentName propertyName=value /&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The value can be accessed in the component via the props object:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function componentName(props) {
return(
   &amp;lt;div&amp;gt;
      &amp;lt;span&amp;gt;{props.propertyName}&amp;lt;/span&amp;gt;
   &amp;lt;/div&amp;gt;
 )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Props pass data from component to component in &lt;em&gt;unidirectional&lt;/em&gt; flow (parent &amp;gt; child)&lt;/li&gt;
&lt;li&gt;Props can be passed through to more child components in a process called &lt;strong&gt;props drilling&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;There are many more advanced concepts for using React like State, Hooks, Context, and more. These are just the basics to get you started!&lt;/p&gt;

</description>
      <category>react</category>
    </item>
    <item>
      <title>Tips for Successful Heroku Deployments</title>
      <dc:creator>Darian Nocera</dc:creator>
      <pubDate>Sun, 23 Aug 2020 22:51:36 +0000</pubDate>
      <link>https://dev.to/darnocer/heroku-deployment-tips-3lii</link>
      <guid>https://dev.to/darnocer/heroku-deployment-tips-3lii</guid>
      <description>&lt;p&gt;Deploying to Heroku can be tricky. Here are some tips to get your deployed application working!&lt;/p&gt;




&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Deployment&lt;/li&gt;
&lt;li&gt;OAuth&lt;/li&gt;
&lt;li&gt;JawsDB for MySQL&lt;/li&gt;
&lt;li&gt;MongoDB Atlas for MongoDB&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Deployment
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Creating a Heroku app using the GUI&lt;/em&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to your Heroku account&lt;/li&gt;
&lt;li&gt;Click New &amp;gt; Create new app and enter a name for the app&lt;/li&gt;
&lt;li&gt;Under Deploy &amp;gt; Deployment Method &amp;gt; Select Github&lt;/li&gt;
&lt;li&gt;Enter the Github repo name and connect&lt;/li&gt;
&lt;li&gt;Enable Automatic deploys to automatically update Heroku with updates to master (otherwise need to use &lt;code&gt;git push heroku master&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Navigate to your repo in the terminal&lt;/li&gt;
&lt;li&gt;View remotes, there should be no heroku remotes yet, just origin from github: &lt;code&gt;git remote -v&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a remote for your app: &lt;code&gt;heroku git:remote -a [heroku app name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Verify you see a heroku remote; &lt;code&gt;git remote -v&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  OAuth
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Add the &lt;code&gt;clientID&lt;/code&gt; and &lt;code&gt;clientSecret&lt;/code&gt; as keys with the corresponding values in Config Vars on Heroku&lt;/li&gt;
&lt;li&gt;In the OAuth app, add the Heroku URL as the Homepage and Callback URL&lt;/li&gt;
&lt;li&gt;Ensure the passport routes to &lt;code&gt;/&lt;/code&gt; as the homepage. Redirect to the authentication path if necessary
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.get("/", passport.authenticate("github"), function (req, res) {
  res.redirect("/auth/github");
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Setup for &lt;code&gt;clientID&lt;/code&gt; and &lt;code&gt;clientSecret&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    {
      clientID: process.env.clientID,
      clientSecret: process.env.clientSecret,
      callbackURL: "/auth/github/callback",
    },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Options for testing locally with OAuth
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;After changes made to deploy to Heroku&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;In server.js, update &lt;code&gt;clientID&lt;/code&gt; and &lt;code&gt;clientSecret&lt;/code&gt; to be hardcoded string values; return to &lt;code&gt;process.env.clientID&lt;/code&gt; and &lt;code&gt;process.env.clientSecret&lt;/code&gt; prior to pushing changes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create a new OAuth app and configure for &lt;code&gt;localhost&lt;/code&gt;. Setup the &lt;code&gt;clientID&lt;/code&gt; and &lt;code&gt;clientSecret&lt;/code&gt; to use &lt;code&gt;process.env&lt;/code&gt; on Heroku, but the localhost configured app otherwise:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;clientID: process.env.clientID || [new_locahost_clientID_here],
clientSecret: process.env.clientSecret || [new_localhost_clientSecret_here],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a &lt;code&gt;.env&lt;/code&gt; file, add &lt;code&gt;clientID="{clientID}"&lt;/code&gt; and &lt;code&gt;clientSecret="{clientSecret}"&lt;/code&gt;. Be sure to add &lt;code&gt;.env&lt;/code&gt; to &lt;code&gt;.gitignore&lt;/code&gt;. &lt;code&gt;npm i dotenv&lt;/code&gt;and follow &lt;code&gt;dotenv&lt;/code&gt; setup instructions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  JawsDB for MySQL
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;From the Overview tab on the Heroku app, select "Configure Add-ons"&lt;/li&gt;
&lt;li&gt;Search for JawsDB MySQL and attach the add-on&lt;/li&gt;
&lt;li&gt;Click the JawsDB link for connection info&lt;/li&gt;
&lt;li&gt;Go to MySQL Workbench to setup a new connection&lt;/li&gt;
&lt;li&gt;Enter the host, username, and password info and test the connection (ensure you don't accidentally paste extra spaces)&lt;/li&gt;
&lt;li&gt;Open the connection and if it was successful, you should see a sole database that is a string of gibberish (don't rename)&lt;/li&gt;
&lt;li&gt;No need to create tables as that will created via Sequelize&lt;/li&gt;
&lt;li&gt;In Heroku, go to Settings &amp;gt; Config Vars &amp;gt; Reveal Config Vars&lt;/li&gt;
&lt;li&gt;Verify there is a config var for JAWSDB_URL with the URL value&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;config.json&lt;/code&gt;, configure the "production" property as follows:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"production": {
    "dialect": "mysql",
    "use_env_variable": "JAWSDB_URL"
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  mLab for MongoDB / Mongoose
&lt;/h2&gt;

&lt;p&gt;_mLab is now depreciated. Use MongoDB Atlas (below) instead.  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Run this command to provision mLab to the app:
&lt;code&gt;heroku addons:create mongolab&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Navigate to Heroku app and verify the mLab add-on is provisioned&lt;/li&gt;
&lt;li&gt;Navigate to Settings &amp;gt; Config vars and verify there is a &lt;code&gt;MONGODB_URL&lt;/code&gt; config variable&lt;/li&gt;
&lt;li&gt;Ensure &lt;code&gt;mongoose&lt;/code&gt; is required in &lt;code&gt;server.js&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Update Mongoose connection in &lt;code&gt;server.js&lt;/code&gt; to be the following:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var MONGODB_URI = process.env.MONGODB_URI || "mongodb://localhost/db_name";
const options = {
  useNewUrlParser: true,
  useCreateIndex: true,
  useFindAndModify: false,
};

mongoose.connect(MONGODB_URI,options)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  MongoDB Atlas for MongoDB
&lt;/h2&gt;

&lt;h3&gt;
  
  
  MongoDB Atlas Account
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Create your &lt;a href="https://www.mongodb.com/cloud/atlas/signup"&gt;MongoDB Atlas&lt;/a&gt; account&lt;/li&gt;
&lt;li&gt;Create a new "cluster"&lt;/li&gt;
&lt;li&gt;Select the free tier&lt;/li&gt;
&lt;li&gt;Can use any provider - such as AWS&lt;/li&gt;
&lt;li&gt;Choose the server in the region in the free tier closest to you&lt;/li&gt;
&lt;li&gt;After creating the cluster, in the cluster, go to Security &amp;gt; Database Access&lt;/li&gt;
&lt;li&gt;+Add new database user&lt;/li&gt;
&lt;li&gt;Add username/password &lt;/li&gt;
&lt;li&gt;Change privileges to Atlas Admin&lt;/li&gt;
&lt;li&gt;Go to Security &amp;gt; Network Access&lt;/li&gt;
&lt;li&gt;Go to Add IP Address and select Allow Access from Anywhere&lt;/li&gt;
&lt;li&gt;Go to Clusters &amp;gt; Collections &amp;gt; Add My Own Data&lt;/li&gt;
&lt;li&gt;Add your database name and one collection name (only need to add one to get started even if you have multiple collections since they will be created by Mongoose)&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Connecting MongoDB Atlas to Heroku
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Click the Connect button in your cluster&lt;/li&gt;
&lt;li&gt;Select Connect Your Application and choose Heorku&lt;/li&gt;
&lt;li&gt;Copy the string&lt;/li&gt;
&lt;li&gt;Go to your app in Heroku &amp;gt; Settings &amp;gt; Config Vars&lt;/li&gt;
&lt;li&gt;Enter MONGODB_URI in the key&lt;/li&gt;
&lt;li&gt;For the value, paste the string you copied from MongoDB Atlas&lt;/li&gt;
&lt;li&gt;Update the username/password and database name in the string to match what you created in the MongoDB Atlas Setup&lt;/li&gt;
&lt;li&gt;Ensure you look to MONGODB_URI in you Mongoose connection (likely in server.js)
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongoose.connect(
  process.env.MONGODB_URI || "mongodb://localhost/databasename",
  {
    useUnifiedTopology: true,
    useNewUrlParser: true,
    useCreateIndex: true,
    useFindAndModify: false,
  }
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>heroku</category>
      <category>deployment</category>
      <category>oauth</category>
      <category>mongodb</category>
    </item>
  </channel>
</rss>
