<?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 Kyle Andrews on Medium]]></title>
        <description><![CDATA[Stories by Kyle Andrews on Medium]]></description>
        <link>https://medium.com/@kyleandrews_10470?source=rss-6b839b0c1edb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k4O8VAMoZyKpIWdk16oR_A.jpeg</url>
            <title>Stories by Kyle Andrews on Medium</title>
            <link>https://medium.com/@kyleandrews_10470?source=rss-6b839b0c1edb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 15:34:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kyleandrews_10470/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[YourSQL vs MySQL]]></title>
            <link>https://medium.com/@kyleandrews_10470/yoursql-vs-mysql-9b200343fdca?source=rss-6b839b0c1edb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b200343fdca</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Kyle Andrews]]></dc:creator>
            <pubDate>Sun, 06 May 2018 22:05:01 GMT</pubDate>
            <atom:updated>2018-05-06T22:05:01.452Z</atom:updated>
            <content:encoded><![CDATA[<p>Tables, on tables on tables…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3GWG2y6HgQ5ig%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fcartoon-angry-adventure-time-3GWG2y6HgQ5ig&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3GWG2y6HgQ5ig%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/ef845e977aa5beaec0d2e4df52d7fbf3/href">https://medium.com/media/ef845e977aa5beaec0d2e4df52d7fbf3/href</a></iframe><p>One of the most amazing things about the world of Web Development is that you never reach a point where you’ve learned everything. With that said, finishing an immersive bootcamp only signifies that now you now know HOW to learn during your voyage through this world.</p><p>While working on a project for a client, building an app that takes an existing MySQL database (via text file) and pairs it with a Rails API. Ultimately the app creates a cart and and invoices each customer using data from the database. All in all it seemed like a fairly straightforward procedure. While there are a plethora of posts about this none of them are straight forward, and I wound up having to piece together things from each site and… it still didn’t quite work.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FeRqxSA8uc2yas%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fname-database-eRqxSA8uc2yas&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FeRqxSA8uc2yas%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5621f59c83f3d20802f727a059110f9/href">https://medium.com/media/e5621f59c83f3d20802f727a059110f9/href</a></iframe><p>Not until the 5 or 6 iteration of the project.</p><p>I already had a rails app set with an initial Postgres database. I had my models and controllers already set up.</p><p>To get MySQL set up, install it by either including it into your gemfile:</p><p>`gem ‘mysql2’</p><p>And then running:bundle install , at the command line.</p><p>OR</p><p>You can run: gem install mysql2 at the command line instead.</p><p>Once you do that, you can begin configuring your app.</p><h3>Step 1: Set up your database:</h3><p>Your database.yml file should look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*IfFTq0Dc9iBLI2npp7cLqw.png" /><figcaption>database.yml file</figcaption></figure><p>run:rake db:create &amp; rake db:migrate at your command line</p><h3>Step 2: Set up your MySQL server</h3><p>Now you get to start working in your MySQL. At the command line run: mysql.server start Then access MySQL by logging in using the command mysql -u username -p password or if you don’t have a password mysql -u username . Then you’ll see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*C_pBRcmTedKsl_FAWNY0DQ.png" /></figure><p>Create your database in MySQL w/CREATE DATABASE your_database_name. With the file I was using, the text file held the structure and table information for the database, so to import it I just piped the text file into the created database.</p><p>This was achieved at the command line with the command mysql -username -p password your_database_name &lt; ~/path_for/your/text_file . Now you’re all connected!</p><h3>Testing the connection</h3><p><strong>… in MySQL</strong></p><p>You can test that the database is correctly set up in MySQL right after running the previous line of code, by testing the tables out, i.e. select * from table_name; . You will see the contents for each table.</p><p><strong>…in Rails</strong></p><p>You can log onto the rails console and check your tables there as well with a simple TableName.all command.</p><h3>Some things to look out for …</h3><ul><li>if you have different model names, you can still access the MySQL table name. Let say you have a Book model and a Books table, you could just structure your table like so:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*0bf0JTYo13-93P0K96weYQ.png" /><figcaption>In your book.rb file</figcaption></figure><ul><li>if you’re running into any issue with cannot socket… make sure the you mysql.server startcommand.</li></ul><p>And that’s all folks! Thank you for taking the time to read this and hopefully this helps anyone going through the same struggle I was! Please feel free to reach out if you have any questions or if you’ve found better/more efficient way to achieve any of this. Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b200343fdca" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network === Net Worth]]></title>
            <link>https://medium.com/@kyleandrews_10470/network-net-worth-64a29d2577d2?source=rss-6b839b0c1edb------2</link>
            <guid isPermaLink="false">https://medium.com/p/64a29d2577d2</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Kyle Andrews]]></dc:creator>
            <pubDate>Sat, 28 Apr 2018 02:14:26 GMT</pubDate>
            <atom:updated>2018-04-28T02:19:06.170Z</atom:updated>
            <content:encoded><![CDATA[<p>//output True</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F39n5xjFc0pPsUqBKcH%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fdesusandmero-funny-money-39n5xjFc0pPsUqBKcH&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F39n5xjFc0pPsUqBKcH%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/a263b79b3a24748c418249cfbc05fc84/href">https://medium.com/media/a263b79b3a24748c418249cfbc05fc84/href</a></iframe><p>Since my graduation from The Flatiron School, I was advised to cultivate my personal network. I worked with my career coach on everything from curating my <a href="https://www.linkedin.com/in/kyle-andrews-fswd/">LinkedIn</a> profile to working on how my outreach to other developers should look. For someone with no prior LinkedIn experience/usage, I became pretty proficient in making it work for me.</p><p>Now let me preface this post by say, I WAS NOT A BELIEVER IN THE REACHING OUT TO DEVELOPERS BEING BENEFICIAL! Mainly because I never expected anything to come from it.</p><p>Over the passed week, I met with two developers at companies that I think are amazing. As a buffer, I set my first two interactions with other Flatiron graduates and both meetings went better than I could’ve ever imagined!</p><h3><strong>My Coffee Experiences</strong></h3><h4>Emails</h4><p>Each one of my outreaches came from contacting the developers work email. I sent a personal email making connections between myself and the other developer. I explained why I wanted to meet and offered coffee, my treat, since I would be taking up their time. It looked something like this:</p><pre>Hi Dev,</pre><pre>My name is Kyle Andrews and I am a recent graduate of The Flatiron School’s Full Stack Web Development Immersive program, as well as a fellow musician. I recently came across you and [Company] on LinkedIn while researching companies doing interesting things with data/consumer analytics and beyond.</pre><pre>The concept of emotional reaction analysis is fascinating to me! During my tenure creating music we would use analytics to do everything from finding out where we should do our next shows, down to confirming how our content was being received across social media. When I looked into your LinkedIn profile further I saw that you oversaw a transition with [Company] from the MEAN stack to the MERN stack w/ GraphQL. This was incredibly intriguing to me, especially given that my final project at Flatiron School paired GraphQL with a Rails/React stack.</pre><pre>I would love to learn more about the process you used in doing that transition, as well as learning more about you music endeavors. It’s always great to meet fellow coders who are also musicians!  Would you happen to be available for a chat by phone, Skype or in-person coffee (my treat)?</pre><pre>Thanks so very much. I look forward to your reply.</pre><p>As a former musician there was an immediate connection, and also as someone that is a quickly becoming a GraphQL enthusiast, I saw this as an opportunity to find out as much about that stack transition and all that it entailed!</p><p>Making every email personal works on a few different levels. Not only does it show give the developer a reason as to why the should meet with you, it also creates an outline of the dialogue that you can have.</p><p>Luckily, I have the greatest career coach EVER and we’ve been working together to help me understand all that goes into outreaches.</p><h4>Tech Talks</h4><p>I mentioned in my <a href="https://medium.com/@kyleandrews_10470/impastas-imposters-and-how-i-got-over-the-syndrome-8ce709922b2e">previous blog post</a> that talking more about tech was part of what starting making me more confident as a developer. These meetings can absolutely be a platform to discuss what you’re working and really delve into how one another uses their respective technologies.</p><h4>Career Advice</h4><p>Another major benefit of my interactions with other developers was just understand how their days went, what their post bootcamp/pre-hire process worked out for them. I also got really amazing advice on how to navigate the waters of candidacy at companies I was interviewing with as well as even more ways to prep for technical interview and code challenges. It was a fantastic experience!</p><h3>Conclusion</h3><p>I highly recommend taking the necessary steps to building your professional network. As someone that found this step tedious initially, I really excited about who I’ll be able to meet and just the exchange of information and experience overall! You also never really know who can put you in touch with someone that works at the company you have your eye set on, or who may even be able to refer you at their jobs! I totally understand how vital this process is now from a career perspective as well as from a personal growth standpoint. Don’t be afraid to get out there!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F26u46pZeieoJVKW6A%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Ffoxsearchlight-dance-nailed-it-26u46pZeieoJVKW6A&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F26u46pZeieoJVKW6A%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="233" frameborder="0" scrolling="no"><a href="https://medium.com/media/615b53bbed5ecc62881e4f3e46c8a381/href">https://medium.com/media/615b53bbed5ecc62881e4f3e46c8a381/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64a29d2577d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Impastas (Imposters): And how I got over the syndrome.]]></title>
            <link>https://medium.com/@kyleandrews_10470/impastas-imposters-and-how-i-got-over-the-syndrome-8ce709922b2e?source=rss-6b839b0c1edb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ce709922b2e</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Kyle Andrews]]></dc:creator>
            <pubDate>Mon, 23 Apr 2018 01:06:47 GMT</pubDate>
            <atom:updated>2018-04-23T19:34:51.704Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3z6h4tor4l4Kk%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2F3z6h4tor4l4Kk&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3z6h4tor4l4Kk%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="385" frameborder="0" scrolling="no"><a href="https://medium.com/media/1bea5c97e637d8ec11250e103573fb1d/href">https://medium.com/media/1bea5c97e637d8ec11250e103573fb1d/href</a></iframe><p><strong><em>Impostor syndrome</em></strong><em> (also known as </em><strong><em>impostor phenomenon</em></strong><em>, </em><strong><em>fraud syndrome</em></strong><em> or the </em><strong><em>impostor experience</em></strong><em>) is a </em><a href="https://en.wikipedia.org/wiki/Psychosomatic"><em>psychosomatic</em></a><em> pattern in which people doubt their accomplishments and have a persistent, often </em><a href="https://en.wikipedia.org/wiki/Internalization"><em>internalized</em></a><em> fear of being exposed as a “fraud”.</em></p><p>I can’t say for certain if Imposter Syndrome is something that affects only developers from bootcamps or if it’s a standard in the field for all new developers, but it’s something that myself and a lot of others have felt going through the Immersive Web Development Bootcamp experience. I imagined that once I graduated from The Flatiron School, I would feel like a full-fledged developer and like I syndrome would be gone. That definitely wasn’t the case. Over the last week, I had:</p><ol><li>1 Phone Screener (Monday)</li><li>Initial Interviews (Wed &amp; Thurs)</li><li>1 code challenge (Tues &amp; Wed)</li><li>Second Round interview with the CTO and CPO for a prospective employer (Friday)</li></ol><p>On Monday I admit that I was extremely nervous, even though I had already done so much preparation, to the point that I had even started working with Node.js, Express.js &amp; Mongo.db, because that’s what they work with. By Friday, I felt pretty comfortable in my skin as a software engineer, so needless to say, it was a pretty good week!</p><p>I realized there were a few steps I was able to take to bring me to this point of comfort. So… Here it goes:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FcitBl9yPwnUOs%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fthe-simpsons-computer-confused-citBl9yPwnUOs&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FcitBl9yPwnUOs%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/a1914f927f7241d754620c10c7bac7ee/href">https://medium.com/media/a1914f927f7241d754620c10c7bac7ee/href</a></iframe><h3>Algorithms &amp; Data Structures</h3><p>One of the most terrifying situations I was concerned with with preparing for was the Technical Interview. I knew I wasn’t that strong in Computer Science concepts and my approach to problem solving left a LOT to be desired. I spotted a Udemy course (listed in resources) that not only broke down a lot of the concepts that I needed to delve into, but the instructor also showed the best way to approach problems even before you start coding them out. He also goes over common problems that you’ll see during your Tech Interview.</p><h4>JS Basics</h4><p>Additionally, I found there were some JavaScript basics and methods that I could take some time doing a deep dive into. This lead to rediscovering things I may have glossed over during the bootcamp, i.e. the reduce() function or <a href="https://medium.com/@kyleandrews_10470/breaking-the-loop-20908d0774e3">for../for…in/for…of loops.</a></p><h3>Tightening projects up</h3><p>Now once you start to on that trek, you can go back to what you’ve learned and make sure you understand each piece of code and what it does. Also, with learning more, you become better with writing code. This lends itself to cleaning up previous projects to make them cleaner and more efficient.</p><p>That can turn something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*wjlDOZeC-sQNHSYBwsiVxw.png" /><figcaption>Still functional code.</figcaption></figure><p>… into something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*F52VQAp7b8_g04HMotHKzg.png" /><figcaption>fNotice the reduce method!</figcaption></figure><p>Both of these complete the same functionality, however, the one directly above is something more along the lines of what we’d expect to see from an experience developer. It’s also easier to follow along with what is happening.</p><h3>Learn New Technologies</h3><p>This was something that I started right before I graduated actually. I began learning more about how to make GraphQL API calls for my final project. Once I graduated I began to build my GraphQL API to be consumed by a front-end I was working on (an instagram clone).</p><p>What helped the most was when I began building a RESTful node.js backend I mentioned above. Seeing how principles and concepts carried over helped a lot as well as building the server and other things in the background (explained <a href="https://medium.com/@kyleandrews_10470/express-train-from-rails-37a5067c85d9">here</a>), made me understand the technologies at work underneath Rails. This made talking about projects easier and I felt more confident doing it.</p><h3>Talk Tech</h3><p>I have to say that everything above makes this step MUCH easier, not simple, just easier. Writing <a href="https://medium.com/@kyleandrews_10470">blog posts</a> and going, meet ups and having discussions about the technologies that you’re passionate about make your confidence so much stronger.</p><h4>Talking about YOUR work</h4><p>Here is an anecdote about discussing demos from my friend/mentor:</p><p><em>“Try to cater the demo to whoever you’re demoing to. So if you’re talking to an engineer, go into more details about the underlying code and the solutions you came up with to solve problems. If it’s a product person talk more about how you approached building it and how you tasked it out. If it’s a design person talk about the ux and the customer experience. If it’s an executive you can focus more on the goal of what you were trying to accomplish and how you helped the client get there”</em></p><p>Essentially, be cognizant of what the person you’re doing the demo for needs to/should hear. Hopefully that will help you on your next demo!</p><h3>Conclusion</h3><p>All of the above steps made me more confident as a developer mainly because I had a deeper understand of WHAT was happening behind the scenes of a lot of functions, libraries, frameworks, etc… Prior to this I just know HOW to build everything, however I didn’t understand why the process had to happen in a certain order. With that being said, my path may not be everyone’s path, but hopefully this can help you find your comfort!</p><p>Happy coding!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FzLrMT1J1RuJ9u%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fdexter-i-dont-know-what-im-doing-pushing-buttons-zLrMT1J1RuJ9u&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FzLrMT1J1RuJ9u%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/015175305c93c2257b9c6b4a502350b6/href">https://medium.com/media/015175305c93c2257b9c6b4a502350b6/href</a></iframe><h4>Resources:</h4><ul><li><a href="https://en.wikipedia.org/wiki/Impostor_syndrome"></a></li><li><a href="https://medium.freecodecamp.org/reduce-f47a7da511a9">A Guide To The Reduce Method In Javascript​</a></li><li><a href="https://www.udemy.com/coding-interview-bootcamp-algorithms-and-data-structure/">The Coding Interview Bootcamp: Algorithms + Data Structures</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ce709922b2e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Express train from Rails]]></title>
            <link>https://medium.com/@kyleandrews_10470/express-train-from-rails-37a5067c85d9?source=rss-6b839b0c1edb------2</link>
            <guid isPermaLink="false">https://medium.com/p/37a5067c85d9</guid>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Kyle Andrews]]></dc:creator>
            <pubDate>Mon, 16 Apr 2018 03:34:34 GMT</pubDate>
            <atom:updated>2018-04-16T03:34:34.288Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3otPoEvMyH2X0NTOWk%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Ffilmeditor-christmas-movies-the-polar-express-3otPoEvMyH2X0NTOWk&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3otPoEvMyH2X0NTOWk%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="179" frameborder="0" scrolling="no"><a href="https://medium.com/media/71f9873754f66319fcb7b88b2e24d35d/href">https://medium.com/media/71f9873754f66319fcb7b88b2e24d35d/href</a></iframe><p>For my final project at the Flatiron School, I volleyed between sticking with the Ruby on Rails backed, or if I should give the MERN (Mongo.db, Express.js, React.js &amp; Node.js) stack a shot since I initially planed to include a real time chat feature, using websockets. I opted against giving MERN a go at the time. I decided it was time to get to get to work on building a full stack JavaScript application.</p><p>So much come “pre-installed” with rails that you can forget all that is needed to get started. Rails new just gets the job done. Below are some of my experiences going through the initial set up of the application, including getting the server set up, setting up routes, error handling &amp; CORS.</p><h3>Creating App/Setting up Server</h3><p>To get started I had to make the directory &amp; change into that directory by doing the following in the CLI:</p><p>mkdir appName followed by:cd appName</p><p>Then you install the node dependencies and with: npm init</p><p>Up to this point, my use of node.js as a server was through using the Create-React-App package, so I was already familiar with some of the behaviors needed within a node server. These actions would have to just be manually crated within this application.</p><h4><strong>Server Set Up</strong></h4><p>First we have to install express by running: npm install --save express</p><p>Next we create two files that we will be doing most of our work in <em>app.js</em> &amp; <em>server.js.</em></p><p>Server.js:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*YmzVlLWk6Krlw-mae2k_xQ.png" /><figcaption>Your server.js file should look like this:</figcaption></figure><p>What’s happening here is that we are including “http” and the methods associated with it so that we can have access the <em>createServer() </em>function that we are passing the information that we have included from <em>app.js.</em></p><p>Now we can run the server whenever we want, by executing node server.js in the command line. The only catch here is that anytime you make any updates in your text editor, you have to stop and restart the server for any of your changes to be reflected… We’ll get back to that later though.</p><p>App.js:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/736/1*Un1MkUFGPzMGn4kbYiOHzQ.png" /><figcaption>Your app.js file should look like this:</figcaption></figure><p>So here we’re including express and all of it’s methods. Ultimately this is to access the middleware stack &amp; methods inherit to Express.js. So what you see above is us accessing the <em>.use </em>method and passing it the an arrow function as a argument. The arrow function has the arguments (request, response, next), and based on whether the HTTP response code is a <em>200</em>, the message “It works!” will be returned as output.</p><h4>Auto-Updating Server</h4><p>Alright, back to the server issue noted earlier. Fortunately, we have a fix for needing to restarting the server every time we make an update. To start we can add a package that monitors whenever changes are made to our code. In steps <em>nodemon. </em>To begin run: npm install --save-dev nodemon</p><p>Next we just have to update our <em>package.json</em> file, by including this line in this attribute in the scripts object &quot;start&quot;: &quot;nodemon server.js&quot; . Now your scripts object should look like this:</p><pre>&quot;scripts&quot;: {<br>    &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;,<br>    &quot;start&quot;: &quot;nodemon server.js&quot;<br>  },</pre><p>Now, you can just run: npm start and nodemon will run your server, all while checking for any updates and will apply them automatically to your code, ending your need to have to stop/start your service whenever you make any updates.</p><h4>Error Handling</h4><p>Now using that we have the server operating how we want, we can at this point we can use the <em>morgan</em> package which will log HTTP request data, which can absolutely help with debugging in the long run.</p><p>We start by running npm install --save morgan in the command line.</p><p>We still have to include morgan in our <em>app.js</em> file, which you can name the const whatever you like, I just happened to use the const “eh”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*TTwcDvbGIojeG-6Z3Fz9vg.png" /><figcaption>Be sure to uncomment eh = require(”morgan”)</figcaption></figure><p>Above, you see that we have used the same <em>app.use </em>middleware function, which would we are using to in this instance to handle and report the status messages for any request errors we receive to our server.</p><h3>Conclusion</h3><p>So far setting up the behind the scenes functionality of the application is pretty straight forward. While it takes a few more steps that rails, I have to say that after my first round of building an express backend, I actually prefer it to rails. This hands on approach is more — deliberate. You’re only including what you need, and I feel like I’m more cognizant of each part of the application.</p><p><strong>Resource(s)</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F0oXYLzuucwE%3Flist%3DPL55RiY5tL51q4D-B63KBnygU6opNPFk_q&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D0oXYLzuucwE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F0oXYLzuucwE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c62c026d8b81c17eea4ca3d6d6f53bc0/href">https://medium.com/media/c62c026d8b81c17eea4ca3d6d6f53bc0/href</a></iframe><ul><li><a href="https://stackoverflow.com/questions/25468786/what-does-morgan-module-have-to-do-with-express-apps">What does `morgan` module have to do with express apps?</a></li><li><a href="https://stackoverflow.com/questions/11321635/nodejs-express-what-is-app-use">NodeJS / Express: what is &quot;app.use&quot;?</a></li><li><a href="https://www.npmjs.com/package/morgan">morgan</a></li><li><a href="https://www.npmjs.com/package/nodemon">nodemon</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37a5067c85d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Breaking the Loop!]]></title>
            <link>https://medium.com/@kyleandrews_10470/breaking-the-loop-20908d0774e3?source=rss-6b839b0c1edb------2</link>
            <guid isPermaLink="false">https://medium.com/p/20908d0774e3</guid>
            <category><![CDATA[loop]]></category>
            <category><![CDATA[basics]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[Kyle Andrews]]></dc:creator>
            <pubDate>Mon, 09 Apr 2018 03:24:54 GMT</pubDate>
            <atom:updated>2018-04-09T03:24:54.109Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F2Fazad9Hs5xPAF6iQ%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Ffalcaolucas-2Fazad9Hs5xPAF6iQ&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F2Fazad9Hs5xPAF6iQ%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/26f1c7ad730fa0ae9439ab491378a440/href">https://medium.com/media/26f1c7ad730fa0ae9439ab491378a440/href</a></iframe><p>At this point as a developer, I’m finally starting to feel more comfortable with being labeled… a developer, ha! Initially I was afraid of how much I didn’t know and that only feed into my bout of Imposter Syndrome. Now I see it all as more to learn to become a more efficient, and THAT makes things even more fun they already were. This also brought me back to some of the basics… loops!</p><p>This post is going to focus on for, for… in, and for… of loops. Just to help get a sense of when/how they should be used as well as the syntax behind the loops.</p><h3>For</h3><p>For loops are the common out of the loops, as it runs for a specified amount of time. For loops can also be used to accomplish many of the iterations needed for array methods, i.e. “.map”, “.filter”, “sort”, etc… It focuses on all of the</p><p><strong>Syntax</strong></p><p>The construction of a for loop is pretty simple:</p><pre>for([initialization] ; [condition] ; [final expression]) {<br>   //block of code you want to be executed during each iteration<br>}</pre><p><strong>Initialization</strong> is where you set the starting point or variable that will be present during the each iteration of the loop. The <strong>Condition</strong> is what determines how long the loop will run. Lastly, the <strong>Final Expression</strong> is what you want to happen at the end of each iteration. Generally the final statement either increases or decreases the variable set in the initialization portion of the statement.</p><p>Let’s say we want have an array and we want to log everything in that array. That could look like this:</p><pre>const array = [&quot;cool&quot;,&quot;story&quot;,&quot;bro&quot;]</pre><pre>function countdown(arr) {<br>  for (let i = arr.length -1 ; i &gt;= 0 ; i--) {<br>    console.log(arr[i])<br>  }<br>}<br>countdown(array) </pre><pre>// output <br>&quot;bro&quot;<br>&quot;story&quot;<br>&quot;cool&quot;<br></pre><p>You could even do something a little more complex, like say we want to take the characters in a string and count how many times each letter in the string repeats. We could create something along the lines of:</p><pre>const str = &quot;Cool story bro&quot;</pre><pre>function createObj(string){<br>  const arr = string.split(&quot;&quot;)</pre><pre>let obj = {}<br>  <br>  for(let i = 0; i &lt; arr.length -1; i++) {<br>    if(obj[arr[i]]) {<br>      obj[arr[i]]++<br>    } else {<br>      obj[arr[i]] = 1<br>    }<br>  }<br>  return obj<br>}</pre><pre>createObj(str)<br>// output { c: 1, o: 4, l: 1, &#39; &#39;: 2, s: 1, t: 1, r: 2, y: 1, b: 1 }</pre><p>In the above code, we convert a string into an array, then iterate over that arry using the for loop. We then create an object of key[value] pairs that count how many times a letter appears in a that string.</p><h3>For…of</h3><p>For… of loops offer the option to iterate of Objects, Strings &amp; Arrays, etc.</p><p><strong>Syntax</strong></p><pre><strong>for</strong> (variable <strong>of</strong> iterator) {<br>      //block of code you want to be executed during each iteration<br>}</pre><p>Let’s say we want to do accomplish something like our second function using our for loop, but use considerably less code. We could create a function with a loop that looks something like this:</p><pre>const str = &quot;Cool story bro&quot;</pre><pre>function charCount(string) {<br>  let obj = {}</pre><pre>  for (let character of string) {<br>    if (obj[character]) {<br>      obj[character]++<br>    }else{<br>      obj[character] = 1<br>    }<br>  }<br>}</pre><pre>charCount(str)<br>// output { c: 1, o: 4, l: 1, &#39; &#39;: 2, s: 1, t: 1, r: 2, y: 1, b: 1 }</pre><p>In the above code, we completing the same functionality without having to convert the string into an array and just operating string on the string itself. This method also allows for less margin of error. The for loop has a lot of parts you have to account for in the construction. An issue I’ve run into was substituting ; for , or simply switching around &lt; for &gt; could break your whole code.</p><h3>For…in</h3><p>For …in loops iterate over the enumerable properties of an object. This means that if you have a defined attribute for on object, you can iterate over these keys using this loop structure.</p><p><strong>Syntax</strong></p><pre><strong>for</strong> (variable <strong>in</strong> iterator) {<br>      //block of code you want to be executed during each iteration<br>}</pre><p>Let’s say we want to take the information from the above obj and find out the object that has the highest value. We could create a function with a loop that looks something like this:</p><pre>const charCount = { c: 1, o: 4, l: 1, &#39; &#39;: 2, s: 1, t: 1, r: 2, y: 1, b: 1 }</pre><pre>function charMax(obj) {<br>  let highestValue = 0<br>  let highestChar</pre><pre>  for (let character in obj) {<br>    if (obj[character] &gt; highestValue) {<br>      highestValue = obj[character];<br>      highestChar = character;<br>    }<br>  }<br>  return highestChar<br>}</pre><pre>charMax(charCount)<br>// output &#39;o&#39;</pre><p>In the above code, we took the object created in for…in loop, iterated over each key[value] pair to determine which key had the highest value (indicating that it repeated the most times in the initial string), then returned that key (character). In the above code, the “character” variable in the for... in construct is equivalent to the key property of the charCount object.</p><h3>Conclusion</h3><p>In conclusion, we broke down how to use for, for..in and for…of loops. We went over the differences between for…in and for…of loops. Lastly, if you combine the last two together, we even cover how to determine the maximum character of a string, that was converted into an array. I hope you found this helpful. If you have any questions or additions to what is noted here, please feel free to comment with any of your thoughts.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F1bNyjudszurvi%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fmovie-joseph-gordon-levitt-1bNyjudszurvi&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F1bNyjudszurvi%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="271" frameborder="0" scrolling="no"><a href="https://medium.com/media/faee495ce8e09491cb3b9bc9e0937683/href">https://medium.com/media/faee495ce8e09491cb3b9bc9e0937683/href</a></iframe><h3>Sources</h3><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for">for - JavaScript | MDN</a></li><li><a href="https://www.digitalocean.com/community/tutorials/how-to-construct-for-loops-in-javascript">How To Construct For Loops in JavaScript | DigitalOcean</a></li><li><a href="https://stackoverflow.com/questions/29285897/what-is-the-difference-between-for-in-and-for-of-in-javascript">What is the difference between ( for... in ) and ( for... of ) in javascript?</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties">Enumerability and ownership of properties - JavaScript | MDN</a></li><li><a href="https://stackoverflow.com/questions/17893718/what-does-enumerable-mean">What does enumerable mean?</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20908d0774e3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[And… Action!]]></title>
            <link>https://medium.com/@kyleandrews_10470/and-action-b67ee984d54d?source=rss-6b839b0c1edb------2</link>
            <guid isPermaLink="false">https://medium.com/p/b67ee984d54d</guid>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Kyle Andrews]]></dc:creator>
            <pubDate>Mon, 11 Dec 2017 20:09:20 GMT</pubDate>
            <atom:updated>2017-12-11T20:09:20.890Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s the most wonderful time of the year… Mod 5 projects for cohort #091817!</p><p>Of course we all want our projects to be great so we’re going to shoot for the the stars. For me to achieve this I want(ed) to include a real-time chat feature, which in theory sounds cool, but after talking to others began to feel like…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FASLFVfPrRtbiM%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fmrw-hours-diet-ASLFVfPrRtbiM&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FASLFVfPrRtbiM%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="324" frameborder="0" scrolling="no"><a href="https://medium.com/media/68cbded055dff914c1cdd93e1ed716c0/href">https://medium.com/media/68cbded055dff914c1cdd93e1ed716c0/href</a></iframe><p>This would be because the key to making this work efficiently would be websockets. Websockets allow for foregoing the standard HTTP Request/Response process, in lieu of a persistent connection between client &amp; server.</p><h4>Express vs Rails</h4><p>Initially most of the documentation I saw for using Websockets indicated that pairing it with Node.js was the best recourse and that using the MERN (Mongo.db, Express, React &amp; Node.js) Stack would be optimal. Having only 3 weeks to complete my project, I didn’t want to get to far off course learning both Mongo &amp; Express just for a real-time dialogue. The Rails options I was seeing didn’t seem to be to in-depth.</p><p>In steps… Action Cable!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FbpBqWui2mE4zm%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fmarvel-deadpool-dreamworks-bpBqWui2mE4zm&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FbpBqWui2mE4zm%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="238" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc5ce62fcbb78dfa1d65eb5c38d60032/href">https://medium.com/media/dc5ce62fcbb78dfa1d65eb5c38d60032/href</a></iframe><p>Up until Rails 5 there wasn’t really any support for websockets because it’s creator, David Heinemeier Hansson didn’t think it was necessary. This caused many work arounds including SockJS &amp; Wesocket-Rails, which didn’t allow for as seamless of an integration. DHH finally saw the benefit of having the needed support so Action Cable was created and set as the premiere function update to Rails 5. There doesn’t seem to be much in the way of difficulty in set up, the process is pretty well documented via the github repo. The only additional need would be Redis, which can be included as a gem to be used a a data store to sync content.</p><p>Ultimately, I may build out a mini -app over the weekend to get accustomed to the the application of Action Cable at which point I will edit/update this post with additional info and work to show the process.</p><p>Below are links I found helpful and will use to build the mini-app:</p><p><a href="https://github.com/rails/rails/tree/master/actioncable">rails/rails</a></p><p><a href="https://blog.heroku.com/real_time_rails_implementing_websockets_in_rails_5_with_action_cable">https://blog.heroku.com/real_time_rails_implementing_websockets_in_rails_5_with_action_cable</a></p><p><a href="http://www.thegreatcodeadventure.com/rails-5-action-cable-with-multiple-chatroom-subscriptions/">Rails 5 Action Cable with Multiple Chatroom Subscriptions</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FqDB4soGIZALHG%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fdeadpool-shoot-qDB4soGIZALHG&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FqDB4soGIZALHG%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/2cdca229c3df8b5d05b0731d43f5d3fd/href">https://medium.com/media/2cdca229c3df8b5d05b0731d43f5d3fd/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b67ee984d54d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wget a Grep!]]></title>
            <link>https://medium.com/@kyleandrews_10470/wget-a-grep-84385812d76a?source=rss-6b839b0c1edb------2</link>
            <guid isPermaLink="false">https://medium.com/p/84385812d76a</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Kyle Andrews]]></dc:creator>
            <pubDate>Tue, 31 Oct 2017 17:05:12 GMT</pubDate>
            <atom:updated>2017-10-31T17:05:12.772Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FwcgMZsFyRVYDm%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fmovie-animation-film-wcgMZsFyRVYDm&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FwcgMZsFyRVYDm%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="176" frameborder="0" scrolling="no"><a href="https://medium.com/media/bc9214101d2e55616525b3c311e31032/href">https://medium.com/media/bc9214101d2e55616525b3c311e31032/href</a></iframe><h3>So it begins…</h3><p>Hey all, this is a story about me not know what I’m doing. This previous week we had to partner up and work on a project in rails. I was pretty excited! My parter was/is the bees knees (and carried me throughout the project tbh…).</p><p>I was tasked with the… task(?) to scrap a site for a movie title and link to build seeds for our program…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl1J9qpVW7yJOLBAM8%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl1J9qpVW7yJOLBAM8%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl1J9qpVW7yJOLBAM8%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="241" frameborder="0" scrolling="no"><a href="https://medium.com/media/57c81fce43d7f46d17ea2651ca148f49/href">https://medium.com/media/57c81fce43d7f46d17ea2651ca148f49/href</a></iframe><h3>The Scrapening</h3><p>Honestly I wasn’t even at intermediate level when it comes to parsing an api, let alone scraping a site, but it had to be done. There’s a option of doing this via Nokogiri or another gem that gives you the option to pull information from a website, and I tried it but it was giving me guff.</p><p>This brought me to another option, doing all of the work directly through the command line. To do this I used “wget”, a Linux(Unix) based program that retrieves content from web servers. I partnered this with another program “grep” to actually do the heavy lifting of sorting through that information to get what we needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*H-40mvmwyAQoMTmzWz8xAg.png" /></figure><p>Below is the return of the above wget request which gave me all of the information from the entire site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GsYteKBFromBv3fgXKtcLA.png" /></figure><p>Using “wget — mirror”, also does both will recursively sort through the entire site and “mirror” the site as a file in whatever folder of your choosing.</p><p>Then, using grep I was able to search for the pattern I was looking for and sore that in a separate file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*EVfqqm4s-zyT-Gy76ZkCQg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9erSkW9SIbrsQz0npDQc1w.png" /></figure><p>Once you have the needed information you can pretty much do whatever you need whether it’s collecting links or whatever practical uses you’d have for the info.</p><p>While I believe this is an interesting way of scraping a site, I’m not sure if this would be my go to method as it stores copies of the website on your computer each time. I do believe that this it would be a good option if you’d need to operate solely on the command line.</p><h3>The End.</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84385812d76a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parse the Courvoisier!]]></title>
            <link>https://medium.com/@kyleandrews_10470/parse-the-courvoisier-e4bdf0640e53?source=rss-6b839b0c1edb------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4bdf0640e53</guid>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Kyle Andrews]]></dc:creator>
            <pubDate>Tue, 10 Oct 2017 16:18:32 GMT</pubDate>
            <atom:updated>2017-10-10T16:18:32.579Z</atom:updated>
            <content:encoded><![CDATA[<iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F82zGal8nerhBu%2Ftwitter%2Fiframe&amp;url=https%3A%2F%2Fgiphy.com%2Fgifs%2Fmusic-video-mtv-82zGal8nerhBu&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F82zGal8nerhBu%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="321" frameborder="0" scrolling="no"><a href="https://medium.com/media/2e4599ece34173746ea09921703fc2f2/href">https://medium.com/media/2e4599ece34173746ea09921703fc2f2/href</a></iframe><p><strong>What is Parsing?</strong></p><p>A loose definition of parsing, in terms of how we’ve used it up until this point, would be translating data stored as JSON, and converting it to readable/accessible Ruby code.</p><p>Day one we got a taste of manipulating API data via our APIs and Iterations paring lab. During this lab we utilized RESTClient, to fetch data from the Star Wars API:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*un4kFy1slpUhhH1fnxG3SA.png" /></figure><p>At the time, I thought this was the only way we could access data stored this way. WRONG. There happen to be multiple ways to parse data via Ruby. During a lecture from Es (an instructor for the program), I noticed that he used a gem called HTTParty. This led me down a rabbit hole to determine once and for all which is the better method… After using it for a group project utilizing a liquor api:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*rMPhOBb1W7_QL1EOb4Jn-A.png" /></figure><h4><strong>RESTClient Vs. HTTParty</strong></h4><p><strong>Install</strong>:</p><p>The installation for both is pretty simple. Both can be attained by using a gem install and requiring the gem in your files.</p><h4>Use:</h4><p>Overall usage for parsing the data is pretty simple, using GET method:</p><p><strong>RestClient.get(“url”)</strong></p><p>or</p><p><strong>HTTParty.get(“url)</strong></p><p>Both have additional applications that can be accesses using these gems i.e. (Post, Delete, Put, Patch…). Most of which have we haven’t covered in class just yet regarding functionality.</p><p><strong>Main difference between the two?</strong></p><p>With RestClient, you still need the ‘json’ library to make use of RestClient.</p><p>In closing. The there isn’t tooooo much difference between the two of this programs. It really boils down to what you like best.Apparently, there is a factor of whether our not a site is completely “RESTful” or not, but that’s another story entirely.</p><p><strong>The End.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4bdf0640e53" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Know Your SELF!]]></title>
            <link>https://medium.com/@kyleandrews_10470/know-your-self-394c95147571?source=rss-6b839b0c1edb------2</link>
            <guid isPermaLink="false">https://medium.com/p/394c95147571</guid>
            <category><![CDATA[ruby]]></category>
            <dc:creator><![CDATA[Kyle Andrews]]></dc:creator>
            <pubDate>Fri, 29 Sep 2017 12:44:07 GMT</pubDate>
            <atom:updated>2017-09-29T12:44:07.355Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*a2kVGPdKIoc5W0vOY8y5-w.png" /></figure><p>What is Pry?</p><p>Pry is an alternative to IRB in your terminal. It’s Pretty powerful tool that allows for us to debug our program and provides an environment for us to test out our code.</p><p>Up until very recently I hadn’t really used Pry as part of my debugging tool belt. What changed that was understanding the concept of Has Many Through. It took Nick (in my cohort) to open up pry on and it started with this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*DsoS0uXddPbBdUL86JU9RQ.png" /></figure><p>This change my while approach to learning. I initially would lean the process and that worked for a while and that worked, until it didn’t. Pry showed me the importance understanding what and why everything did what it did.</p><p>After that I delved a bit into all of the functionality of pry and realized just how much range it has. Below are just a few commands that I wasn’t aware of that may help you along the way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/1*HjBafVRWVlY2HBvY-3zu6g.png" /></figure><p>Helpful Commands:</p><p>ls: Lists everything in the file.</p><p>ls -i: Lists all Instance variable</p><p>ls -c: All Constants</p><p>ls -l: All Local variables</p><p>ls -M: All the Class methods</p><p>ls -m: All Instance methods</p><p>show-method: You can pull up any method in the file whether you’ve set the binding.pry there or not.</p><p>Ultimately, there are many great uses for Pry and this post doesn’t even cover have of them. With that said, I do believe the best place to start, is with knowing your Self.</p><p>Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=394c95147571" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>