<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: lughjw</title>
    <description>The latest articles on DEV Community by lughjw (@lughjw).</description>
    <link>https://dev.to/lughjw</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F335842%2Fb7cf93bb-3a6d-49c2-8f84-791640bab7c0.png</url>
      <title>DEV Community: lughjw</title>
      <link>https://dev.to/lughjw</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lughjw"/>
    <language>en</language>
    <item>
      <title>The importance of planning</title>
      <dc:creator>lughjw</dc:creator>
      <pubDate>Fri, 22 May 2020 17:29:00 +0000</pubDate>
      <link>https://dev.to/lughjw/the-importance-of-planning-1k4c</link>
      <guid>https://dev.to/lughjw/the-importance-of-planning-1k4c</guid>
      <description>&lt;p&gt;Recently I started undertaking the my first project large enough that I couldn't keep it all straight in my head. I got part way through my project and realized I had lost my vision and kept getting frustrated. Planning is a constant struggle for me. I find it tedious and if I don't have to do it I won't. But for this project I had to. I found this task organizer called &lt;a href="https://habitica.com/static/home"&gt;Habitica&lt;/a&gt; which gamifies the experience and has made it a lot easier.&lt;/p&gt;

</description>
      <category>planning</category>
    </item>
    <item>
      <title>A React Router Bug Tip</title>
      <dc:creator>lughjw</dc:creator>
      <pubDate>Tue, 28 Apr 2020 16:45:00 +0000</pubDate>
      <link>https://dev.to/lughjw/a-react-router-bug-tip-4ej4</link>
      <guid>https://dev.to/lughjw/a-react-router-bug-tip-4ej4</guid>
      <description>&lt;p&gt;I started learning React recently and wanted to focus on the Router component. Here I'll post a few things I learn as I go through it. I'll update this as I come across new tidibts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you're clicking on a Link and it's not taking you anywhere but it is changing your url, then check to make sure that the link is within your Router component (Be that a BrowserRouter, HashRouter, MemoryRouter, etc). It can be nested within children which are in the Router, but needs to be within the Router. An example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;Router&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;NavBar&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;Route&lt;/span&gt; &lt;span class="na"&gt;exact&lt;/span&gt; &lt;span class="na"&gt;path=&lt;/span&gt;&lt;span class="s"&gt;"/"&lt;/span&gt; &lt;span class="na"&gt;render=&lt;/span&gt;&lt;span class="s"&gt;{(props)&lt;/span&gt; &lt;span class="err"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;MyComponent&lt;/span&gt; &lt;span class="err"&gt;{...&lt;/span&gt;&lt;span class="na"&gt;props&lt;/span&gt;&lt;span class="err"&gt;}&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;} /&amp;gt;
    {/* Other Routes here */}
&lt;span class="nt"&gt;&amp;lt;/Router&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>react</category>
    </item>
    <item>
      <title>Connecting two remote repositores to a single project</title>
      <dc:creator>lughjw</dc:creator>
      <pubDate>Mon, 27 Apr 2020 00:30:58 +0000</pubDate>
      <link>https://dev.to/lughjw/connecting-two-remote-repositores-to-a-single-project-2133</link>
      <guid>https://dev.to/lughjw/connecting-two-remote-repositores-to-a-single-project-2133</guid>
      <description>&lt;p&gt;I have a project I'm working on which will be deployed to heroku, however I would also like to keep a copy on github since that's my primary portfolio storage. It's simpler than you would think. Without further ado, let's get to it.&lt;/p&gt;

&lt;p&gt;Here's what needs to happen to get multiple remote repositores.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create your local git file.&lt;/li&gt;
&lt;li&gt;Create your remote repositories.&lt;/li&gt;
&lt;li&gt;Create git path which pushes to both.&lt;/li&gt;
&lt;/ol&gt;




&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Creating a local git file is easy. &lt;code&gt;cd&lt;/code&gt; into where you want your git file to live. Run &lt;code&gt;git init&lt;/code&gt; to create an empty local git.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For github here are &lt;a href="https://help.github.com/en/enterprise/2.14/user/articles/creating-a-new-repository"&gt;instructions to create a new github repository&lt;/a&gt;. Once, your github repository has been created you can connect it to your project with &lt;code&gt;git remote add github your-github-repository-URL&lt;/code&gt;. This will create a connection named github to your github repository located at your-github-repository-URL. Feel free to use a different name than github for your connection, but in this guide that will be the name I use for future commands.&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;
For heroku, if you don't have an account you can read my guide on connecting a heroku account to a project &lt;a href="https://dev.to/lughjw/deploying-to-heroku-1c3p"&gt;here&lt;/a&gt;. Otherwise, if you do have a heroku account and heroku CLI, in the same directory as your .git folder in your terminal you can enter &lt;code&gt;heroku create&lt;/code&gt; to create a remote repository and link your project in one step.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now that you have two separate channels to push to, lets make a joint path. We'll create a new remote path named 'all' and initialize it with the github repository. You can choose either one as your primary, but I prefer github since it takes less time to upload to. So to add a path we do what we did before.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git remote add all your-github-repository-URL
$ git remote set-url --add --push all your-github-repository-URL
$ git remote set-url --add --push all your-heroku-git-repository-URL
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can verify it by entering &lt;code&gt;git remote -v&lt;/code&gt; which will print out the paths in git directory. Now all you have to do to push to both repositories is&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git add .
$ git commit -m "make your change comments here"
$ git push all
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>git</category>
      <category>heroku</category>
      <category>github</category>
    </item>
    <item>
      <title>Deploying to heroku</title>
      <dc:creator>lughjw</dc:creator>
      <pubDate>Sun, 26 Apr 2020 00:00:38 +0000</pubDate>
      <link>https://dev.to/lughjw/deploying-to-heroku-1c3p</link>
      <guid>https://dev.to/lughjw/deploying-to-heroku-1c3p</guid>
      <description>&lt;p&gt;
This will be a basic intro into deploying a heroku. I will try to make this as general as possible.&lt;/p&gt;
&lt;p&gt;
I'm going to start off by listing the steps/commands and then going into detail for each one.
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create something you want to deploy&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://signup.heroku.com/"&gt;Create heroku account&lt;/a&gt; and &lt;a href="https://devcenter.heroku.com/articles/heroku-cli#download-and-install"&gt;install heroku CLI&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git"&gt;Install git&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;heroku login&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;heroku create&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git commit -m "initial commit"&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git push heroku master&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Enjoy!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;
Alright, let's get started!
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;h3&gt;Create something you want to deploy&lt;/h3&gt;
&lt;p&gt; 
From 
&lt;a href="https://devcenter.heroku.com/articles/how-heroku-works"&gt;How Heroku Works&lt;/a&gt;: 
"Heroku lets you deploy, run and manage applications written in Ruby, Node.js, Java, Python, Clojure, Scala, Go and PHP." Create a basic skeleton of an application in one of those and lets get started.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;Create heroku account and install heroku CLI&lt;/h3&gt;
&lt;p&gt;
Navigate to &lt;a href="https://signup.heroku.com/"&gt;heroku's signup page&lt;/a&gt; and create an account. While you're there also &lt;a href="https://devcenter.heroku.com/articles/heroku-cli#download-and-install"&gt;install the heroku CLI&lt;/a&gt;. 
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;Install git&lt;/h3&gt;
&lt;p&gt; Follow the instructions for your system &lt;a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;Heroku login&lt;/h3&gt;
&lt;p&gt;Navigate back to the top folder of your project. Lets say that it's called myApp, I would do &lt;code&gt;cd myApp&lt;/code&gt;. Now that I'm there I would do &lt;code&gt;heroku login&lt;/code&gt;. This will give a prompt saying "heroku: Press any key to open up the browser to login or q to exit: ". Press any key and a page will pop up asking you to confirm login. Click the "Log In" button and you're ready to move on.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;Create heroku repository&lt;/h3&gt;
&lt;p&gt; &lt;strong&gt;Note: If you have a front end and a back end using separate languages (i.e. React frontend with Rails backend) then you will need to create a heroku repository for each one!!!&lt;/strong&gt; Navigate to the top folder of your app. In your terminal enter &lt;code&gt;heroku create&lt;/code&gt;. The previous command also has an optional argument which is what you want to name your heroku repository, this will fail if it's not a unique name to heroku. That's it. You can verify this with &lt;code&gt;git remote -v&lt;/code&gt; which will return the url of your heroku repository.
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;h3&gt;Put your code up to heroku&lt;/h3&gt;
&lt;p&gt;
In your terminal enter
&lt;/p&gt;
&lt;pre&gt;
git add.
git commit -m "initial commit"
git push heroku master
&lt;/pre&gt;
Now sit back and wait. Go get a snack,coffee,etc. It takes a while for it to upload.
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Congratulations! You did it! Now go enjoy writing your new app!&lt;/p&gt;

</description>
      <category>heroku</category>
    </item>
    <item>
      <title>ActiveRecord: Some Quick Tips</title>
      <dc:creator>lughjw</dc:creator>
      <pubDate>Fri, 14 Feb 2020 19:54:55 +0000</pubDate>
      <link>https://dev.to/lughjw/activerecord-some-quick-tips-35gp</link>
      <guid>https://dev.to/lughjw/activerecord-some-quick-tips-35gp</guid>
      <description>&lt;p&gt;The rules:&lt;br&gt;
Base classes are memory objects&lt;br&gt;
Migration classes are what's stored in the database&lt;br&gt;
They only exist in conjunction because of ActiveRecord magic&lt;/p&gt;

&lt;p&gt;A short and sweet background on ActiveRecord concepts. ActiveRecord::Base classes hold the object representation that will be held in memory. ActiveRecord::Migration classes hold how the object is represented in the database. Understanding these things is what finally made me stop wanting to throw my laptop across the room when using ActiveRecord.&lt;/p&gt;

&lt;p&gt;Any time you have something that you don't care if it gets lost when you save it, store it in a base file. If you don't want to lose it when it's restored then make sure there's a variable for it in the database.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
