<?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: Jacqueline Binya</title>
    <description>The latest articles on DEV Community by Jacqueline Binya (@jacqueline).</description>
    <link>https://dev.to/jacqueline</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%2F238471%2F3fc2094d-fecf-4843-92ee-84189c3772d1.jpg</url>
      <title>DEV Community: Jacqueline Binya</title>
      <link>https://dev.to/jacqueline</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jacqueline"/>
    <language>en</language>
    <item>
      <title>Using SVGs in Vuejs made simple</title>
      <dc:creator>Jacqueline Binya</dc:creator>
      <pubDate>Fri, 29 Jan 2021 16:25:39 +0000</pubDate>
      <link>https://dev.to/jacqueline/using-svgs-in-vuejs-made-simple-2e1a</link>
      <guid>https://dev.to/jacqueline/using-svgs-in-vuejs-made-simple-2e1a</guid>
      <description>&lt;h2&gt;
  
  
  Images of the web
&lt;/h2&gt;

&lt;p&gt;The most commonly used image formats in the web include bitmap, svg and webp.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bitmap
&lt;/h3&gt;

&lt;p&gt;Bitmap images are made up from tiny dots called pixels. Each pixel is actually a square which is assigned a specific color and is arranged in a pattern to form the image. When you zoom in on a bitmap you can actually see each pixel. Image formats like JPEG, PNG and GIF are all bitmap. Bitmap format is suited for highly detailed images like photographs.&lt;/p&gt;

&lt;h3&gt;
  
  
  WebP
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/speed/webp" rel="noopener noreferrer"&gt;WebP&lt;/a&gt; is a highly perfomant image format created by Google it was created to replace bitmap.&lt;/p&gt;

&lt;h3&gt;
  
  
  SVG
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdi70zcupa%2Fimage%2Fupload%2Fv1611902092%2Fsvg-pic_qexrsj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdi70zcupa%2Fimage%2Fupload%2Fv1611902092%2Fsvg-pic_qexrsj.png" alt="SVG"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Scalable Vector Graphics (svg) is a vector image format are created from mathematical formula they don't come bundled with information about how they should be painted that can be computed in the rendering device. SVGs are lighter than bitmap and they are used to create sharp images which scale e.g icons, illustrations etc.&lt;/p&gt;

&lt;h4&gt;
  
  
  The syntax of SVG
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;SVG are defined in XML: a markup language.&lt;/li&gt;
&lt;li&gt;The diagram below shows an example of a SVG in raw code:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdi70zcupa%2Fimage%2Fupload%2Fv1610570036%2Fsvg-sample_k7bupk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fres.cloudinary.com%2Fdi70zcupa%2Fimage%2Fupload%2Fv1610570036%2Fsvg-sample_k7bupk.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lets analyse the definition:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;💡SVG usually consists of a variety of elements e.g. &amp;lt;path&amp;gt;, &amp;lt;/style&amp;gt;,&amp;lt;circle&amp;gt; etc. nested inside an svg element. The inner elements enclosed inside the svg tags are used to describe specific properties of the SVG whereas the outer svg element which is normally referred to as the root element basically instantiate and terminate an instance of SVG.The root element may contain attributes like viewBox,  class, id, fill, height, width and xmlns. The id and class attributes are usually used to extend functionality in Javascript or to style the svg element. The id attribute may also be used in XML specific configurations like the setting up of links. The xmlns attribute is a XML namespace, it is used by the browser to determine how to render the SVG.&lt;/code&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Using SVGs in Vuejs
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Generally SVGs can can be incorporated in an HTML document:

&lt;ul&gt;
&lt;li&gt;inline or,&lt;/li&gt;
&lt;li&gt;as external standalone files.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;The above listed methods can be used in Vuejs.&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;But before we explore how we can incorporate SVG in a Vuejs web app. First let us create a simple Vuejs application we will use to demonstrate how to embed SVG in Vuejs.&lt;/p&gt;

&lt;p&gt;We will be using Vue CLI to bootstrap our project.&lt;/p&gt;

&lt;p&gt;Requirements:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Nodejs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cli.vuejs.org/" rel="noopener noreferrer"&gt;Vue CLI&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To create a Vuejs project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;On your terminal type:
```
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;vue create &lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Replace `&amp;lt;project-name&amp;gt;` with a unique name for your project. My project is name `svg-tutorial`.
- You will then be prompted to pick a preset for your app, just press Enter to choose the default preset which at the time of publishing this article is: `Default ([Vue 2] babel, eslint)`.
- Then wait as Vue CLI creates a Vuejs project for you.
- When you project is successfully created🎉, you will get the message below in your terminal:
![Successful vuejs project created](https://res.cloudinary.com/di70zcupa/image/upload/v1611909294/sucesssful-vuejs-install_ddlvl7.png)
The message contains handy commands to get you started!
- Let's take a look at our project's file structure paying special attention to the `src` folder since most of our work pertaining to SVG will be restricted to that folder.

&amp;lt;pre&amp;gt;
.
├── babel.config.js
├── node_modules
├── package.json
├── package-lock.json
├── public
├── README.md
└── src
    ├── App.vue
    ├── assets
    │   └── logo.png
    ├── components
    │   └── HelloWorld.vue
    └── main.js
&amp;lt;/pre&amp;gt;

- I have created a sample SVG to use in the interactive examples provided.. You may go ahead and download it by clicking this
&amp;lt;a href="https://raw.githubusercontent.com/JackieBinya/svg-resource-blog/main/sample.svg" download="sample" class="article-link"&amp;gt;link&amp;lt;/a&amp;gt;.

You may choose to rename the file, then proceed to add it to the root of the `src/assets` folder, such that the structure of the `src` folder is similar to the one below:

&amp;lt;pre&amp;gt;
.
├── App.vue
├── assets
│   ├── logo.png
│   └── sample.svg
├── components
│   └── HelloWorld.vue
└── main.js
&amp;lt;/pre&amp;gt;

#### Inline SVG

![Inline SVG in Vuejs](https://res.cloudinary.com/di70zcupa/image/upload/v1611922129/inline-svg_jlerxx.png)

When using this method you include the `svg` directly in your markup. It's important to mention that when the `svg` is directly embedded in the document or template as in the case of Vuejs ,there is no need to include the `xlmns` attribute.

The pros of using this method are that you can use CSS to style your `svg` and use Javascript to extend its functionality just as you would a normal HTML element.

The main drawback of this method is that if your `svg` is large or when you have a lot of `svg` your template, your template becomes cluttered. In that case it would be better incorporate SVGs as standalone files as it is explained in the next section.

#### External SVG

To embed an external SVG in your Vuejs template you use the methods listed below and always ensure that the `xlmns` attribute is included in the root element of the SVG otherwise none of the methods provided will work!

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡&lt;br&gt;
  xmlns="&lt;a href="http://www.w3.org/2000/svg" rel="noopener noreferrer"&gt;http://www.w3.org/2000/svg&lt;/a&gt;"&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
(i) Embedding an external svg as an image element in a Vuejs template:

![Embedding an external svg as an image element in a Vuejs template]
(https://res.cloudinary.com/di70zcupa/image/upload/v1611904084/svg-img-implementantion_bhxx8s.png)

_Note: Replace the `&amp;lt;file-name&amp;gt;` with the unique name you gave to the svg resource you downloaded above._

Using this method limits how you can manipulate the `svg` as it really doesn't exist in the document but it is encapsulated in the `&amp;lt;img&amp;gt;` element. So at most you can only manipulate it as you would a normal image.

The cons of this method include limitations in styling and in extending the functionality of SVGs and in addition to that if you are dealing with a lot of SVGs in your template it becomes rather cumbersome to keep wrapping them in image elements.

(ii) Using `SVG Loaders`

Vuejs uses Webpack as an asset bundler. Webpack uses a loader for each file type it handles. The loaders for the common file types usually come pre-configured whenever you use Vue CLI to bootstrap your project. What that means is that when you import those file types they can be automatically read. But unfortunately `.svg` loaders do not come pre-configured so you have to download them from [npm](https://www.npmjs.com/) then configure them manually.

There are many modules available on npm which are svg vuejs loaders. In this example we will be using the [vue-svg-loader](https://www.npmjs.com/package/vue-svg-loader). The set up instructions are listed in the link provided, for those who have never installed and configured a module in Vuejs follow the instructions below:

_The instructions below are only suited for a project bootstrapped with Vue CLI._

- To install the module type the command below in your terminal:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;npm i -D vue-svg-loader vue-template-compiler&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;- In the root of you project directory, create a `vue.config.js` file and copy and paste the code below:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;module.exports = {&lt;br&gt;
  chainWebpack: (config) =&amp;gt; {&lt;br&gt;
    const svgRule = config.module.rule('svg');&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;svgRule.uses.clear();

svgRule
  .use('babel-loader')
  .loader('babel-loader')
  .end()
  .use('vue-svg-loader')
  .loader('vue-svg-loader');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;},&lt;br&gt;
};&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ensure that you save your changes.

Congrats!!!🎊 

You have successfully installed and configured the settings of the `vue-svg-loader` module.

Now, let's proceed to learn how we can use the `vue-svg-loader` module to embed SVG in Vuejs.

![using SVG loaders to embed svg in Vuejs](https://res.cloudinary.com/di70zcupa/image/upload/v1611925461/using-svg-loader_ximunw.png)

- You first remove all the boilerplate code from the `App.vue` file in the `src` directory.
- Then you copy the code in diagram above into `App.vue`, and save your changes.
- The `svg` I used exists as a standalone file in the assets folder as is named `sample.svg`, so depending on what you named your .svg file you may need to tweak the code above.
- Run the command below on your terminal, and then on your browser visit ` http://localhost:8080/` to view the Vuejs app with the embedded SVG 🚀.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;npm run serve&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The pros of using this method are:
- Your template is kept clean,
- And there are no limitations on how you can style or extend the functionality of your svg.

### References
1. &amp;lt;a href="https://youtu.be/hA7ESX7FsE4" class="article-link"&amp;gt;What are Scalable Vector Graphics (SVG) &amp;amp; how are they special? | Web Demystified Episode 4&amp;lt;a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>newbie</category>
      <category>vue</category>
      <category>svg</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Be the change</title>
      <dc:creator>Jacqueline Binya</dc:creator>
      <pubDate>Tue, 23 Jun 2020 09:49:14 +0000</pubDate>
      <link>https://dev.to/jacqueline/be-the-change-3c58</link>
      <guid>https://dev.to/jacqueline/be-the-change-3c58</guid>
      <description>&lt;p&gt;The calamity and threat brought by the pandemic had us locked away in our homes for months. As we came out of the lockdown we were forced to introspect and confront systematic and institutionalized prejudices(be it racism, ableism, ageism, sexism, homophobia, xenophobia, religious prejudice or any form of prejudice that exists thereof) which act as barriers to social and economic inclusion.&lt;/p&gt;

&lt;p&gt;The catalyst to this awareness and movement was the untimely death of Gorge Floyd, a victim of police brutality and racism in Minneapolis, Minnesota USA. He has since become a global symbol for dismantling all forms of racial discrimination and inequality.&lt;/p&gt;

&lt;p&gt;Now at the aftermath of global protests against inequality and racism the question in everyone else's mind is: 'How do we translate activism into long term meaningful and impactful change?'.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/fYfh8DBB6JxcqXK5Cr/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/fYfh8DBB6JxcqXK5Cr/giphy.gif" alt="Gif inscribed with the words everybody love everybody"&gt;&lt;/a&gt;&lt;/p&gt;
If only it were that simple 🤦🏿‍♀️



&lt;p&gt;Well I have been a techie for a little over a year. I come from a small country in Southern Africa called Zimbabwe. A decade ago someone like me would had never been able to break into tech. Because of barriers of entry like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Poverty (computers don't come cheap eey!, a quality CS degree is pricey, paid tutorials cost an arm and leg), &lt;/li&gt;
&lt;li&gt;Lack of access to the internet, &lt;/li&gt;
&lt;li&gt;And the worst by my books as a non native English speaker, was the fact that ten years ago I would have had to read and comprehend ancient documentation of age old technologies written in a complex hard to understand manner with excessive use of technical jargon.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Today in comparison we have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Countless high quality free resources on the internet in the form of tutorials made by content-creators of diverse backgrounds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The price of PCs has been on a steady decrease in the recent years so has that of the internet.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Technical writers and developer advocates are doing the most! Tech documentation of modern tools, frameworks and technologies is now more intuitive. Dev advocates create content in the form of demo applications, blogs, videos and are always available to answer questions. All this to facilitate faster onboarding of developers into using tools they represent.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Organizations like &lt;a href="https://vueschool.io/" class="article-link"&gt;VueSchool &lt;/a&gt; although not free provide a discount in their subscriptions for users from marginalized backgrounds of up to 62%.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Online developer communities on &lt;a href="https://dev.to/" class="article-link"&gt;DEV&lt;/a&gt; and tech Twitter. Those communities have been a lifeline for me. They allow me to stay up to date with the latest trends and provide opportunities to network with the global dev community.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Inclusive internship opportunities from organizations like &lt;a href="https://www.outreachy.org/" class="article-link"&gt;Outreachy&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p class="highlight-content"&gt;
Disclaimer: Some of the above listed opportunities might have existed a decade ago, but the fact that tech communities weren't as strong and accessible as they are today. Those opportunities wouldn't have had been available to persons from marginalized backgrounds because they frankly would have been ignorant of their existence.
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tech has indeed been democratized, but there is still so much more to be done.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I have been a FOSS enthusiast for sometime now. My experiences in FOSS have been great. I have participated in communities where the maintainers and contributors collaborate, share and are intentional in ensuring that the &lt;em&gt;community&lt;/em&gt; experience is positive for everyone. In turn I always try to make meaningful contributions and practise kindness. Despite my positive experiences, I have always had fears and doubts lurking at the back of my mind about contributing in FOSS and pursing a career in tech in general but in light of the recent events those fears have been amplified. These are some of the anxieties I have :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;As a black woman from Africa are my contributions taken seriously and valued?&lt;/li&gt;
&lt;li&gt;Is the playing field even? Do I have equal opportunity to participate and complete ?&lt;/li&gt;
&lt;li&gt;Will my value as a techie diminish as I grow older? I transitioned into tech in my thirties and this something I plan to be doing for the longest time possible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This winter I was fortunate to get involved with the &lt;a href="https://chaoss.community/" class="article-link"&gt;Community Health Analytics Open Source Software(CHAOSS)&lt;/a&gt; Community and be part of the amazing work they are doing to change the future of tech. The work being done at CHAOSS gives me hope about the future and for me it's been an opportunity to be part of the change.&lt;br&gt;
I am contributing to the awesome &lt;a href="https://github.com/badging" class="article-link"&gt;CHAOSS Diversity and Inclusion (D&amp;amp;I) Badging&lt;/a&gt; project. My participation in the CHAOSS D&amp;amp;I Badging project has been part of my application for Google Summer of Docs 2020. &lt;/p&gt;

&lt;p&gt;The CHAOSS Project was created to meet the demand and satisfy the need to measure the health of open source projects or communities.&lt;/p&gt;

&lt;p&gt;The simple way to solve this problem, was to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define metrics to measure open source health&lt;/li&gt;
&lt;li&gt;Develop tools to measure those metrics&lt;/li&gt;
&lt;li&gt;And then finally collect data and analyse it to determine open-source project health.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;CHAOSS is a Linux Foundation project focused on creating analytics and metrics to help define community health (CHAOSS official website).&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The metrics to measure open source health defined by CHAOSS are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Common Metrics&lt;/li&gt;
&lt;li&gt;Diversity and Inclusion(D&amp;amp;I)&lt;/li&gt;
&lt;li&gt;Evolution&lt;/li&gt;
&lt;li&gt;Risk&lt;/li&gt;
&lt;li&gt;Value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The CHAOSS Community is then divided into different Working Groups. The aims of the Working Groups is to refine the metrics and to work with software implementation.&lt;/p&gt;

&lt;p&gt;Let's recap before we proceed:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;💡Well in the beginning the big problem was coming up with a means to measure open source health. The CHAOSS Project then defined the metrics. But the metrics were still big and ambiguous and there was still no means to measure the metrics.The CHAOSS Project then formed different Working Groups for the defined metrics.The responsibility of each Working Group is to refine the metrics and come up with tools to measure the metrics.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So the CHAOSS D&amp;amp;I Badging Project falls under the CHAOSS D&amp;amp;I Working Group. &lt;/p&gt;

&lt;p&gt;The D&amp;amp;I Working Group formulated the following focus areas(these are sub-metrics of D&amp;amp;I):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Communication Inclusivity&lt;/li&gt;
&lt;li&gt;Contributor Community Diversity&lt;/li&gt;
&lt;li&gt;Event Diversity&lt;/li&gt;
&lt;li&gt;Governance&lt;/li&gt;
&lt;li&gt;Leadership&lt;/li&gt;
&lt;li&gt;Project and Community&lt;/li&gt;
&lt;li&gt;Recognition of Good Work&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The D&amp;amp;I Badging Project is implementation software, its purpose is to determine if open source projects and events are diverse and inclusive.&lt;/p&gt;

&lt;p&gt;The D&amp;amp;I Badging Workflow takes place in the open and in the public on GitHub. The CHAOSS D&amp;amp;I Badging working group created two repos &lt;a href="https://github.com/badging/project-diversity-and-inclusion" class="article-link"&gt;Project Badging&lt;/a&gt; and &lt;a href="https://github.com/badging/event-diversity-and-inclusion" src="article-link"&gt; Event Bagding&lt;/a&gt;. All the documentation pertaining to the the D&amp;amp;I Badging workflow and D&amp;amp;I metrics for the above mentioned focus areas is also found in these repos.&lt;/p&gt;

&lt;p&gt;In the documentation the prospective applicants are provided with information on how to apply for a badge. This is a two-step process which starts with appending either an event or project in a events or projects table in the corresponding repos of the entities. The table is used to showcase the badging status and/or outcome of either events or projects for which badging applications were made. Because of the underlining git workflow once the applicants append their entities to the tables i.e make changes, they can open pull requests so as to submit their changes. The PRs opened have an embedded template which is a form the applicants are expected to fill out in Markdown. The questions asked in the form are used for D&amp;amp;I assessment.&lt;br&gt;
So far review guides or specifications are yet to be advised.&lt;/p&gt;

&lt;p&gt;To participate in the CHAOSS Project, check out this &lt;a href="https://chaoss.community/participate/" class="article-link"&gt;link&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>life</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Where do my saved dev.to articles/blogs go?</title>
      <dc:creator>Jacqueline Binya</dc:creator>
      <pubDate>Sat, 09 Nov 2019 02:16:13 +0000</pubDate>
      <link>https://dev.to/jacqueline/where-does-do-my-saved-dev-to-posts-go-1b9j</link>
      <guid>https://dev.to/jacqueline/where-does-do-my-saved-dev-to-posts-go-1b9j</guid>
      <description>&lt;p&gt;Hello, dev.to Community&lt;/p&gt;

&lt;p&gt;I'm a huge fan of dev.to, I read all sorts of tech articles but unfortunately sometimes because of time constraints I cannot read all the interesting blogs/articles I find on my feed. So I tend to click on the save option with the intent to read them later.&lt;/p&gt;

&lt;p&gt;My question, where do I find those saved blogs/articles?&lt;/p&gt;

&lt;p&gt;I have looked everywhere.&lt;/p&gt;

&lt;p&gt;Help!!!&lt;/p&gt;

</description>
      <category>help</category>
    </item>
    <item>
      <title>Joi Tutorial-Using @hapi/joi version 16.1.7 to validate a request body in a RESTful API.</title>
      <dc:creator>Jacqueline Binya</dc:creator>
      <pubDate>Wed, 06 Nov 2019 02:39:11 +0000</pubDate>
      <link>https://dev.to/jacqueline/using-hapi-joi-version-16-1-7-to-validate-a-request-body-in-a-restful-api-bje</link>
      <guid>https://dev.to/jacqueline/using-hapi-joi-version-16-1-7-to-validate-a-request-body-in-a-restful-api-bje</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Why validate?
&lt;/h3&gt;

&lt;p&gt;Before we even get started I know there is someone thinking, " Why should I bother with validations in the backend? Validations should be done in the front end, after all, we have inbuilt &lt;a href="https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Form_validation"&gt;HTML5 form validations&lt;/a&gt;, why must I validate twice? &lt;br&gt;
Well, it is good practice when designing your API to always design it in isolation never make any assumptions, cause, in all honesty, you never know who is going to consume your API.&lt;/p&gt;

&lt;p&gt;So in a RESTful  API, you typically have at least one  HTTP POST method that accepts a payload of user data in json format. Now the question arises how then do we ensure that the data we receive is of the desired type and in the correct format before we persist that data in our application's database?&lt;/p&gt;

&lt;p&gt;To do that we use middleware functions normally referred to as validators. The goal is to ensure that your application's validators cover all edge cases so as to protect the integrity of your database. And to do that you use either regular expressions or alternately handy modules like @hapi/joi which make input validations in Javascript easy, seamless and fast.&lt;/p&gt;
&lt;h3&gt;
  
  
  What then is @hapi/joi
&lt;/h3&gt;

&lt;p&gt;From the official documentation from &lt;a href="https://www.npmjs.com/package/@hapi/joi"&gt;npmjs&lt;/a&gt;, @hapi/joi is defined as:"&lt;br&gt;
&lt;strong&gt;The most powerful schema description language and data validator for JavaScript.&lt;/strong&gt;&lt;br&gt;
joi is part of the hapi ecosystem and was designed to work seamlessly with the hapi web framework and its other components (but works great on its own or with other frameworks)..."&lt;/p&gt;

&lt;p&gt;Well to break it down, @hapi/joi is a module that is used to define a schema or blueprint of Javascript objects. Once the schema is defined, you then can use Joi's handy methods that come bundled with it, to validate any other objects against the schema. It was designed for the hapi ecosystem but works well with other frameworks of which for our purposes we will use it in an &lt;a href="https://expressjs.com/"&gt;express&lt;/a&gt; server.&lt;/p&gt;
&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;p&gt;In your project &lt;a href="https://dev.to/nubian_geekess/setting-up-a-basic-express-server-in-e6-bootstrapped-with-eslint-and-airbnb-style-guide-1g6i"&gt;set up a basic express&lt;/a&gt; server, and then install @hapi/joi by running the command &lt;code&gt;npm i @hapi/joi&lt;/code&gt; on the terminal. This will install the current latest version of @hapi/joi of which at the time of publishing this article was version 16.1.7&lt;/p&gt;

&lt;p&gt;In the root of your project create files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;schema.js&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;validators.js&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the file &lt;em&gt;schema.js&lt;/em&gt; we will define our schema and in the file &lt;em&gt;validators.js&lt;/em&gt; we will define our validator middleware functions.&lt;/p&gt;

&lt;p&gt;A schema can be defined as either a Joi type or a simple Javascript object whose keys are joi types. &lt;/p&gt;
&lt;h3&gt;
  
  
  What are Joi types
&lt;/h3&gt;

&lt;p&gt;Joi has inbuilt types e.g. Joi.object(), Joi.string(), Joi.array(), Joi.date() etc. More types are found listed in the official documentation. &lt;/p&gt;
&lt;h3&gt;
  
  
  Defining a schema
&lt;/h3&gt;

&lt;p&gt;In practical applications, the schema is usually defined as a Joi object, whose keys have values which are Joi types and have optional constraints chained to them. Below are two ways I use to define a validation schema in &lt;em&gt;schema.js&lt;/em&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Method One
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Weie9YMu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zz68fr9nkt1zm076kmwd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Weie9YMu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/zz68fr9nkt1zm076kmwd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Method Two
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JzmN7Ehr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6r1opkiw96xqh6h86nvk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JzmN7Ehr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/6r1opkiw96xqh6h86nvk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above schema definitions are equal whatever method you use totally depends on personal preference.&lt;/p&gt;
&lt;h4&gt;
  
  
  Validating a request body payload
&lt;/h4&gt;

&lt;p&gt;Before we are able to perform any validations we should be able to communicate with our server, and to do that on &lt;em&gt;app.js&lt;/em&gt; we add a route &lt;em&gt;localhost:5000/signup&lt;/em&gt; as shown in the figure below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2LGifayO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/v7wl80fhnbpfaft9l0se.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2LGifayO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/v7wl80fhnbpfaft9l0se.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When it comes to performing actual validations the Joi module provides various different methods we can use to validate our data as shown below: &lt;/p&gt;
&lt;h5&gt;
  
  
  Synchronous validations
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FStBcWLW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8fdj5mr2hi8ug8bjfsgi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FStBcWLW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/8fdj5mr2hi8ug8bjfsgi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Async validations
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--q_8IRRCI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/njeedj3dywzot4jl746p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--q_8IRRCI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/njeedj3dywzot4jl746p.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  Validating schema by using &lt;em&gt;Joi.assert()&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pJgXEoML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/k99njk5kkx5b9efy3nws.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pJgXEoML--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/k99njk5kkx5b9efy3nws.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When we run our server and send a payload via Postman as shown in the figure below using any of the above validators we get the same output. Joi by default aborts validations once the first rule is broken.&lt;br&gt;
&lt;a href="https://thepracticaldev.s3.amazonaws.com/i/msep90upupi47klei48b.png"&gt;Alt Text&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alternately if you want to list all the validation errors in the payload, you can pass an option of &lt;code&gt;{ abortEarly: false }&lt;/code&gt;, to any of the above-listed Joi validator methods, this is usually handy for debugging purposes. For example: &lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DA-prYxy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/h1tkqanmpdh6tot4afsv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DA-prYxy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/h1tkqanmpdh6tot4afsv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we start the server and on Postman send the same payload as above to the endpoint &lt;em&gt;POST localhost:5000/signup&lt;/em&gt;, as a response we get a detailed error message:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "error": {
        "_original": {
            "username": "",
            "email": ""
        },
        "details": [
            {
                "message": "\"username\" is not allowed to be empty",
                "path": [
                    "username"
                ],
                "type": "string.empty",
                "context": {
                    "label": "username",
                    "value": "",
                    "key": "username"
                }
            },
            {
                "message": "\"email\" is not allowed to be empty",
                "path": [
                    "email"
                ],
                "type": "string.empty",
                "context": {
                    "label": "email",
                    "value": "",
                    "key": "email"
                }
            }
        ]
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Custom Error Messages
&lt;/h3&gt;

&lt;p&gt;So far we have been sending default Joi error messages in the response object which look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "error": "\"username\" is not allowed to be empty"
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The error message above is difficult to understand for the end-user. Error messages must be short and easy to understand. So to customize error messages on our schema definition in &lt;em&gt;schema.js&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5ExsvRbF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3p6rmx38ty5dmjmvkzb8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5ExsvRbF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3p6rmx38ty5dmjmvkzb8.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As you can see above in the schema we modified the value of the &lt;em&gt;username&lt;/em&gt; key and added an extra rule/constraints &lt;code&gt;messages()&lt;/code&gt;. &lt;br&gt;
&lt;code&gt;messages()&lt;/code&gt; takes an object as an argument, whose keys are validation error types and their corresponding values are custom error messages.&lt;/p&gt;

&lt;p&gt;Now to view our customized error messages on the response object:&lt;/p&gt;

&lt;p&gt;We start our server then on Postman, in the payload we post an empty string as a &lt;em&gt;username&lt;/em&gt;. The response:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qQP76Ogz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/968kwglta9p0w514if1e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qQP76Ogz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/968kwglta9p0w514if1e.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And then, we intentionally post an invalid type as a &lt;em&gt;username&lt;/em&gt; to test the other custom error message, which in this case is a number. The response:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--4Re2VgLw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p8g810rl8ynfv10m0ane.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4Re2VgLw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p8g810rl8ynfv10m0ane.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So our error messages have been successfully customized.&lt;/p&gt;

&lt;h3&gt;
  
  
  Validating strings
&lt;/h3&gt;

&lt;p&gt;The Joi module provides several constraints we can use to increase validations on string data types which allow us to cover more edge cases. The most common ones I often use are in the example below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jkRxxvg1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/mpwg1u6j8mtvlnzhxab5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jkRxxvg1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/mpwg1u6j8mtvlnzhxab5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the example in the figure above:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;string.trim()&lt;/code&gt; removes any whitespace before and after the &lt;code&gt;username&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;string.min()&lt;/code&gt; specifies the minimum number of characters for &lt;code&gt;username&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;string.max()&lt;/code&gt; specifies the maximum number of characters for &lt;code&gt;username&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;string.regex()&lt;/code&gt; specifies a regular expression the &lt;code&gt;username&lt;/code&gt; must match against.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Validating numbers
&lt;/h3&gt;

&lt;p&gt;The important thing to note when validating numbers is to pass the option &lt;br&gt;
&lt;code&gt;{ convert: false }&lt;/code&gt; to your default Joi validator functions. It's especially effective when validating decimals.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--p-ofIJrs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/03gn1yqze9nun0r7v548.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--p-ofIJrs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/03gn1yqze9nun0r7v548.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the example in the figure above:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;number.min()&lt;/code&gt; specifies the minimum number for &lt;code&gt;age&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;number.max()&lt;/code&gt; specifies the maximum number for &lt;code&gt;age&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;number.positive()&lt;/code&gt; specifies that only positive numbers are accepted for the &lt;code&gt;price&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;number.precision(limit)&lt;/code&gt; specifies the maximum permissible number of decimal places for the &lt;code&gt;price&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Note&lt;/em&gt; The purpose of this article was to hopefully get you started on using the Joi modules for validations, it does not in any way cover everything about performing validations using the module, to learn more, I encourage you to go over the &lt;a href="https://hapi.dev/family/joi/?v=16.1.7#string"&gt;official documentation.&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading my article, if you loved it please like it below, and follow me on &lt;a href="https://twitter.com/nubian_geekess"&gt;Twitter&lt;/a&gt;. Increasing my Twitter following will help me land my dream job as a technical writer. If you have any comments and suggestions please let me know.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>newbie</category>
      <category>javascript</category>
      <category>node</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Setting up a basic express server in E6, bootstrapped with eslint and Airbnb style guide</title>
      <dc:creator>Jacqueline Binya</dc:creator>
      <pubDate>Wed, 06 Nov 2019 02:37:47 +0000</pubDate>
      <link>https://dev.to/jacqueline/setting-up-a-basic-express-server-in-e6-bootstrapped-with-eslint-and-airbnb-style-guide-1g6i</link>
      <guid>https://dev.to/jacqueline/setting-up-a-basic-express-server-in-e6-bootstrapped-with-eslint-and-airbnb-style-guide-1g6i</guid>
      <description>&lt;p&gt;The purpose of this article is to save as a guide to setting up a basic express server. Please check out the attached repository on Github. It provides a simple boilerplate that will help you set up your server.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vJ70wriM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/github-logo-ba8488d21cd8ee1fee097b8410db9deaa41d0ca30b004c0c63de0a479114156f.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/JackieBinya"&gt;
        JackieBinya
      &lt;/a&gt; / &lt;a href="https://github.com/JackieBinya/Express-server-boilerplate"&gt;
        Express-server-boilerplate
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      I created this repo to set up a basic express server in E6 and bootsrap it with eslint airbnb style guide.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;h1&gt;
Express-server-boilerplate&lt;/h1&gt;
&lt;p&gt;I created this repo to set up a basic express server boilerplate in E6 and bootsrapped my project with eslint airbnb style guide.&lt;/p&gt;
&lt;h2&gt;
Requirements&lt;/h2&gt;
&lt;p&gt;Ensure that you have &lt;a href="https://git-scm.com/" rel="nofollow"&gt;git&lt;/a&gt; installed on your local machine. And you are familiar with git basics which include creating a repo on Github, forking an existing repository and cloning a repository. If those are totally new concepts to you please check out this &lt;a href="https://www.youtube.com/watch?v=IHaTbJPdB-s&amp;amp;t=79s" rel="nofollow"&gt;Youtube video&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
Set up guide&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Fork this repo and use it as a template for any repo you want to set up an express server.&lt;/li&gt;
&lt;li&gt;Then clone your repo in your local machine and open it on any text editor of your choice.&lt;/li&gt;
&lt;li&gt;On the terminal run the command &lt;code&gt;npm init -y&lt;/code&gt; to initialize your project.&lt;/li&gt;
&lt;li&gt;And to install all dependencies listed in &lt;em&gt;package.json&lt;/em&gt; run the command &lt;code&gt;npm i &lt;/code&gt; on your terminal.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Starting the server&lt;/h2&gt;
&lt;p&gt;On the terminal run the command…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/JackieBinya/Express-server-boilerplate"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;em&gt;Thank you for reading this article.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>newbie</category>
      <category>javascript</category>
      <category>node</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Recomendations for open source projects in Javascript.</title>
      <dc:creator>Jacqueline Binya</dc:creator>
      <pubDate>Sun, 20 Oct 2019 11:37:46 +0000</pubDate>
      <link>https://dev.to/jacqueline/recomendations-for-open-source-projects-in-javascript-139o</link>
      <guid>https://dev.to/jacqueline/recomendations-for-open-source-projects-in-javascript-139o</guid>
      <description>&lt;p&gt;I would love to get started on contributing to open source projects that are in Javascript. &lt;br&gt;
My main interest are vanilla JS, React,Typescript and Postgres, unit testing using mocha/chai and jest.&lt;br&gt;
I also do HTML5 and CSS3.&lt;/p&gt;

&lt;p&gt;Please somebody point me in the right direction.&lt;br&gt;
Thanks in advance!&lt;/p&gt;

</description>
      <category>opensource</category>
    </item>
    <item>
      <title>Another conflict: resolving conflicts in git that occur when using rebase.</title>
      <dc:creator>Jacqueline Binya</dc:creator>
      <pubDate>Thu, 17 Oct 2019 01:46:19 +0000</pubDate>
      <link>https://dev.to/jacqueline/another-conflict-resolving-conflicts-in-git-that-occur-when-using-rebase-3dho</link>
      <guid>https://dev.to/jacqueline/another-conflict-resolving-conflicts-in-git-that-occur-when-using-rebase-3dho</guid>
      <description>&lt;h2&gt;
  
  
  Background
&lt;/h2&gt;

&lt;p&gt;This interactive tutorial about the resolution of conflicts in git is a continuation of my first blog in the series titled &lt;em&gt;And then we resolve a merge conflict...&lt;/em&gt;. If you have not read it, please check it out &lt;a href="https://dev.to/nubian_geekess/and-then-a-conflict-2eli"&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The aim of this tutorial is to show how you can use rebasing as an alternative to merging so to combine to branches in git. It will demonstrate how you resolve conflicts that occur thereof.&lt;/p&gt;

&lt;h2&gt;
  
  
  Intro to rebasing
&lt;/h2&gt;

&lt;p&gt;Every commit in github is based on its preceding commit. When you trace the history you realize that every commit has an ancestor.&lt;br&gt;
Practically this is shown by that whenever you log the history of a branch, all the commits are listed in chronological order. With first commit at the bottom and the most recent commit which is the HEAD at the top.&lt;br&gt;
Now, what rebasing does is it rewrites history of your current branch, through assigning a commit of your choice as the ancestor of the HEAD.&lt;/p&gt;
&lt;h2&gt;
  
  
  Now, let's get started
&lt;/h2&gt;

&lt;p&gt;As indicated in the first blog to get started, we create a repo on github and initialize it with a README. Then clone it locally on my machine. After that, I open the project on an editor. My editor of choice is Visual Studio Code.&lt;/p&gt;

&lt;p&gt;I  then create and check out a new branch called &lt;em&gt;list-interests&lt;/em&gt;. And create &lt;em&gt;bio.txt&lt;/em&gt;. In &lt;em&gt;bio.txt&lt;/em&gt; I add a list of my personal interests. Then voila: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2EqHMf7d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0t8fdikm5m3rvxlr31dc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2EqHMf7d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/0t8fdikm5m3rvxlr31dc.png" alt="code screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To stage the changes, on the terminal I run the command,&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Then to commit the changes to my local repo I run the command,&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m "Adds interests to bio"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Then to look up the history of the &lt;em&gt;list-interests&lt;/em&gt; branch, on the terminal I run the command;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log --oneline&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;5d944ac (HEAD -&amp;gt; list-interests) Adds interest to bio
305d937 (origin/master, origin/HEAD, master) Initial commit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Now let's imagine that a bunch of devs was assigned to this project. One dev, in particular, was assigned to add an intro to the bio. The dev successfully created the intro and then proceed to merge it to master.&lt;/p&gt;

&lt;p&gt;To mimic that, on the terminal run the command,&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git checkout -&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The command above listed above allows you to navigate to the branch you were in before you checked out your current branch.&lt;/p&gt;

&lt;p&gt;On &lt;em&gt;master&lt;/em&gt; I then create the file &lt;em&gt;bio.txt&lt;/em&gt;. Then add a basic intro about myself.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HXFiAyr5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/20focxl3d59b2p1tsbrf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HXFiAyr5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/20focxl3d59b2p1tsbrf.png" alt="screenshot of codeblock"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I then add the changes to the staging area by running the command below on the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;To add the changes to my  local repo,&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m "Adds intro to bio"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Then I log the history by running the command;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log --oneline&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The output:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;4586948 (HEAD -&amp;gt; master) Adds intro to bio
305d937 (origin/master, origin/HEAD) Initial commit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Then to sync &lt;em&gt;master&lt;/em&gt; to my &lt;em&gt;origin/master&lt;/em&gt; which is the  branch that corresponds to &lt;em&gt;master&lt;/em&gt; on the remote repository;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I then check out the branch &lt;em&gt;list-interests&lt;/em&gt; to continue.&lt;br&gt;
If you log the history of the branch &lt;em&gt;list-interests&lt;/em&gt; you will realize that it was based on the old version of &lt;em&gt;master&lt;/em&gt; that did not have the intro. I intend to rebase it to the new version of &lt;em&gt;master&lt;/em&gt; so as to include the intro.                     &lt;/p&gt;

&lt;p&gt;To do that on the terminal I then run the command;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git rebase master&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;On the terminal I get the error message:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;First, rewinding head to replay your work on top of it...
Applying: Adds interest to bio
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
CONFLICT (add/add): Merge conflict in bio.txt
Auto-merging bio.txt
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 Adds interest to bio
"git add/rm &amp;lt;conflicted_files&amp;gt;", then run "git rebase --continue".        
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;The above message informs me that git failed to merge then provides me commands I can use to resolve the issue.&lt;/p&gt;

&lt;p&gt;On the editor, this is what is there:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kJbBTJAM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/s140yydyfyxfgupma6ym.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kJbBTJAM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/s140yydyfyxfgupma6ym.png" alt="screenshot of codeblock"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Because I want to keep both the changes, I select the option &lt;em&gt;Accept Both Changes&lt;/em&gt; on VS code.&lt;/p&gt;

&lt;p&gt;To continue I then add the change to the staging area, by running the command;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Then on the terminal, I  run the command;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git rebase --continue&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Then get the message&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Applying: Adds interest to bio
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Under the hood when you rebase, git basically rewinds fetches the tip of &lt;em&gt;master&lt;/em&gt;, places it in the position of the last commit of the branch you had checked out, then applies the tip of &lt;em&gt;list_interests&lt;/em&gt; on &lt;em&gt;master&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;To visualize it imagine your history was a deck of cards, a stack. You pop the topmost card which is the HEAD of your current branch, in its place you push the HEAD of &lt;em&gt;master&lt;/em&gt; then finally you push the HEAD of the current branch in its rightful position.&lt;/p&gt;

&lt;p&gt;If you have conflicts you resolve them and then stage the changes. But instead of making a new merge commit when you run the command &lt;em&gt;git rebase --continue&lt;/em&gt; the changes are applied to the HEAD, which in this case had the message &lt;em&gt;Adds interests to bio&lt;/em&gt;. When you log the history you get:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1a378f3 (HEAD -&amp;gt; list-interests) Adds interest to bio
4586948 (origin/master, origin/HEAD, master) Adds intro to bio
305d937 Initial commit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I have successfully made a rebase. Rebasing offers a clean way to combine diverging branches and its main advantage is the history is kept linear, unlike when you do merge commits.&lt;/p&gt;

&lt;p&gt;I then sync my local and remote. Make a pull request. Then merge my pull request to &lt;em&gt;origin/master&lt;/em&gt;. On  my local I checkout &lt;em&gt;master&lt;/em&gt; then on the terminal run the command;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;So as to sync &lt;em&gt;master&lt;/em&gt; to &lt;em&gt;origin/master&lt;/em&gt;. Then voila:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7nPmL1lD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hkvzfhdgaz0ohexcvck5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7nPmL1lD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hkvzfhdgaz0ohexcvck5.png" alt="screenshot of codeblock"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With that done, hopefully, you now have an understanding of how rebasing works in git. We now proceed to the main business of the day which is using rebasing to implement what we did on the &lt;a href="https://dev.to/nubian_geekess/and-then-a-conflict-2eli"&gt;first blog&lt;/a&gt; in the series.&lt;/p&gt;

&lt;p&gt;Well, I would love to add a new feature to my bio. This time I will add a list of programming languages I have worked on. To do that I create and check out a new branch called &lt;em&gt;list-languages&lt;/em&gt;. On the terminal, I run the command,&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git checkout -b list-languages&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Then I edit &lt;em&gt;bio.txt&lt;/em&gt; by adding a list of programming languages.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Wc_Acx59--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/wpplvusgsy52k3wtpekd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Wc_Acx59--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/wpplvusgsy52k3wtpekd.png" alt="screenshot of codeblock"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To proceed I then add the changes to the staging area by  running the command;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;To commit the changes to my local repo, on the terminal I then run the command;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;"git commit -m "Adds programming languages to bio"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;To create a branch on the remote corresponding to &lt;em&gt;list--languages&lt;/em&gt; and push changes associated with it. On the terminal I then run the command;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push --set-upstream origin list-languages&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I just realized I made a blooper on my bio. Instead of adding C++, I meant to add C. But in the same regard, I want to keep my commit message. &lt;/p&gt;

&lt;p&gt;So back on my editor, I edit my bio.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BbCgFW9s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7968tagpiwjffcfy92m2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BbCgFW9s--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/7968tagpiwjffcfy92m2.png" alt="screenshot of code block"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now to stage the changes I run:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;And to commit to my local, on my terminal I run the command:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit --amend --no-edit&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;As we know from the first tutorial &lt;em&gt;git commit --amend --no-edit&lt;/em&gt;, alters the history of the branch. We end up with a scenario whereby the local and remote diverge from each other with the remote branch always leading.&lt;/p&gt;

&lt;p&gt;When I attempt to sync my local and remote using:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I  get this message as a response:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;To github.com:JackieBinya/git-tut-2.git
! [rejected]        list-languages -&amp;gt; list-languages (non-fast-forward)
error: failed to push some refs to 'git@github.com:JackieBinya/git-tut-2.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Before we proceed let's take a quick look at the history of the branch &lt;em&gt;list-languages&lt;/em&gt;, using the command:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git log --oneline&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The output:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;c0fa933 (HEAD -&amp;gt; list-languages) Adds programming languages to bio
d2c5e0f (origin/master, origin/HEAD, master) Merge pull request #1 from JackieBinya/list-interests
1a378f3 (origin/list-interests, list-interests) Adds interest to bio
4586948 Adds intro to bio
305d937 Initial commit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Basically when I run the command &lt;em&gt;git push&lt;/em&gt;. Under the hood git attempts to sync my local &lt;em&gt;list-languages&lt;/em&gt; to the corresponding branch on the remote &lt;em&gt;origin/list-languages&lt;/em&gt;. Git is clever enough to realize that the branches have diverged, the remote is ahead of the local branch so it suggests I pull changes on the remote to my local, resolve any conflicts and push again.&lt;/p&gt;

&lt;p&gt;To resolve the issue highlighted I run the command:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git pull --rebase&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I added the flag &lt;em&gt;--rebase&lt;/em&gt; to the &lt;em&gt;git pull&lt;/em&gt; command so as to rebase the HEAD of my local on the tip of &lt;em&gt;origin/list-laguages&lt;/em&gt;. This offers an alternative to merging branches.&lt;/p&gt;

&lt;p&gt;On my editor this is what my file looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--10sIt0Nw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dljclocd8wl0h84y05ex.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--10sIt0Nw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/dljclocd8wl0h84y05ex.png" alt="screenshot of codeblock"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To resolve the conflict, on VS Code I select the option to keep incoming changes. I then add the changes to the staging area then run the command;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;_git rebase --continue_&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This is what &lt;em&gt;bio.txt&lt;/em&gt; looks like on my editor:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qdj_0k7F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p1814pamnh50jvbd6915.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qdj_0k7F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/p1814pamnh50jvbd6915.png" alt="screenshot of codeblock"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I log the history on the terminal I get the output below:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;b584e1c (HEAD -&amp;gt; list-languages) Adds programming languages to bio
7b06700 (origin/list-languages) Adds programming languages to bio
d2c5e0f (origin/master, origin/HEAD, master) Merge pull request #1 from JackieBinya/list-interests
1a378f3 (origin/list-interests, list-interests) Adds interest to bio
4586948 Adds intro to bio
305d937 Initial commit
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I then sync my local and remote. Make a PR then merge it to &lt;em&gt;master&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Finally my bio:&lt;br&gt;
&lt;/p&gt;
&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Thank you for reading my article.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>newbie</category>
      <category>beginners</category>
    </item>
    <item>
      <title>My first ever Hacktoberfest Event experience </title>
      <dc:creator>Jacqueline Binya</dc:creator>
      <pubDate>Mon, 14 Oct 2019 02:24:22 +0000</pubDate>
      <link>https://dev.to/jacqueline/my-first-ever-hacktoberfest-event-experience-1888</link>
      <guid>https://dev.to/jacqueline/my-first-ever-hacktoberfest-event-experience-1888</guid>
      <description>&lt;p&gt;Its been a day of since we held our Hacktoberfest in Bulawayo event, the first one of its kind in my city Bulawayo in Zimbabwe and I was the the event's orgarniser.&lt;/p&gt;

&lt;p&gt;My intentions in organizing the event although I myself am a total newbie to open source were: I am currently on a drive to improve my soft skills. I am especially focused on public speaking and technical writing. &lt;/p&gt;

&lt;p&gt;One thing in my short techie life I've learnt is that you always have to be constantly learning and evolving. You must set challenges for yourself which might seem impossible to achieve and just take the plunge. &lt;br&gt;
All you have to do is be humble enough to ask questions, collaborate and implement feedback basically just get things done. No matter how huge a task might seem to be, nothing is impossible to achieve.&lt;/p&gt;

&lt;p&gt;That's been my story over and over again in my coding journey. On paper Im a woman, a mother and in my 30s. But I still got my first professional gig as a junior software developer, in 8 months with no background in programming.&lt;/p&gt;

&lt;p&gt;So I went out and got things done and sought the assistance of anyone whom I thought could help. And in the end we had an epic team. The Tech Village was kind in enough to host the event, and we had brilliant speakers onboard: Alistair Holmes, Micheal Dera and Jeff Chiveya and the local techie community came in numbers to participate.&lt;/p&gt;

&lt;p&gt;The speakers came up with the most brilliant and informative presentations, throughout out the whole event I was totally captivated kept at the edge of my seat. And am proud to say I'm now an open source convert!&lt;/p&gt;

&lt;p&gt;Although I played a small part in yesterday's event. I did a basic intro to the event. I overcame my fear of speaking publicly. Despite sweaty palms and heart palpitations I did it!I overcame my anxieties. For me just that is a feat on its own. I know surely as I continue to volunteer to speak more I will improve.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thank you for reading my story.&lt;br&gt;
Now let me get back to working on my PRs;)&lt;/em&gt;&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
    </item>
    <item>
      <title>And then we resolve a merge conflict...</title>
      <dc:creator>Jacqueline Binya</dc:creator>
      <pubDate>Thu, 10 Oct 2019 02:32:09 +0000</pubDate>
      <link>https://dev.to/jacqueline/and-then-a-conflict-2eli</link>
      <guid>https://dev.to/jacqueline/and-then-a-conflict-2eli</guid>
      <description>&lt;p&gt;Since my introduction to the git workflow. I have resolved my own fair share of conflicts. Admittedly when I started using git, conflicts were frustrating and upsetting occurrence mainly because I didn't understand why and how they occurred. &lt;/p&gt;

&lt;p&gt;Unwittingly I actually thought they were something I could avoid, I thought there was a way I could outsmart git, hahaha! The word conflict has a negative connotation to it so don't blame my newbie response. &lt;br&gt;
I remember during my BootCamp at Andela, we worked in such a way that you could only merge your pull request to the main develop branch if it had been reviewed and then approved.&lt;br&gt;
So my genius way of ensuring I totally avoided conflicts, was to wait and have my PRs approved and consequently merged to the develop branch one at a time and that impacted negatively on my overall output. &lt;br&gt;
The reason I feared conflicts was the first time I was ever brave enough to queue up my PRs I made a giant mess trying to resolve the conflicts and lost all my work. &lt;/p&gt;

&lt;p&gt;Anyways all the previous tutorials I had followed up to that point had only covered &lt;em&gt;git clone, pull and push&lt;/em&gt;, I honestly didn't know we made war in git! &lt;/p&gt;

&lt;p&gt;In this series, I document my steps in re-creating and hopefully resolving my favorite conflicts.&lt;/p&gt;
&lt;h2&gt;
  
  
  Keywords
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;HEAD: normally the HEAD pointer, points to the latest commit on a branch you have currently checked out.&lt;/li&gt;
&lt;li&gt;History: Git works by compiling information about details of commits of individual branches if you run the command

&lt;code&gt;git log&lt;/code&gt;

you get the history of a branch you have currently checked out.
Then &lt;em&gt;git log --oneline&lt;/em&gt; prints each commit on a single line, which is useful if you’re looking at a lot of commits.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Creating the conflict
&lt;/h2&gt;

&lt;p&gt;To get started I created a repo on github initialized it with a README.md and cloned it on my machine.&lt;/p&gt;

&lt;p&gt;Then on VS code, I opened &lt;br&gt;
Using the command,&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git checkout -b create-bio&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 I branched off &lt;em&gt;master&lt;/em&gt; and created a branch called &lt;em&gt;create-bio&lt;/em&gt; and then checked out &lt;em&gt;create-bio&lt;/em&gt;.&lt;br&gt;&lt;br&gt;
&lt;em&gt;create-bio&lt;/em&gt; is normally referred to as a feature branch. Its good practice to open a branch for every feature than work on your &lt;em&gt;master&lt;/em&gt;. This ensures you only merge to &lt;em&gt;master&lt;/em&gt; the code that works and your work is clean.&lt;/p&gt;

&lt;p&gt;After that I then created a file called &lt;em&gt;bio.txt&lt;/em&gt; and added a simple unimaginative line of code to it:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fribmlj9y7io89c1zucil.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fribmlj9y7io89c1zucil.png" alt="codeblock sceenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A git environment can be broken down into two distinct parts. The remote repository is where you push the code you want to share with others which in my case is hosted by Github and your development environment. The development environment consists of the working directory, staging area, and local repository. So basically when using git workflow, when you clone your repo from the remote it comes with a .git folder. That folder is basically the local repository. &lt;br&gt;
In essence, Git is a clever piece of software that not only ensures that you can track your files it also allows you to share them as well. Under the hood, git works by persisting branches and commits.&lt;br&gt;
The working directory is just that, the stuff you work on. So as you work you have to naturally keep track of the files you are working on and to do that you add them to the staging area. &lt;/p&gt;

&lt;p&gt;So to track &lt;em&gt;bio.txt&lt;/em&gt;. I add it to the staging area by running the command,&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git add .&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Using the command,&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git commit -m "Adds bio.txt"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I add &lt;em&gt;bio.txt&lt;/em&gt; to my local repository it's official, the changes I was tracking have been committed to my local repo.&lt;/p&gt;

&lt;p&gt;Remember when I started off I cloned my remote repository and it only had the &lt;em&gt;master&lt;/em&gt; branch now that I've created a new branch in my local. The local and the remote are out of sync so using the command,&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git push --set-upstream origin create-bio&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I create the branch &lt;em&gt;create-bio&lt;/em&gt; in the origin/remote and simultaneously push the changes in that branch to the remote repo.&lt;/p&gt;

&lt;p&gt;So far all things are fine and dandy, to introduce some chaos I then edit the file &lt;em&gt;bio.txt&lt;/em&gt; ever so slightly,&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F4ru147jlq82pcnxhj33c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F4ru147jlq82pcnxhj33c.png" alt="screenshot of code block on vs code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If u run the command,&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git status&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;You will see that the &lt;em&gt;bio.txt&lt;/em&gt; has been modified. So to add the changes I made to &lt;em&gt;bio.txt&lt;/em&gt; to the staging area I run the command&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git add .&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This time to add my staged changes to my local I use the command,&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git commit --amend --no-edit&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The command above allows me to combine staged changes with the previous commit instead of creating an entirely new commit. This git views as an entirely new commit, history has been re-written.&lt;/p&gt;

&lt;p&gt;To verify that history has been altered, if I log my git history on the terminal, although the commit message is the same for the tip of the branch before and after running the command &lt;em&gt;git commit --amend --no-edit&lt;/em&gt; the commit hashes (i.e. the string that precedes the commit message) are different as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;f780b5d (HEAD -&amp;gt; create-bio, origin/create-bio) Adds bio.txt
7619836 (origin/master, origin/HEAD, master) Initial commit
PS C:\Users\\Desktop\git-tut-1&amp;gt; git commit --amend --no-edit
[create-bio 1b61b25] Adds bio.txt
 Date: Thu Oct 10 03:30:45 2019 +0200
 1 file changed, 3 insertions(+)
 create mode 100644 bio.txt
PS C:\Users\\Desktop\git-tut-1&amp;gt; git log --oneline
1b61b25 (HEAD -&amp;gt; create-bio) Adds bio.txt
7619836 (origin/master, origin/HEAD, master) Initial commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;If you run the command,&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git status&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The message you get on the terminal is:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;On branch create-bio
Your branch and 'origin/create-bio' have diverged,
and have 1 and 1 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;I then attempt to sync my remote to my local, by running the command,&lt;br&gt;
&lt;br&gt;
&lt;code&gt;git push&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;On the terminal I get the error: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Feklp6fkudekdyka7m4zo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Feklp6fkudekdyka7m4zo.png" alt="Screenshot of code block"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As advised in the error message, I then run the command,&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git pull&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;And voila the message on the terminal reads:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CONFLICT (add/add): Merge conflict in bio.txt
Auto-merging bio.txt
Automatic merge failed; fix conflicts and then commit the result.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The conflict on VS Code: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkr8ezdjpwj7djjzmog8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fkr8ezdjpwj7djjzmog8u.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Resolving the Conflict
&lt;/h2&gt;

&lt;p&gt;Using VS Code editor it's very easy to resolve the conflict I simply choose to &lt;em&gt;Accept Current Change&lt;/em&gt;, this option allows me to keep the changes in the HEAD.&lt;br&gt;
You can then play around with the other options to explore how they work. Just ensure when you are done resolving the conflict your code looks normal as in you have gotten rid of the arrows, commit hash, and equal signs.&lt;/p&gt;

&lt;p&gt;I then run the command,&lt;br&gt;
&lt;br&gt;
  &lt;code&gt;git add .&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;To add changes to the staging area, then proceed to commit them by running the command&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git commit -m "Resolved"&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 After which I run the command:&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git push&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;So my local and remote are in sync.&lt;/p&gt;
&lt;h4&gt;
  
  
  The result:
&lt;/h4&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;



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