<?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>Forem: Audrey Hayes</title>
    <description>The latest articles on Forem by Audrey Hayes (@snackattack).</description>
    <link>https://forem.com/snackattack</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%2F137495%2F66fd1d8e-7f5a-4d57-90b5-aa12df632dee.jpg</url>
      <title>Forem: Audrey Hayes</title>
      <link>https://forem.com/snackattack</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/snackattack"/>
    <language>en</language>
    <item>
      <title>Glossary of Software Development Terms</title>
      <dc:creator>Audrey Hayes</dc:creator>
      <pubDate>Thu, 15 Oct 2020 10:10:56 +0000</pubDate>
      <link>https://forem.com/snackattack/glossary-of-software-development-terms-442m</link>
      <guid>https://forem.com/snackattack/glossary-of-software-development-terms-442m</guid>
      <description>&lt;h1&gt;
  
  
  Why a glossary?
&lt;/h1&gt;

&lt;p&gt;When I first entered the field of software development, one of the biggest barriers to overcome was being unfamiliar with the many words seasoned developers used daily. &lt;/p&gt;

&lt;p&gt;I'd like to help out newer generations of juniors by collating a list of helpful terms to be aware of when you are trying to land that first job.&lt;/p&gt;

&lt;p&gt;Many of the terms listed below are, of course, highly dependant on the area of software development you work in as well as the particular lingo used in your workplace. I've attempted to keep them as general as possible. &lt;/p&gt;

&lt;p&gt;Please shout out in the comments if you have suggestions of terms to add or alternative definitions for the ones I've already included!&lt;/p&gt;

&lt;h1&gt;
  
  
  Glossary
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Build
&lt;/h3&gt;

&lt;p&gt;'Building' is a fairly general term, and it can refer to anything that is needed to go from editable source material (source code, scripts, raw data files, etc.) to a shippable software product. Building can (and usually does) involve several steps, such as pre-processing, compiling, linking, converting data files, running automated tests, packaging, etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  Build Pipeline
&lt;/h3&gt;

&lt;p&gt;A pipeline is a set of automated processes that allow developers to reliably and efficiently compile, build and deploy their code to their production platforms. The pipeline process is often referred to as CI/CD (Continuous Integration/Continuous Development). The process is generally run automatically when deploying a piece of software (see 'Deploy' definition).&lt;/p&gt;

&lt;h3&gt;
  
  
  Compile
&lt;/h3&gt;

&lt;p&gt;The act of taking a higher-level language (like TypeScript) and translating it into a language that a platform understands (such as JavaScript if you want your code to run on a browser platform)&lt;/p&gt;

&lt;h3&gt;
  
  
  Dependencies
&lt;/h3&gt;

&lt;p&gt;Pieces of software external to your program that your program uses in order to run. There are 'dev dependencies', which are pieces of software (i.e. libraries, frameworks, packages) that are only used during the initial stages of writing source code (the development stage). A linting tool is an example of a dev dependency. They are generally removed during the build process in order to make a deployed program smaller. Dependencies required in order for the deployed program to run in production are kept.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deploy
&lt;/h3&gt;

&lt;p&gt;To take built artefacts (the results from 'building') and either copy them to a server, or execute them on a server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Linting
&lt;/h3&gt;

&lt;p&gt;The automated checking of source code for programmatic and stylistic errors.&lt;/p&gt;

&lt;h3&gt;
  
  
  Minification
&lt;/h3&gt;

&lt;p&gt;The process of removing unnecessary spaces and line breaks while shortening variable and function names to optimise file size. It’s one of the main methods used to reduce load times and bandwidth usage on websites.&lt;/p&gt;

&lt;h3&gt;
  
  
  Module Bundler
&lt;/h3&gt;

&lt;p&gt;A tool that takes pieces of code (i.e. Javascript) and its dependencies and bundles them into a single file, usually for use in the browser. Popular module bundlers are &lt;a href="https://webpack.js.org/"&gt;webpack&lt;/a&gt;, &lt;a href="http://browserify.org/"&gt;browserify&lt;/a&gt;, and &lt;a href="https://rollupjs.org/guide/en/"&gt;rollup&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Package Manager
&lt;/h3&gt;

&lt;p&gt;A package manager is a programming language’s tool to create project environments and easily import external dependencies. For example, &lt;a href="https://www.npmjs.com/"&gt;npm&lt;/a&gt; is a package manager for &lt;a href="https://nodejs.org/en/"&gt;node&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Preprocessor
&lt;/h3&gt;

&lt;p&gt;A program that translates input data into output data that is then used in another program (like a compiler). A preprocessor can also add functionality that doesn't natively exist in the output language.&lt;/p&gt;

&lt;p&gt;A CSS preprocessor (like &lt;a href="https://sass-lang.com/"&gt;Sass&lt;/a&gt;) is a program that lets you generate CSS from the preprocessor's own unique syntax.&lt;/p&gt;

&lt;h3&gt;
  
  
  Release
&lt;/h3&gt;

&lt;p&gt;Distributing software to the end user or consumer. In CI/CD (see 'Build' definition), a release is made any time a piece of software is updated. They are associated with a specific version number or name (see 'Versioning' definition).&lt;/p&gt;

&lt;h3&gt;
  
  
  Task Runner
&lt;/h3&gt;

&lt;p&gt;A way of automating common tasks. &lt;a href="https://gulpjs.com/"&gt;Gulp&lt;/a&gt; is an example of a task runner.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transpile
&lt;/h3&gt;

&lt;p&gt;A specific term for taking source code written in one language and transforming into another language that has a similar level of abstraction. It can also mean translating from one version to another version in the same language (i.e. transpiling JavaScript version ES6 into ES5).&lt;/p&gt;

&lt;h3&gt;
  
  
  Versioning
&lt;/h3&gt;

&lt;p&gt;The act of assigning unique version names or unique numbers to a release (see 'Release' definition). To make version descriptions more cohesive across the field of software development, there are versioning schemes widely used such as &lt;a href="https://semver.org/"&gt;SemVer&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Watching
&lt;/h3&gt;

&lt;p&gt;The act of a program 'watching' for changes in your source code and then taking some kind of action when a change is detected. Actions taken could be re-building your source code or reloading the browser to show new changes.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>juniors</category>
      <category>software</category>
    </item>
    <item>
      <title>🔐 Intro to managing secrets using Mozilla SOPS 🔐</title>
      <dc:creator>Audrey Hayes</dc:creator>
      <pubDate>Sat, 02 May 2020 16:38:46 +0000</pubDate>
      <link>https://forem.com/snackattack/intro-to-managing-secrets-using-mozilla-sops-4afl</link>
      <guid>https://forem.com/snackattack/intro-to-managing-secrets-using-mozilla-sops-4afl</guid>
      <description>&lt;p&gt;It should go without saying that secrets, such as passwords and API keys, should never be committed to any repository hosting services such as Github or GitLab in plaintext.  &lt;/p&gt;

&lt;p&gt;But how to share secrets with your team and maintain version control?&lt;/p&gt;

&lt;h2&gt;
  
  
  The old classic: Vault
&lt;/h2&gt;

&lt;p&gt;One solution is to provision a &lt;a href="https://www.vaultproject.io/"&gt;Vault&lt;/a&gt; server, which has built-in access control and secrets management. &lt;/p&gt;

&lt;p&gt;You can then write scripts to automatically fetch a project's secrets according to the current environment using Vault's API and know that a lot of the work to secure access to those secrets is being done for you.&lt;/p&gt;

&lt;h3&gt;
  
  
   Potential drawbacks
&lt;/h3&gt;

&lt;p&gt;However, the drawbacks to this approach are the additional overhead and cost to maintain Vault on a server (most likely on a Kubernetes cluster in the cloud). &lt;/p&gt;

&lt;p&gt;For small organisations without a dedicated DevOps team, you also need to have at least one expert on hand to maintain and debug the vault in the event it goes down, or more likely is "sealed". &lt;/p&gt;

&lt;p&gt;In fact, every time a node in the cluster is restarted by your cloud provider (which depending on your pricing options, can occur fairly regularly) it will automatically seal the vault and require someone to manually port-forward into the cluster to "unseal" it with the appropriate set of access keys. &lt;/p&gt;

&lt;p&gt;Relying on a secrets management system that affects every project when something goes wrong is less than ideal.&lt;/p&gt;

&lt;h2&gt;
  
  
  SOPS for the win (with caveats 😉)
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/mozilla/sops"&gt;Mozilla SOPS&lt;/a&gt; (short for Secrets OPerationS) is a neat little tool for encrypting files in formats such as YAML, JSON and ENV.&lt;/p&gt;

&lt;p&gt;For example, say you have a simple YAML file storing the following secret:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// values.yaml
super: secret
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can encrypt this file by running &lt;code&gt;sops -e -i values.yaml&lt;/code&gt;, which will output something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// values.yaml
super: ENC[AES256_GCM,data:PGCefhm7,iv:mjtXDC2EDTbjDurf0qAOS/OaUqgZs9RHAH6cTwjkXvc=,tag:CRtNcAZhOdv7G1tYfBIIOA==,type:str]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can now keep &lt;code&gt;values.yaml&lt;/code&gt; in your code repository in a much more human readable format that works will with version control (and makes git diffs much easier to handle).&lt;/p&gt;

&lt;p&gt;In order to decrypt this file, SOPS needs the correct keys. &lt;/p&gt;

&lt;p&gt;It pairs well with all the major cloud provider key management services so you can still reap the benefits of controlling access to the required keys to decrypt the files.&lt;/p&gt;

&lt;p&gt;You can then rotate keys and create key groups based on which environment you'd like to decrypt the file in. &lt;/p&gt;

&lt;p&gt;Pretty hand right?&lt;/p&gt;

&lt;p&gt;I've read that this approach does not scale up well, which might be a major drawback for larger teams or projects.&lt;/p&gt;

&lt;p&gt;Let me know in the comments if you've worked with SOPS and what your experience with it has been, good or bad!&lt;/p&gt;

</description>
      <category>security</category>
      <category>sops</category>
      <category>devops</category>
    </item>
    <item>
      <title>Improving a static site's performance</title>
      <dc:creator>Audrey Hayes</dc:creator>
      <pubDate>Sun, 19 Apr 2020 08:41:04 +0000</pubDate>
      <link>https://forem.com/snackattack/improving-a-static-site-s-performance-j99</link>
      <guid>https://forem.com/snackattack/improving-a-static-site-s-performance-j99</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I have a very &lt;a href="https://audreyhayes.dev/"&gt;simple one-page portfolio site&lt;/a&gt; that I built a couple of years ago when I was just starting to learn to code. I wanted to see if I could speed up the site's load time without losing too much of the site's simplicity (written in pure HTML &amp;amp; CSS).&lt;/p&gt;

&lt;h2&gt;
  
  
  Measuring the problem
&lt;/h2&gt;

&lt;p&gt;I already know from simply visiting the site that the lack of minification, unoptimised images and unnecessary requests to third-party resources via inline script tags and stylesheets are major issues causing the site to load far too slowly.&lt;/p&gt;

&lt;p&gt;But I still wanted some measured data to back up my own user experience on the site. So I audited the site using Google Chrome's &lt;em&gt;Lighthouse&lt;/em&gt; report.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qeKo9xBJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kaan9hbutzgj4w62lb8a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qeKo9xBJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kaan9hbutzgj4w62lb8a.png" alt="Lighthouse Audit report results"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ouch! I don't know if I've ever seen a performance score that low. The site definitely needs a facelift 😬.&lt;/p&gt;

&lt;h2&gt;
  
  
  Improving the site
&lt;/h2&gt;

&lt;p&gt;I decided to port the site over to &lt;a href="https://www.gatsbyjs.org/"&gt;Gatsby&lt;/a&gt; so I could leverage all the image processing power that it offers. By writing one GraphQL query, I was able to use &lt;code&gt;sharp&lt;/code&gt; to control the image sizes and render them fluidly directly from the local file system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export const useBackground = () =&amp;gt; {
    const result = useStaticQuery&amp;lt;BackgroundQuery&amp;gt;(graphql`
        query background {
            allFile(filter: { extension: { eq: "jpg" } }) {
                edges {
                    node {
                        base
                        childImageSharp {
                            fluid(fit: CONTAIN) {
                                aspectRatio
                                base64
                                originalName
                                sizes
                                src
                                srcSet
                            }
                        }
                    }
                }
            }
        }
    `);

    return {
        backgrounds: result.allFile.edges,
    };
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Although migrating the site to Gatsby was a breeze, it took a bit of logic to pass in a background color prop to the card component so I could render the correct background image for each card.&lt;/p&gt;

&lt;p&gt;This could probably be written more succinctly, but my goal was to complete this project in a day or less!&lt;/p&gt;

&lt;p&gt;I set the &lt;code&gt;backgroundColor&lt;/code&gt; prop as an &lt;code&gt;enum&lt;/code&gt; of &lt;code&gt;'mint' | 'orange' | 'pink' | 'teal' | 'yellow'&lt;/code&gt; which I then filtered to match the name of the &lt;code&gt;png&lt;/code&gt; file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    const { backgrounds } = useBackground();

    const filteredBackground = backgrounds.filter(
        background =&amp;gt;
            background.node.childImageSharp.fluid.originalName.slice(0, -4) === backgroundColor
    );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some additional improvements that I made:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;used &lt;a href="https://github.com/FortAwesome/react-fontawesome"&gt;react-fontawesome&lt;/a&gt; to pull in brand icons with an npm package rather than rely on a CDN&lt;/li&gt;
&lt;li&gt; moved the site to &lt;a href="https://www.netlify.com/"&gt;Netlify&lt;/a&gt; so I could deploy the site directly from the command line&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Measuring the results
&lt;/h2&gt;

&lt;p&gt;So how big were the performance gains made by these tweaks?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eM45runS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mxa4ewg2kx9j1ahcavbm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eM45runS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mxa4ewg2kx9j1ahcavbm.png" alt="Lighthouse Audit report results"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A pretty impressive return for an afternoon's work!&lt;/p&gt;

&lt;p&gt;Check out the full &lt;a href="https://github.com/snack-attack/portfolio"&gt;Github repo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gatsby</category>
      <category>graphql</category>
      <category>performance</category>
      <category>lighthouse</category>
    </item>
  </channel>
</rss>
