<?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 Daniel Patnode on Medium]]></title>
        <description><![CDATA[Stories by Daniel Patnode on Medium]]></description>
        <link>https://medium.com/@danielpatnode?source=rss-a773d20eccf8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0turVfplKTCdH4aAJJygFA.png</url>
            <title>Stories by Daniel Patnode on Medium</title>
            <link>https://medium.com/@danielpatnode?source=rss-a773d20eccf8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 01:44:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@danielpatnode/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[Behavioral Driven Development and Test Driven Development in Chai.js]]></title>
            <link>https://danielpatnode.medium.com/behavioral-driven-development-and-test-driven-development-in-chai-js-a5159e7e768d?source=rss-a773d20eccf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5159e7e768d</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[chai]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[bdd]]></category>
            <dc:creator><![CDATA[Daniel Patnode]]></dc:creator>
            <pubDate>Fri, 22 Jan 2021 20:26:07 GMT</pubDate>
            <atom:updated>2021-01-26T18:31:42.334Z</atom:updated>
            <content:encoded><![CDATA[<h3>Behavioral Driven Development and Test Driven Development utilizing Chai.js</h3><p>Writing quality tests ensures that code will respond in the way that it was intended to. The process of writing tests keeps projects on track and ensures that quality code is produced, with the expected outcomes being the end result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/0*mrG9aYTGi9j0sTnY" /></figure><p><strong>Test Driven Development (TDD) vs Behavioral Driven Development (BDD)</strong></p><p>There are two common trains of thought when it comes to writing tests: behavioral driven development (BDD), and test driven development(TDD). When implementing TDD, automated test cases are built at the beginning of a project and tested against code features that are available (since this is written before anything is built, there aren’t any features written). Inevitably, because theres no code to test against, the tests will fail. Code is then written to satisfy the test’s requirements ran against the built out tests until they pass and refactored for optimization after that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wkLyVRuE67Wml06Q" /><figcaption>Test Driven Development Cycle</figcaption></figure><p>BDD styled testing, takes into consideration the end users’ behavior before writing any code or tests — meaning that an end product is already established before any test code is written. This is typically written out in plain English (think user stories) and is easier for larger teams, that include more than just devs, to understand. This plain English is then converted to scripts that are ran against code. From here, the process is much the same as TDD, in that the code fails initially because no code has been written. Code is then written, tested, and checked against the scripts written until it passes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/0*GjItwc9l6ONvX23E" /><figcaption>Behavioral Driven Development Cycle</figcaption></figure><p>At the base level, BDD defines the behavior of an application in relation to the end user, while TDD focuses on execution of functionality.</p><p><strong>What is Chai?</strong></p><p>Chai is an assertion library (tool to verify that things are correct) that can be used with any Javascript testing <a href="https://www.browserstack.com/guide/top-javascript-testing-frameworks">framework</a>. Chai provides syntax/style for both TDD and BDD that is pretty straightforward to get started with.</p><p><strong>BDD</strong> <strong>with Chai assert library Syntax (expect and should)</strong></p><p>BDD-styled testing in Chai chains together understandable English to write tests that are extremely easy to jump in and understand. They come in two forms: expect and should.</p><pre>//<em>EXPECT STYLING/SYNTAX</em></pre><pre>let expect <strong>=</strong> require(‘chai’).expect,<br>    foo <strong>=</strong> ‘bar’,<br>    beverages <strong>=</strong> { tea: [ ‘chai’, ‘matcha’, ‘oolong’ ] };</pre><pre>expect(foo).to.be.a(‘string’);</pre><pre>expect(foo).to.equal(‘bar’);</pre><pre>expect(foo).to.have.lengthOf(3);</pre><pre>expect(beverages).to.have.property(‘tea’).<strong>with</strong>.lengthOf(3);</pre><pre>//<em>SHOULD STYLING/SYNTAX</em></pre><pre>let should <strong>=</strong> require(‘chai’).should() <em>//actually call the function</em>,<br>    foo <strong>=</strong> ‘bar’,<br>    beverages <strong>=</strong> { tea: [ ‘chai’, ‘matcha’, ‘oolong’ ] };</pre><pre>foo.should.be.a(‘string’);</pre><pre>foo.should.equal(‘bar’);</pre><pre>foo.should.have.lengthOf(3);</pre><pre>beverages.should.have.property(‘tea’).<strong>with</strong>.lengthOf(3);</pre><p>As you can see, expect and should styling are very readable and explicit in what each test’s expectations are. With this knowledge, writing concise, readable and understandable testing becomes easier to maintain. Take a look at the documentation on writing more BDD style testing <a href="https://www.chaijs.com/api/bdd/">here</a>.</p><p><strong>Chai assert library style</strong></p><pre>// <em>ASSERT STYLING/SYNTAX</em></pre><pre>let assert <strong>=</strong> require(‘chai’).assert,<br>   foo <strong>=</strong> ‘bar’,<br>   beverages <strong>=</strong> { tea: [ ‘chai’, ‘matcha’, ‘oolong’ ] };</pre><pre>assert.typeOf(foo, ‘string’); <em>// without optional message</em></pre><pre>assert.typeOf(foo, ‘string’, ‘foo is a string’); <em>// with optional message</em></pre><pre>assert.equal(foo, ‘bar’, ‘foo equal `bar`’); assert.lengthOf(foo, 3, ‘foo`s value has a length of 3’);</pre><pre>assert.lengthOf(beverages.tea, 3, ‘beverages has 3 types of tea’);</pre><p>This testing doesn’t lend the same amount of readability that the expect and should styles do, making it a bit more difficult to hop in. Check out more on assert styling <a href="https://www.chaijs.com/api/assert/">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5159e7e768d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSS vs. SASS vs. SCSS]]></title>
            <link>https://danielpatnode.medium.com/css-vs-sass-vs-scss-e67de26a761?source=rss-a773d20eccf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/e67de26a761</guid>
            <category><![CDATA[scss]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[styling]]></category>
            <category><![CDATA[sass]]></category>
            <dc:creator><![CDATA[Daniel Patnode]]></dc:creator>
            <pubDate>Thu, 14 Jan 2021 19:00:51 GMT</pubDate>
            <atom:updated>2021-01-22T18:32:28.381Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/730/0*Xf4js_q6ZQI7e3J0" /></figure><p>When making the decision about what technology to style your application with, going with one that implements improved readability, while not venturing too far off from already known syntax is both highly appealing and desirable. <strong>SCSS</strong> (Sassy CSS) does just that, taking improvements made by <strong>SASS</strong> (Syntactically Awesome Style Sheets), while pairing down the dissimilarities syntactically from vanilla CSS — making the transition from vanilla CSS to SCSS extremely easy and worthwhile.</p><p><strong>Benefits of SCSS syntax over SASS and CSS</strong></p><p><strong><em>Similarity to Vanilla CSS</em></strong><em><br></em>SCSS is written virtually identically, syntax-wise, to vanilla CSS. In both CSS and SCSS, selectors (pseudo, class or id) followed by curly brackets (that wrap the entirety of the styling), with semicolons denoting the end of styling (within the curly brackets), make up the conventional syntax. This is different from SASS, which opts for newlines to represent the end of styling and doesn’t use curly brackets at all.</p><pre>////////<br>//SCSS//<br>////////</pre><pre>.button {<br>   cursor: pointer;<br>   color: red;<br> }</pre><pre>////////<br>//SASS//<br>////////</pre><pre>.button<br>  cursor: pointer<br>  color: red</pre><pre>///////<br>//CSS//<br>///////</pre><pre>.button {<br>   cursor: pointer;<br>   color: red;<br> }<br></pre><p><strong><em>Compatibly (SCSS and CSS)</em></strong><em><br></em>This similarity also means that anything written in vanilla CSS is transferable to SCSS (but not to SASS). That being said, you lose out on a lot of improvements that SCSS and SASS bring to the table, using only vanilla CSS, such as…</p><p><strong><em>Variables</em></strong><em><br></em>The ability to assign variables used throughout styling, allows devs to create custom attributes that can be used over and over again without having to copy attributes such as color, margin, padding etc. …:</p><pre>////////<br>//SCSS//<br>////////</pre><pre>//variable being assigned<br>   $blurple: #6200ff;</pre><pre>//variable being used<br>   .content-navigation {<br>      border-color: $blurple;<br>    }</pre><pre>////////<br>//SASS//<br>////////</pre><pre>//variable being assigned<br>   $blurple:#6200ff</pre><pre>//variable being used<br>  .content-navigation <br>      border-color: $blurple;<br>    <br>///////<br>//CSS//<br>///////</pre><pre>//variables aren&#39;t a feature of vanilla CSS so custom color has to be assigned each time<br>     .content-navigation {<br>      border-color: #6200ff;<br>    }</pre><p><strong><em>Nested Syntax</em></strong><em><br></em>Nested Syntax allows for more natural, maintainable, readable, organized, and overall DRYer code. Plus, it’ll save your fingers not having to write CSS selectors nearly as often.</p><pre>////////<br>//SCSS//<br>////////</pre><pre>.button {<br>   cursor: pointer;<br>   color: red;<br>   padding-left: 5px;<br>   padding-right: 10px;<br> }<br> .button:hover{<br>   cursor:pointer;<br>  color: tomato;<br> }</pre><pre>////////<br>//SASS//<br>////////</pre><pre>.button<br>  cursor: pointer<br>  color: red<br>  padding-left: 5px<br>  padding-right: 10px</pre><pre>&amp;:hover<br>    cursor: pointer<br>    color: tomato</pre><pre>///////<br>//CSS//<br>///////</pre><pre>.button {<br>   cursor: pointer;<br>   color: red;<br>   padding-left: 5px;<br>   padding-right: 10px;<br> }<br> .button:hover{<br>   cursor:pointer;<br>  color: tomato;<br> }</pre><p><strong><em>Math Support</em></strong><em><br></em>Setting proportions according to mathematical equations is much simpler in SCSS. With built in math support you no longer have to remember the calc function. Simply add the equation, like so:</p><pre>////////<br>//SCSS//<br>////////</pre><pre>.cool-div { <br>    width: 600px <strong>/</strong> 960px <strong>*</strong> 100%;<br>}</pre><pre>////////<br>//SASS//<br>////////</pre><pre>.cool-div<br>   width: 600px <strong>/</strong> 960px <strong>*</strong> 100%</pre><pre>///////<br>//CSS//<br>///////</pre><pre>.cool-div { <br>    width: calc(600px <strong>/</strong> 960px <strong>*</strong> 100%);<br>}</pre><p>These improvements allow for easier development and cleaner overall code. Add in the ability to do things like write <a href="https://www.w3schools.com/sass/sass_mixin_include.asp">reusable styling segments</a> , <a href="https://sass-lang.com/documentation/at-rules/extend">share CSS properties</a> between different selectors, and create <a href="https://sass-lang.com/documentation/at-rules/function">custom functions</a>, and you have the recipe to to a super powerful and effective CSS pre-processor.</p><p>For more information visit the <a href="https://sass-lang.com/documentation">official documentation</a>. Another helpful tool I found was this <a href="https://css2sass.herokuapp.com/">SCSS/SASS converter</a>, give it a try!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e67de26a761" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dom Events and Event Handlers in Mithril (using JSX)]]></title>
            <link>https://danielpatnode.medium.com/dom-events-and-event-handlers-in-mithril-using-jsx-9badf9436c3f?source=rss-a773d20eccf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9badf9436c3f</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[dom-events]]></category>
            <category><![CDATA[dom]]></category>
            <category><![CDATA[mithril]]></category>
            <category><![CDATA[event-handlers]]></category>
            <dc:creator><![CDATA[Daniel Patnode]]></dc:creator>
            <pubDate>Sat, 09 Jan 2021 00:07:39 GMT</pubDate>
            <atom:updated>2021-01-14T00:02:00.055Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Io6kr-ggfGxIOLu5h5hQsQ.jpeg" /></figure><p>DOM events are actions that occur when a user effectively changes the state of the application through interaction with the browser. In order for these changes to occur, event handlers need to be used to manage how the element that was interacted with reacts to a given event. These events come in many forms, including clicks, keystrokes, mouse movements, hovers, and completion or start of different events, among many other things. If there’s an action a user can take, there is most likely an event handler for it (check out more DOM events and their associated event handlers from <a href="https://www.w3schools.com/jsref/dom_obj_event.asp">W3schools</a>).</p><p><strong>Writing handlers in Mithril</strong></p><p>If you have any experience with events using React, you’ll be well versed in DOM events and event handlers in Mithril. Take a look at this event handler in react:</p><pre><em>#ReactJS onClick handler</em></pre><pre>&lt;button onClick={activateLasers}&gt;  <br>     Activate Lasers<br>&lt;/button&gt;</pre><p>The same event could be written in Mithril (while using JSX) like so:</p><pre><em>#Mithril onclick handler</em></pre><pre>&lt;button onclick={activateLasers}&gt;  <br>     Activate Lasers<br>&lt;/button&gt;</pre><p>That wasn’t a typo. The only major difference is the capitalization of the word directly following the <em>on</em> in the event handler. In this particular case, onClick (uppercase) in React is written as onclick (lowercase) in Mithril. This syntax is the same for an onclick in plain old HTML as it is withJSX syntax (except for the lack of curly braces denoting Javascript):</p><pre><em>#HTML calling onclick handler to vanilla javascript</em></pre><pre>&lt;button onclick=&quot;activateLasers()&quot;&gt;<br>     Activate Lasers<br>&lt;/button&gt;</pre><p><strong>Popular Event handlers in action</strong></p><p>onclick, executes on the click of a button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*MDW6yHdtZB2FYSFW.gif" /><figcaption>onclick</figcaption></figure><p>onmouseover executes every time the mouse is over the top of the element.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/0*QdwJyiekIJve9rvH.gif" /></figure><p>onkeypress, onkeyup and onkeydown respectively trigger events when the key is pressed (onkeypress), on the release of the key (onkeyup) and when the user is physically pressing the key down (onkeydown).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/0*mXyYkLZ73CRrtDW0.gif" /></figure><p>onsubmit triggers an event on the submission of a form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/0*lM0ULfOpFMfetBP6.gif" /></figure><p>There are plenty of other event handlers to take advantage of but understanding these basic ones is a great place to start.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9badf9436c3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mithril: Routing with JSX]]></title>
            <link>https://danielpatnode.medium.com/mithril-routing-with-jsx-7b25035a7187?source=rss-a773d20eccf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b25035a7187</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[jsx]]></category>
            <category><![CDATA[routing]]></category>
            <category><![CDATA[mithriljs]]></category>
            <dc:creator><![CDATA[Daniel Patnode]]></dc:creator>
            <pubDate>Sat, 02 Jan 2021 00:24:33 GMT</pubDate>
            <atom:updated>2021-01-04T00:34:23.297Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*Jxa0uTeeKcbKjeQpkATxYA.png" /></figure><p>One of the features that makes using MithrilJS a breeze to work with out of the box is its built in routing capabilities. Unlike React where an external package (<a href="https://www.npmjs.com/package/react-router">react-router</a>) is required in order to handle routing, MithrilJS gives a simple intuitive implementation for your routing needs. To bring any SPA up a level and break your application into manageable navigable components, the use of routing allows for higher functionality and straight forward user interactions. In this article I will give a step by step guide on how to use basic routing in your next MithrilJS project.</p><p><strong>Create Button Component<br></strong>Set up a <em>NavButton</em> component that creates a template for each button on our future <em>NavBar</em> component. For organization’s sake let’s throw it in a folder called ui:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c40f3b6ab0d9058448e461be7c4bb06/href">https://medium.com/media/6c40f3b6ab0d9058448e461be7c4bb06/href</a></iframe><p>Note that the href is taking in an interpolated string with two portions: <strong>#!</strong> followed by <strong>/${attrs.path}</strong>. The <strong>#!</strong> is known as a <strong>hashbang </strong>and denotes a hypertext reference, which in turn indicates to the server anything following the <strong>hashbang</strong> is a route path. The <strong>/${attrs.path}</strong> is the route path and is written in this way to make it more reusable. The {attrs.icon} gives that same reusability to the icons that will be associated with each of the buttons in the NavBar component.</p><p><strong>Implement NavButton in NavBar Component</strong><br>Now let’s set up the NavBar to assign values for the path and icon that we set up in NavButton. Because we wrote that reusable bit of code for the NavButton we can now implement NavButtons for as many buttons as we want to have routes on our NavBar. Create a NavBar component within a folder called layouts and add this bit of code. Note that we are importing the NavButton component from the ui folder.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4a7cae6d150a2b6e56f1aec3bb76968c/href">https://medium.com/media/4a7cae6d150a2b6e56f1aec3bb76968c/href</a></iframe><p>Our paths (as noted) can be named whatever you want. In this case, I was building out a naughty or nice list that Santa can use to view all children, check their locations, add more children to the list, and add them to the naughty or nice list. The names that are assigned to <em>path</em> will be important for setting up our routes within index.jsx. Be sure to take note of them.</p><p>The icons are set to images grabbed from font awesome. In order to use these, you’ll need to be sure to add a script tag to your index.html file within the head of your project, like so :</p><pre>&lt;script<br>defer<br>src=&quot;https://use.fontawesome.com/releases/v5.0.8/js/all.js&quot;<br>&gt;&lt;/script&gt;</pre><p><strong>Create MainPage.jsx and App.jsx components<br></strong>For the purposes of following along with this tutorial add, these two files under layout:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1d7634c343d6ce9cf1ac2b3f0784ef54/href">https://medium.com/media/1d7634c343d6ce9cf1ac2b3f0784ef54/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3dcefa1191a018091211edfe31e5deb0/href">https://medium.com/media/3dcefa1191a018091211edfe31e5deb0/href</a></iframe><p>These provide the structure for our DOM tree.</p><p><strong>Add Routing to index.jsx<br></strong>To set up routes with Mithril we will be using the <em>m.route</em> function. “The m.route function still has the same auto-redrawing functionality that m.mount does, and it also enables URL awareness; in other words, it lets Mithril know what to do when it sees a #! in the URL”(<a href="https://mithril.js.org/index.html">mithril.js.org</a>).</p><p>m.route takes in three arguments:</p><pre>m.route(root, defaultRoute, routes);</pre><ol><li>root<br>Which will act as the parent node and will host different views interchangeably.</li></ol><p>2. defaultRoute<br>A string that indicates what path the router should go to if the url doesn’t match any of the prescribed url routes.</p><p>3. routes <br> Is an object that has a key of strings related to the paths we assigned in NavBar and values of views that will be assigned as functions.</p><p>To set up our roots to display the home-page check out lines 13–28.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a1272c4aef0729eea32ef8d78a94f465/href">https://medium.com/media/a1272c4aef0729eea32ef8d78a94f465/href</a></iframe><p>In the above case, the the <strong>root</strong> is app, the <strong>defaultRoute</strong> is “/home” (relating the ‘home’ path we wrote in the NavBar component), and the only route that we have assigned currently is “/home”(with a view that displays the HomeView function). We can continue to add more routes for all of the buttons we created earlier, like so :</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9c582bb4e2b9ff1619138ee262e1ae9/href">https://medium.com/media/a9c582bb4e2b9ff1619138ee262e1ae9/href</a></iframe><p>With this done, we now have routes linking to several different portions of the app! “/home”, “/santas-list” and “add-child” will all display their own separate views. In doing so, the application can be broken down into individual segments making it more intuitive and easier for users to navigate. In a feature article I will go over how to DRY this process out using MithrilJS lifecycle methods.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b25035a7187" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up MithrilJS with JSX using WebPack and Babel]]></title>
            <link>https://danielpatnode.medium.com/setting-up-mithriljs-with-jsx-using-webpack-and-babel-a5607cbe8dc8?source=rss-a773d20eccf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5607cbe8dc8</guid>
            <category><![CDATA[babel]]></category>
            <category><![CDATA[jsx]]></category>
            <category><![CDATA[webpack]]></category>
            <category><![CDATA[mithriljs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Daniel Patnode]]></dc:creator>
            <pubDate>Tue, 22 Dec 2020 01:41:44 GMT</pubDate>
            <atom:updated>2020-12-30T20:48:23.255Z</atom:updated>
            <content:encoded><![CDATA[<h3>Implementing JSX with MithrilJS using WebPack and Babel</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/0*NRiOwowg0HJXe626.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*bRmiedKXUngT4Oql.png" /></figure><p>In my last <a href="https://medium.com/p/248127f6252f/edit">post</a> , I went over the basic set up and how to manipulate DOM elements using out of the box syntax provided by Mithril’s framework upon installation. In this article I will go over how to set up and use JSX syntax with Mithril. For those unfamiliar with JSX; JSX (JavaScript XML) is a syntax extension of Javascript created for ReactJS that allows for easier to read (and more similar to vanilla HTML) code. With JSX, code is much easier to read and hop into (especially for those familiar with React).</p><p><strong>Core Mithril Syntax:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f1d0c7b0575a0d825ee337fd8d78e3da/href">https://medium.com/media/f1d0c7b0575a0d825ee337fd8d78e3da/href</a></iframe><p><strong>Mithril With JSX syntax:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0f935278159c8a2c5953c820163303fd/href">https://medium.com/media/0f935278159c8a2c5953c820163303fd/href</a></iframe><p><strong>Setup</strong></p><ol><li>Create a base project folder, in this case I’m calling it mithril-JSX-setup. Add the following folders like so so your file tree looks like this:</li></ol><pre>mithril-JSX-setup   <br>|-- src      <br>|   |-- index.jsx    <br>|-- .babelrc    <br>|-- index.html    <br>|-- webpack.config.js</pre><ul><li>the src folder will the index.jsx file which will act as the location where everything will be rendered from.</li><li>.babelrc is where the JSX will be converted into Javascript thats readable by the browser.</li><li>index.html is the templating of the application.</li><li>and webpack.config.js is where the configuration for WebPack is done.</li></ul><p>2) After getting the file tree set up run <strong>npm init</strong> which will create a package.json file.</p><p>3) Remove the code from the package.json file and add this in its place:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9ecec8695a348b9b89baa2268527ecb/href">https://medium.com/media/b9ecec8695a348b9b89baa2268527ecb/href</a></iframe><p>4) Run <strong>npm install </strong>to install all the required dependencies.</p><p>5) Navigate to the webpack.config.js file and paste this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b26a5bd7dadda81b790043691b20ab71/href">https://medium.com/media/b26a5bd7dadda81b790043691b20ab71/href</a></iframe><p>6) Go to the .bablerc file and paste this bit of code that allows for use of JSX in our project.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b4d1cdcf459d66672d5e176d9e4000cd/href">https://medium.com/media/b4d1cdcf459d66672d5e176d9e4000cd/href</a></iframe><p>7) Hop over to the index.html file and paste this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2395a83773210a57eb39f6933759d5ac/href">https://medium.com/media/2395a83773210a57eb39f6933759d5ac/href</a></iframe><p>8) Now lets hop over to index.jsx (make sure it has a .jsx tag and not a .js tag so that its treated as a JSX file) and paste the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12d2ea929eb9f0cccf7ce4a96bdb9aed/href">https://medium.com/media/12d2ea929eb9f0cccf7ce4a96bdb9aed/href</a></iframe><p>9) Lastly, run <strong>npm start</strong> in the terminal. If everything was entered properly then you should see this displayed in your browser:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*1LHePKxPjFXofpQD1_wCUg.png" /><figcaption>JSX rendered after setup</figcaption></figure><p>With this set up you are now able to write more readable code across all components of your project using JSX syntax! For more information on JSX check out ReactJS’ extensive documentation <a href="https://reactjs.org/docs/jsx-in-depth.html">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5607cbe8dc8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started With MithrilJS: Set up and DOM Elements]]></title>
            <link>https://danielpatnode.medium.com/getting-started-with-mithriljs-set-up-and-dom-elements-248127f6252f?source=rss-a773d20eccf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/248127f6252f</guid>
            <category><![CDATA[mithriljs]]></category>
            <category><![CDATA[javascript-frameworks]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[dom]]></category>
            <category><![CDATA[mithril]]></category>
            <dc:creator><![CDATA[Daniel Patnode]]></dc:creator>
            <pubDate>Thu, 17 Dec 2020 17:44:07 GMT</pubDate>
            <atom:updated>2020-12-22T01:09:57.543Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/280/0*EfaB3MVy3V7rGAj2.png" /></figure><p><strong>Why Mithril?<br></strong>With the amount of Javascript frameworks available choosing one that best fits your preferences and ease of use out of the box makes for a real difficult decision. Do you go with the tried and true React, ever changing and widely supported? Ember, for its enhanced handling of complex user interfaces? Angular for the amount of open-source material, power and efficiency? Or Mithril, which boasts a stripped down and dirty framework that gets back to its Javascript roots. Offering straightforward implementation, small size, high speeds and routing, Mithril bundles much of the capabilities of React in a smaller, faster and easy to consume package. In this Article I will go over the set up and how to render basic content to the browser using Mithril.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*9sZQCIkYlJ8zZo067E2QAw.png" /><figcaption>Comparison of Mithril to other popular frameworks.</figcaption></figure><p><strong>The set up<br></strong>Getting started is relatively simple. To set it up using a CDN (content delivery network) simply create a <em>index.html</em> file containing the following code:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5a6ef4e1db8e2ea2830787a6434c664e/href">https://medium.com/media/5a6ef4e1db8e2ea2830787a6434c664e/href</a></iframe><p>and a related <em>index.js</em> file that will be used to render content:</p><pre>m.render(document.body, &quot;We just rendered something using Mithril&quot;);</pre><p>and in your terminal run:</p><pre>open index.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*EYpxJM6u0INiKxD4NPz1sw.png" /><figcaption>what we just rendered.</figcaption></figure><p><strong>Changing DOM elements<br></strong>Updating is pretty straight forward as well, using the m() function formatting that was used in <em>index.js</em>, you can assign html structure to the elements like so:</p><pre><em>index.js</em><br>m.render(document.body, m(&quot;h1&quot;, &quot;We just rendered something using Mithril&quot;));</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SfRycEsjcaS6suy9Si9Ipw.png" /><figcaption>what was rendered as a &lt;h1&gt;</figcaption></figure><p>classes can also be assigned in much the same way for ease of styling in the future like so:</p><pre>m.render(document.body, m(&quot;h1&quot;, { class: &quot;title&quot; }, &quot;We just rendered something using Mithril with a class of &#39;title&#39; &quot;));</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wCR2iNmIlolbmvWeKR2Tug.png" /><figcaption>Rendered &lt;h1&gt; with a class of title</figcaption></figure><p>These same principals can be applied to rendering buttons, forms, links etc.:</p><pre>m(&quot;main&quot;, [<br>    m(&quot;h1&quot;, {class: &quot;title&quot;}, &quot;Check out this button&quot;),<br>    m(&quot;button&quot;, &quot;A button&quot;),<br>])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*Wj3j69IJYgjdu_cCnHTosg.png" /><figcaption>button and a &lt;h1&gt;</figcaption></figure><p>and much more!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/25fedd80438a0977451ce870a520379c/href">https://medium.com/media/25fedd80438a0977451ce870a520379c/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*XfHaIN954l22EXgHCo7aNA.png" /></figure><p>This is obviously only the tip of the iceberg. In future blog posts I will go over setting up and implementing JSX syntax, components, routing, XHR requests and project build outs. One final thing, while trying to flush out the syntax for rendering DOM elements in Mithril I came across this super helpful tool that allows you to input normal html and it converts it into Mithrilic syntax, I found it super helpful and really cool! check it out <a href="https://arthurclemens.github.io/mithril-template-converter/">here</a>.</p><p>Thanks for reading, if theres anything I missed or you think I should add feel free to leave a comment below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=248127f6252f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ReactJS hooks essentials: useState and setState]]></title>
            <link>https://danielpatnode.medium.com/reactjs-hooks-essentials-usestate-and-setstate-5e18f7c5499b?source=rss-a773d20eccf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e18f7c5499b</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[hooks]]></category>
            <dc:creator><![CDATA[Daniel Patnode]]></dc:creator>
            <pubDate>Thu, 10 Dec 2020 01:28:12 GMT</pubDate>
            <atom:updated>2020-12-16T01:10:39.922Z</atom:updated>
            <content:encoded><![CDATA[<h3>ReactJS hooks essentials Part 1: useState and setState</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tG7EQXjTQwnZGdS1.png" /></figure><p>The incorporation of state values is essential for any react developer to understand in order to make fully flushed out interactive web applications. React hooks give developers a cleaner, tighter and more direct way to implement use of state. In this article I’ll go over a simple application that allows users to display their status based off of button clicks using hooks built in useState and setState functions. The status is going to be a state value that represents the current status for this application.</p><p>To start out we’ll need to set up a functional component like so:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f2fd693f7662d245d43fd458bfabe7ba/href">https://medium.com/media/f2fd693f7662d245d43fd458bfabe7ba/href</a></iframe><p>Which renders this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*vcGX39QNibZMtEO8jMZxYw.png" /><figcaption>initial render</figcaption></figure><p>The next step is to incorporate the useState hook from the react library like so:</p><pre>import React, { useState } from &quot;react&quot;;<br>//add this on line 2 in place of what was there before</pre><p>*Sidenote*: <br>What is useState? It’s a hook. <br>A hook? A hook is a <em>function</em> that allows you to add further functionality to a component. React has a several built in hooks (like useState) to handle state changes within applications.</p><p>Next, create a constant and use some array destructuring for the status value, passing “open” as the initial state for the application. When the app loads the status will be set to open.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/53d95f9c7ae9f85db46f036b1375f44f/href">https://medium.com/media/53d95f9c7ae9f85db46f036b1375f44f/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*mJjbe1uLqogTk9yDxyeojw.png" /><figcaption>Initial state is set with useState to “Open”</figcaption></figure><p>useState returns a pair, right now status is the state value that was given the name “status”. The second value returned by useState is a function used to update the state. Naming conventions dictate that this second value should be named so that the word set comes before what ever the initial value of state was, in this case status. Add setStatus to the array destructuring, like so:</p><pre>const [status, setStatus] = useState(&quot;Open&quot;);<br>//line 6</pre><p>the setStatus function can now be utilized to change the status. adding several buttons with onClicks pointing to the setStatus function with different values associated will change the status set in state to whatever is clicked:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/304ebe9e569df6367defae6b9199271c/href">https://medium.com/media/304ebe9e569df6367defae6b9199271c/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FNH6243ICvjLkhU8iEy%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FNH6243ICvjLkhU8iEy%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FNH6243ICvjLkhU8iEy%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="302" frameborder="0" scrolling="no"><a href="https://medium.com/media/f819574938bb556712a8cfd668b7807e/href">https://medium.com/media/f819574938bb556712a8cfd668b7807e/href</a></iframe><p>Hooks, like useState and setState, give developers the ability to seamlessly alter state and build out interactive components with ease. there are plenty of other built in hook functions that you can checkout <a href="https://reactjs.org/docs/hooks-overview.html">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e18f7c5499b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WebSockets Explained]]></title>
            <link>https://danielpatnode.medium.com/websockets-explained-9bcc15495f1e?source=rss-a773d20eccf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bcc15495f1e</guid>
            <category><![CDATA[transmission-control]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[handshake]]></category>
            <category><![CDATA[websocket]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Daniel Patnode]]></dc:creator>
            <pubDate>Wed, 02 Dec 2020 21:14:03 GMT</pubDate>
            <atom:updated>2020-12-02T21:14:03.712Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_K53_dHuY2PuLMlM.png" /></figure><p><strong>Why WebSockets?</strong></p><p>WebSockets — what are those you ask? At the very base level WebSockets are another tool that allows information passing from client to server and vice versa. WebSockets were created with the aim to improve on the limitations traditional HTTP based technologies have in terms of the call and response cycle, by enabling “bidirectional communication between a browser and a web server”(<a href="https://bloggeek.me/webrtc-vs-websockets/#:~:text=What%20is%20the%20difference%20between,predominantly%20voice%20and%20video%20communications).">bloggeek.me</a>). With WebSockets information can be passed back and forth simultaneously, after an initial opening of communication between the client and server, while traditional HTTP requests require the client to make requests to the server in order for the server to respond. This lack of limitation allows for faster passing of information and allows for almost real time changes on the browser.</p><p><strong>WebSocket Uses</strong></p><p>These realtime changes are highly applicable for and useful for:<br>1) updating social media feeds in real time(twitter, facebook)<br>2) live tickers (sports, news scrolls, stock market, weather)<br>3) multimedia chat (video and audio chat)<br>4) location based applications (GPS, tracking etc.)<br>5) online education (real time assignments, quizzing, collaborative online whiteboards)<br>6) collaborative editing/coding( allows for teams to work remotely together online simultaneously)</p><p>The ability to have real time, up to date interactions opens up a multitude of possibilities.</p><p><strong>Traditional HTTP requests Compared To WebSockets</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/0*-5zThHK85S_tKgOL.png" /><figcaption>HTTP vs WebSocket Protocol</figcaption></figure><p>In traditional HTTP client server interactions: <br>1) a client makes a request<br>2) application server interprets the request <br>3) application server requests additional info from the database <br>4) database sends back information to application server<br>5) application server formats and sends a response to the client</p><p>the problem with traditional HTTP client server interactions:<br>1) Slower, must constantly reestablish connection and renegotiate a connection every time. Big issue if your trying to transfer a lot of data<br>2) No real time data updates.<br>3) Cause a huge amount of overhead and introduce latency which has a impact on overall performance.</p><p>WebSockets alleviate a lot of these issues!</p><p>In WebSocket client server interactions: <br>1) Communication is Bi-directional- meaning that there is a constant flow of information once a connection is established AND that there is no predefined message pattern.<br>2) WebSocket is full-duplex while HTTP is half-duplex- meaning that a client can talk to the server AND a server can talk to the client without a prescribed order and be independent of each other. HTTP interactions require the client to send a message to the server first and the server sends a message back. In HTTP client server communication this is the only flow of communication.<br>3) Utilization of single TCP connections- when a HTTP request is made with WebSockets a new TCP request is initiated and terminated after the response is received. New TCP connections need to be established after a new HTTP response. Client and servers communicate over the same TCP connection for the lifecycle WebSocket connection.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bcc15495f1e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential VS Code Extensions]]></title>
            <link>https://danielpatnode.medium.com/essential-vs-code-extensions-16ad9a84f7f3?source=rss-a773d20eccf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/16ad9a84f7f3</guid>
            <category><![CDATA[lists]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[extension]]></category>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Daniel Patnode]]></dc:creator>
            <pubDate>Fri, 16 Oct 2020 21:54:13 GMT</pubDate>
            <atom:updated>2021-08-24T00:05:45.159Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*5FSIwvmf3B1VYHUf1bLenA.jpeg" /></figure><p>Here is a list of my favorite and most used VS code extensions.</p><ol><li>Endwise</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/908/1*4Lr54axUHNl2KRg_W4wM6Q.png" /></figure><p>A essential for any Rubyist. Endwise adds the “end” keyword to code structures in Ruby while keeping the correct indentation levels automatically, making those pesky non existent ends a thing of the past.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*3Ns9At52qIDLEkpq.gif" /></figure><p>2. LiveShare</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*eRNKZYQ0QTY8D2Ur9z7SBQ.png" /></figure><p>Working on a group project is a breeze with the use of a liveshare which enables you to collaboratively edit and debug with others in real time, regardless what <a href="https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/platform-support#visual-studio-code">programming languages</a> you’re using or app types you’re building. Visual Studio Live Share allows developers to work together, while retaining their personal editor preferences (e.g. theme, keybindings), as well as having their own cursor.</p><p>3. TabNine</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*VYwKcO5yuobKC0U3pHjlOA.png" /></figure><p>Tabnine gives you the power of an advanced AI based autocomplete for all programming languages. TabNine Indexes your entire project by reading your .gitignore <a href="https://www.tabnine.com/faq#nongit">or others</a>, and determines which files to index.</p><ul><li>Enter long variable names using minimal keystrokes and leverage a mnemonic completion engine.</li><li>Zero configuration. TabNine works out of the box.</li><li>Highly responsive: Produces a list of suggestions in less than 10 milliseconds on average.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*E8JkbDnzoJrbPv3T.gif" /></figure><p>4. BracketPairColorizer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*sZiPK5PH7lqnsvyqCAmgDw.png" /></figure><p>Never miss a curly bracket or parenthesis again with BracketPairColorizer, which gives your vscode text editor a pop of color and helps to see a visual connection between those pesky brackets. users can define which characters to match, and which colors to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*g7_18Rf4XxDg2_pz.gif" /></figure><p>5. Indent-rainbow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/899/1*JTvQfsUHFFsHKI_mdHuntw.png" /></figure><p>This extension colorizes the indentation in front of your text alternating four different colors making it easier to decipher code at hand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*eS1gCMVekpQBJBC8Utu-cg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16ad9a84f7f3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Seeding your rails backend using an external API]]></title>
            <link>https://danielpatnode.medium.com/seeding-your-rails-backend-using-an-external-api-b57179019632?source=rss-a773d20eccf8------2</link>
            <guid isPermaLink="false">https://medium.com/p/b57179019632</guid>
            <dc:creator><![CDATA[Daniel Patnode]]></dc:creator>
            <pubDate>Tue, 06 Oct 2020 01:27:20 GMT</pubDate>
            <atom:updated>2020-10-06T16:30:00.629Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*DDXEnk6XYpX27daQ.gif" /><figcaption>seeds</figcaption></figure><p>for my final project at Flatiron school one of the base requirements was to implement an external API and use the information gained from this to populate the content of my app. With a bit of experience and a whole bunch of gumption I set off on my voyage to grab all the information I could. Below is a detailed account of my experience grabbing information that would in tern be used as the base data for my final project.</p><p>to start off I began by creating a basic rails backend by running:</p><pre>rails new practice_api_call api — database=postgresql</pre><p>and let my computer go to work setting up a rails.</p><p>when that was completed I navigated to my Gemfile and added the following gems, preceded by bundle install:</p><pre>gem &#39;rack-cors&#39;<br>gem &#39;active_model_serializers&#39;<br>gem &#39;rest-client&#39;, &#39;~&gt; 2.1&#39;</pre><p>I then navigated to the cors.rb file and added the following code to make sure the information could be passed to my frontend:</p><pre>Rails.application.config.middleware.insert_before 0, Rack::Cors do allow do<br>origins &#39;*&#39;</pre><pre>resource &#39;*&#39;,</pre><pre>headers: :any,<br>methods: [:get, :post, :put, :patch, :delete, :options, :head]<br>end<br>end</pre><p>from there, the next step was creating a model with column names matching the same information provided by the external API I was grabbing from (in this case <a href="https://api.openbrewerydb.org/breweries">https://api.openbrewerydb.org/breweries</a>) which I grabbed by passing into insomnia. The returned data in JSON format looked like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*-SlL7-YC-YyzSsCEieu1zA.png" /><figcaption>Data from the API in insomnia</figcaption></figure><p>my migration file in turn looked like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/435/1*l-xmmIcbOGAhSdP9y7aNRw.png" /></figure><p>With that all set up the next step was to navigate to my seeds.rb file and make a request to the external API:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*dVDTeFjh286y_tjCJUtqgw.png" /></figure><p>and from there I used the create method within a .each to make each individual brewery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/374/1*4gIdICyJIxncDrrsNMWufg.png" /></figure><p>at this point the only thing left to do was run rails db:seed which left me with a ton of information to work with for my project!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1016/1*_N-O0CtRghI1T0sJQ8RWjw.png" /><figcaption>all the beautiful breweries</figcaption></figure><p>in very few lines of code I was able to seed my project without having to do an extensive amount of data entry.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b57179019632" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>