<?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: Cory Miller</title>
    <description>The latest articles on DEV Community by Cory Miller (@corydhmiller).</description>
    <link>https://dev.to/corydhmiller</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%2F224198%2Fc487420a-93e9-4593-a599-98d0edeb2e00.png</url>
      <title>DEV Community: Cory Miller</title>
      <link>https://dev.to/corydhmiller</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/corydhmiller"/>
    <language>en</language>
    <item>
      <title>Why are you not using HTTPS?</title>
      <dc:creator>Cory Miller</dc:creator>
      <pubDate>Thu, 19 Sep 2019 14:25:16 +0000</pubDate>
      <link>https://dev.to/corydhmiller/why-are-you-not-using-https-5f3i</link>
      <guid>https://dev.to/corydhmiller/why-are-you-not-using-https-5f3i</guid>
      <description>&lt;p&gt;It's 2019 and I still see websites not utilizing HTTPS on their websites. &lt;/p&gt;

&lt;p&gt;I see websites with the &lt;em&gt;option&lt;/em&gt; for HTTPS, but they don't force HTTPS.&lt;/p&gt;

&lt;p&gt;Look, I get it. SSL certificates used to be a bit more out of reach for the common web developer.&lt;/p&gt;

&lt;p&gt;It's easier now. You can get a Let's Encrypt certificate pretty much anywhere, any time. You can easily pop a few lines of code and force HTTPS. Hell, most web hosts can do this &lt;em&gt;for you&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Why? &lt;a href="https://www.cloudflare.com/learning/ssl/why-is-http-not-secure/"&gt;Because your site is not secure with http&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Get a certificate and get your site secure.&lt;/p&gt;

&lt;p&gt;You don't want to be the person who regrets not doing it sooner.&lt;/p&gt;

</description>
      <category>security</category>
    </item>
    <item>
      <title>I hate time tracking, so I tracked my time.</title>
      <dc:creator>Cory Miller</dc:creator>
      <pubDate>Mon, 16 Sep 2019 19:10:20 +0000</pubDate>
      <link>https://dev.to/corydhmiller/i-hate-time-tracking-so-i-tracked-my-time-5578</link>
      <guid>https://dev.to/corydhmiller/i-hate-time-tracking-so-i-tracked-my-time-5578</guid>
      <description>&lt;p&gt;I really hate personal micro managing and time tracking, but I was intrigued by some of the stories a recent team meeting so I bought a little booklet today and decided to just add a 2-5 word log entry every time I did something, changed focus/context, or anything that kind of struck me as needing logging. &lt;/p&gt;

&lt;p&gt;Here’s my favorite segment from the day:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10:00 - Begin deploy 1.18
10:15 - Complete deploy
10:19 - Revert deploy
10:25 - Attempt re-deploy
10:30 - Nope
10:37 - Found problem
10:42 - Redeploy
10:59 - Deploy again
11:06 - It worked!
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Also this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;12:24 - Rant about idiots
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It was a good day.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Considering scalability in small updates and features</title>
      <dc:creator>Cory Miller</dc:creator>
      <pubDate>Mon, 09 Sep 2019 08:13:17 +0000</pubDate>
      <link>https://dev.to/corydhmiller/considering-scalability-in-small-updates-and-features-3344</link>
      <guid>https://dev.to/corydhmiller/considering-scalability-in-small-updates-and-features-3344</guid>
      <description>&lt;p&gt;It's fairly easy to add updates to your code to solve an issue. It's easy to get a directive from a director or project leader or even a request from a teammate and simply execute it. &lt;/p&gt;

&lt;p&gt;The challenge comes in looking at problems from a standpoint of future proofing. No code is perfectly future proof, of course, but it's worth consideration. &lt;/p&gt;

&lt;p&gt;Recently I was asked to add some tracking functionality to one of our form submissions. In and of itself, it wouldn't take too long, but I started to wonder.&lt;/p&gt;

&lt;p&gt;What if we needed to do the same to future forms? Would I always have to dive back into the code in the future? &lt;/p&gt;

&lt;p&gt;The cost of making this sort of functionality so specific just for the sake of speed today could very well cost additional time in the future.&lt;/p&gt;

&lt;p&gt;Instead, I'm spending time now looking into making this sort of functionality apply to all of our forms, or at least provide the opportunity for it to do so. It might be taking me longer now, but having this capability will be truly helpful in the long term. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Measure the nature of your work and determine if a short term solution is truly worth it.&lt;/strong&gt; If you can spend more time on it now to save you more time later, that may be worth your time investment alone.&lt;/p&gt;

</description>
      <category>codequality</category>
      <category>productivity</category>
    </item>
    <item>
      <title>The danger of using --force in git</title>
      <dc:creator>Cory Miller</dc:creator>
      <pubDate>Thu, 05 Sep 2019 08:23:25 +0000</pubDate>
      <link>https://dev.to/corydhmiller/the-danger-of-using-force-in-git-2h2i</link>
      <guid>https://dev.to/corydhmiller/the-danger-of-using-force-in-git-2h2i</guid>
      <description>&lt;p&gt;Yesterday I had one of those days when my life seemed to flash before my eyes. I was staring at my branch's logs, wondering why all of the previous day's work was nowhere to be found.&lt;/p&gt;

&lt;p&gt;I started to panic, running &lt;code&gt;git log&lt;/code&gt; and &lt;code&gt;git reflog&lt;/code&gt; but for the life of me I couldn't figure out why nothing had been saved. I was &lt;em&gt;sure&lt;/em&gt; I had saved my work and committed it, so why now was I looking at my code in the state it was two days prior?&lt;/p&gt;

&lt;p&gt;I had made several errors before coming to this realization, and the culmination of these mistakes led to a lot of important work being lost.&lt;/p&gt;

&lt;p&gt;Here are a few tips on how to prevent simple mistakes like the ones I made.&lt;/p&gt;

&lt;h3&gt;
  
  
  Don't do complicated work when you're tired.
&lt;/h3&gt;

&lt;p&gt;To be honest, I don't really know what I was thinking for most of yesterday. I had slept quite poorly the previous night and thought I could just power through. &lt;/p&gt;

&lt;p&gt;Powering through might be possible some days, but when your brain is tired you are more likely to make mistakes, and mistakes can cost.&lt;/p&gt;

&lt;p&gt;Take some time and get your head clear throughout your day. Take frequent breaks and step away from the computer so you can come back to your code with a clear head. If possible, take a power nap or two.&lt;/p&gt;

&lt;p&gt;Most importantly, protect your sleep and rest times, because it's more than just getting X amount of hours at night. Tiredness has the capability to really trash your work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Make a process and stick to it.
&lt;/h3&gt;

&lt;p&gt;I confess I was sloppy with my commands. I had recently purchased a new laptop so I'd been in the process of getting it all set up with apps and 1Password and SSH keys and everything in between. Part of that included getting synced with our repos on GitHub.&lt;/p&gt;

&lt;p&gt;I still don't know exactly which set of commands I used to sync that day's work with the online repo, but that's actually the crux of the issue. The fact that I don't remember if I &lt;code&gt;git pull&lt;/code&gt;'d or &lt;code&gt;git push&lt;/code&gt;'d or even checked which branch had the latest version of the code is really where I went wrong.&lt;/p&gt;

&lt;p&gt;Because I didn't have a process written down, I just sort of made it happen. I figured I knew what I was doing, so why bother with the complicated checks?&lt;/p&gt;

&lt;p&gt;We bother with checking ourselves because we're human and we make mistakes.&lt;/p&gt;

&lt;p&gt;Even if I had something as simple as a process for "What to do when you &lt;code&gt;git pull&lt;/code&gt; and there's a discrepancy" or "When your local repo is behind and ahead of the origin repo", it could have saved me some real headache.&lt;/p&gt;

&lt;p&gt;In any case, I slapped around some commands and figured it would be okay. It wasn't.&lt;/p&gt;

&lt;p&gt;Dialing in processes and writing them down can help to prevent occurence (and reoccurrence) of problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Don't use &lt;code&gt;--force&lt;/code&gt; unless there is literally no other option.
&lt;/h3&gt;

&lt;p&gt;...and then still look for another option.&lt;/p&gt;

&lt;p&gt;Then there's this part of the story that I'm truthfully deeply embarrassed about. At one point I was 100% confident that my local copy of the branch was most up to date, so when there was one of those &lt;code&gt;your branch is 5 commits ahead and 6 behind&lt;/code&gt; messages, I figured I could just bypass the issue by forcing my local history to the remote repo.&lt;/p&gt;

&lt;p&gt;So I ran &lt;code&gt;git push --force&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Lo and behold, it did exactly what I had told it to do and overwrote the history on the remote branch.&lt;/p&gt;

&lt;p&gt;This was early on in the day, and I didn't think much of it as I went about other tasks. That is, until I sat down to work on my branch and found all of my work missing.&lt;/p&gt;

&lt;p&gt;To be fair, I don't know &lt;em&gt;why&lt;/em&gt; my local branch wasn't on the latest code. I had absolutely saved and committed the work, so I am still perplexed, but in either case, there was something huge about what I did that made all the difference.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When &lt;code&gt;git&lt;/code&gt; gives you warnings, it's probably your fault.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I wanted the shortcut rather than putting in just a few extra minutes to check the branches and logs, see where the discrepancy was, and if &lt;em&gt;anything&lt;/em&gt; make a quick branch copy just in case.&lt;/p&gt;

&lt;p&gt;Shortcuts in the processes of development can help save time but they can also lead to serious mistakes. Stick with the process, do it right, and save yourself some headache.&lt;/p&gt;

&lt;h2&gt;
  
  
  And yet somehow I got my code back.
&lt;/h2&gt;

&lt;p&gt;There's a happy ending to this madness. We run our code through a continuous integration and testing suite before it gets deployed, so after I had died a thousand deaths over the span of about 20 minutes I thought to check there to see if I had truly committed and pushed my updates the previous day.&lt;/p&gt;

&lt;p&gt;Thankfully, I had! GitHub has a great thing I didn't know about where it saves every commit that is pushed, even if that history has been overwritten. At least, that's how it seems it works, someone can fact check me on that. Either way, even though the commit wasn't in the branch history, I was still able to access it and get my code back, saving me another day or two of work.&lt;/p&gt;

&lt;p&gt;I don't want to count on miracles like this, so I'm sticking with the process from hereon out and working to make &lt;em&gt;new&lt;/em&gt; mistakes instead of repeating old ones.&lt;/p&gt;

&lt;p&gt;And I need to automate some sort of macro on my computer that deletes &lt;code&gt;--force&lt;/code&gt; every time I type it.&lt;/p&gt;

</description>
      <category>git</category>
    </item>
  </channel>
</rss>
