<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jennifer Olibie on Medium]]></title>
        <description><![CDATA[Stories by Jennifer Olibie on Medium]]></description>
        <link>https://medium.com/@jenniferolibie?source=rss-525dc7c87fe2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*PUzOyp_dC4VnjcTo.</url>
            <title>Stories by Jennifer Olibie on Medium</title>
            <link>https://medium.com/@jenniferolibie?source=rss-525dc7c87fe2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 00:23:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jenniferolibie/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How To — Link Heroku PostgreSQL to your NodeJs app]]></title>
            <link>https://medium.com/@jenniferolibie/how-to-link-heroku-postgresql-to-your-nodejs-app-c5df65cf6675?source=rss-525dc7c87fe2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5df65cf6675</guid>
            <category><![CDATA[heroku]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Jennifer Olibie]]></dc:creator>
            <pubDate>Wed, 09 Jan 2019 14:02:18 GMT</pubDate>
            <atom:updated>2019-01-09T19:13:50.913Z</atom:updated>
            <content:encoded><![CDATA[<h3>How To — Link Heroku PostgreSQL to your NodeJs app</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/0*2e3mwiqA-AZehd1d.png" /></figure><p>In this article, I’m assuming that you have a working API preferably built with NodeJS with PostgreSQL as database and hosted on Heroku. I’ll also highlight some of the errors I ran into and how I solved them.</p><p><strong>Make sure you have Heroku CLI set up — </strong>I’d earlier hosted my app on Heroku and deployed using GitHub instead of Heroku CLI. <a href="https://devcenter.heroku.com/articles/heroku-command-line">Follow the instruction</a> on your app’s dashboard deploy section to set-up the CLI. If you have Heroku CLI installed already, but deployed using GitHub, simply connect to your app’s remote by running the command: heroku set:remote --app &lt;app-name&gt; .</p><p><strong>Ensure PostgreSQL is properly installed locally — </strong>If you can run the psql commands on your terminal/command prompt, then PostgreSQL is properly installed. If you get errors like: psql: command not found` then PostgreSQL was not properly installed or added to PATH. To add Postgres to your system’s PATH,</p><ol><li>Search for system environment variables located in the advanced menu in the control panel.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*l7abqRrA1YErWkRAqA4GaQ.png" /><figcaption>Step 1.</figcaption></figure><p>2. Click on environment variables, select the `path` variable and click on edit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*uvSTZObBK82rHURaWGlpfA.png" /><figcaption>Step 2</figcaption></figure><p>3. Copy and paste the path that your postgresql was installed. Mine would be C:\Program Files\PostgreSQL\11\bin with `11` being the installed version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/525/1*A_TPam4pqJZdahMlGfPn4g.png" /><figcaption>Step 3</figcaption></figure><p>4. Save and restart your terminals. Your commands should be working now.</p><blockquote><strong>Tip</strong>: Specifying the role after the command overrides the default role your terminal runs with.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*rbJ068SxC7ryYDL8K0Mvdg.png" /><figcaption>Without defined role</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*koHRHG7DRd97DGqsm2zQJQ.png" /><figcaption>Role defined</figcaption></figure><blockquote><strong>Tip</strong>: If you&#39;re on Windows, I would recommend running your commands on bash such as git bash as most of these commands are based on Linux and windows will not recognize them as executables.</blockquote><p><strong>Creating a heroku postgresql database — </strong>To install heroku postgresql, follow this <a href="https://elements.heroku.com/addons/heroku-postgresql">link</a>, click on install install heroku postgres` and follow the prompts. Once that is done, read this <a href="https://devcenter.heroku.com/articles/heroku-postgresql#local-setup">documentation</a> for any further details.</p><p><strong>Populating your heroku postgresql database — </strong>If you already have an existing database locally, you can push the content to the heroku database by running the command:</p><p>heroku pg:push &lt;localdbname&gt; DATABASE_URL --app &lt;appname&gt;</p><p>If you happen to get the role &lt;rolename&gt; not found error, then run the command with the PGUSER and PGPASSWORD specified.</p><p>PGUSER=postgres PGPASSWORD=password heroku pg:push &lt;localdbname&gt; DATABASE_URL --app &lt;appname&gt; .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*wyRJ7TDHl5vV2NB72y0uyg.png" /></figure><p>If the above commands works for you, then lucky you. If not, these are the options I tried.<br>a. <strong>Taking a dump of my local db and restoring the file on heroku — <br></strong>Using pg_dump, take a dump of your local database by running the following command:</p><p>PGPASSWORD=&lt;yourpassword&gt; pg_dump -Fc --no-acl --no-owner -h localhost -U &lt;user&gt; &lt;dbname&gt; &gt; &lt;dbname&gt;.dump</p><p>To restore your heroku database, you will need to upload the dump file somewhere with an HTTP-accessible URL. Heroku <a href="https://devcenter.heroku.com/articles/s3">recommends using Amazon S3</a> with a <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-urls.html">signed url</a>. Then proceed to restore using the command</p><p>heroku pg:backups:restore &#39;&lt;SIGNED URL&gt;&#39; DATABASE_URL .</p><p>See this <a href="https://devcenter.heroku.com/articles/heroku-postgres-import-export">heroku documentation</a> for more details.</p><p>b. <strong>Manually accessing and popopulating your database — </strong>If you do not have much content on your database, you could maually run queries on the <a href="https://heroku-data-explorer.herokuapp.com/">heroku database gui</a>. Run the queries as you would using normal SQL commands such as CREATE TABLE , INSERT INTO , etc. After creating your tables, simply add rows by running SQL queries or click on the plus button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*PIbpX9gbtZLNLJTV7knc5A.png" /></figure><p><strong>Connecting to the Heroku database from your NodeJS app — </strong>Having setup your database, connecting to it is relatively easy. Simply change your connection string to</p><pre>connectionString = {<br>connectionString: process.env.DATABASE_URL,<br>ssl: true<br>};</pre><p>This DATABASE_URL is automatically set-up as Heroku Config Variable after your database setup. Run heroku configto see your configuration variables.</p><p>Here is my sample NodeJS database file using pg Pool. You can as well use pg Client and it would work just the same.</p><pre><em>const</em> { Pool } = require(&#39;pg&#39;); <br><em>const</em> secrets = require(&#39;../middleware/ENV&#39;).default;</pre><pre><em>const</em> env = process.env.NODE_ENV || &#39;development&#39;;</pre><pre><em>let</em> connectionString = {<br>    user: secrets.user,<br>    database: secrets.testDb,<br>    host: secrets.host<br>};</pre><pre>// checking to know the environment and suitable connection string to use<br>if (env === &#39;development&#39;) {<br>    connectionString.database = secrets.database;<br>} else {<br>    connectionString = {<br>    connectionString: process.env.DATABASE_URL,<br>    ssl: true<br>    };<br>};</pre><pre><em>const</em> pool = new Pool(connectionString);<br>pool.on(&#39;connect&#39;, () =&gt; console.log(&#39;connected to db&#39;));</pre><p><em>Remember to build your app again and push the changes to Heroku, else, your connection would always fail.</em></p><p><strong>I would love to know if anyone has an easier way of exporting local database to Heroku. Please do leave your comments and suggestions.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5df65cf6675" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing the new brainstorming process — Design Sprinting]]></title>
            <link>https://medium.com/@jenniferolibie/introducing-the-new-brainstorming-process-design-sprinting-5da020bee852?source=rss-525dc7c87fe2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5da020bee852</guid>
            <category><![CDATA[design-process]]></category>
            <category><![CDATA[design-sprint]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jennifer Olibie]]></dc:creator>
            <pubDate>Wed, 27 Jun 2018 11:42:33 GMT</pubDate>
            <atom:updated>2018-06-27T11:42:33.831Z</atom:updated>
            <content:encoded><![CDATA[<p>Everyday, new ideas and ways of doing things are coming out. Each fighting to override the other. Brainstorming used to be the bomb. It was seen as an effective way of bringing people to develop ideas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/0*OwEhDe9W6kDYIpNF.jpg" /><figcaption><a href="http://guidedhypnosisforlife.com/wp-content/uploads/2017/02/brainstorming-810x532.jpg">Brainstorm</a></figcaption></figure><p>However, it wasn&#39;t without it’s flaws. Most at times, it was the people who are louder and had more persuasive ways of voicing out their ideas that win, undermining the ideas of the less loud individuals. Business brainstorming worked in its own way, but often, it took more time than is required.</p><p>A month into my internship at <a href="http://www.genesystechhub.com/">Genesys TechHub Enugu</a>, my instructor <a href="https://medium.com/u/63bdc9ff9450">Nwangwu Ositadinma</a>, announced that we’d be embarking on a design sprint on the 7th week. Being a developer, I’d initially thought it had something to do with UX design or something of that sort. In my silly mind I was like, <em>‘Osita abiakwa ozo’ (Osita has come again). </em>It was until I read the <a href="https://designsprintkit.withgoogle.com/">design sprint kit</a> he had sent way earlier( <em>which I was reluctant to read :P</em> ) that I realized that it had nothing to do with the UX design of the product and everything to do with the product development and flow.</p><blockquote>A design sprint is a five-phase framework that helps answer critical business questions through rapid prototyping and user testing. Sprints let your team reach clearly defined goals and deliverables(things you expect you and your product to deliver) and gain key learnings, quickly.</blockquote><p>It was to help you get everything for your product ready before embarking in the development phase. I actually looked forward to it and a bit nervous.Our sprint was scheduled for 5 days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0cGdGm337NUT8MAl.png" /><figcaption><a href="http://www.zenexmachina.com/assets/themes/zxm/images/page-artefacts/design-sprint-02.png">design sprint</a></figcaption></figure><p><strong>Day 1: Understand</strong></p><p>I was excited. Seeing all the shinny and colourful stationaries: post-it notes, makers, sharpies, pencils, rulers, little post-its for voting,etc, on our desk made me feel like a child :P</p><p>My team was assigned to work on an e-transcript feature for schools to enable alumni get their transcript. Our sprint master was <a href="https://medium.com/u/ade0c719474e">Thompson</a>:<em>great guy!. </em>He explained all we needed to know to start the sprint. Rather than brainstorming, we were supposed to write down our opinions/ideas on the post-its and then the whole team votes and the opinion with the highest vote wins.</p><p>And there we go.</p><ul><li>Writing our long term goals and voting: We had to ask questions on what we hope to achieve, where we hope to see the project in the next few months and future.</li><li>Listing Sprint Questions: We had to consider all downfalls. What happens when we fail? Do we have a backup plan? How do we workaround something that doesn&#39;t work?</li><li>Writing Our How Might We notes: Using our colourful post-its and sharpies, we all wrote down our HMWs and posted it on the storyboard( <em>Ours was the glass wall behind us. We gats compromise nah</em>). HMWs asks questions on how we could do some basic things in our project? How we could make the project simpler.</li></ul><blockquote><strong>The How</strong>: shows that its a question on how things could be done.</blockquote><blockquote><strong>The Might</strong>: shows that, it is possible we might not be able to solve the problem or get that idea to work.</blockquote><blockquote><strong>The We</strong>: emphasizes that the project is a team work.</blockquote><ul><li>Explaining, organizing and voting on our HMWs: Unsurprisingly, we started brainstorming during the explanations. <em>You cant blame us, its what we are used to. </em>Anywho, due to time, we went back on track and voted.</li><li>From our HMWs, we drew up our project map, using the discover, learn, use and goal structure and then outlined our target.</li><li>We also then came up with our Can We notes: Here we asked questions on how we can improve our product and how we can get the features we mentioned in how HMW to work.</li></ul><p>We hadn’t managed to do the lightening talk because of time. It was then shifted to the next day. It was a great first day. Really exhausting but worth it.</p><p><strong>Day 2: Sketch</strong></p><p>Our sprint continues.</p><ul><li>As a spillover from day 1’s schedule, we had a lightening demo from by Onuorah Susan, the people and culture manager at Genesys Tech Hub. She explained the basic things about the etranscript feature. We also had to browse around to see existing features from other schools.</li><li>After the lightening demo, came the actual day’s work. The Four-Step Sketch. We took notes individually and jotted down ideas. After which, we embarked on the crazy 8s, in which we were to sketch a variation of our best ideas.</li><li>Solution Sketching: After the crazy 8’s, we made a solution sketch of our ideas, making them as explanatory as possible.</li></ul><blockquote>We had to work alone together. Each person having to develop his/her own solution on their own.</blockquote><ul><li>Recruiting Customers for Prototype testing: I was chosen to be the team leader and thus, was in charge of recruiting the customers for testing of the prototype. I had to write emails and personally remind each and everyone of them.</li></ul><p><strong>Day 3: Decide</strong></p><ul><li>Using the solution sketches made by each one of us, we had to decide on which ideas to prototype and which to discard. This brought up a lot of arguments being as it was our first time and the whole idea of not brainstorming was still vague to us. However, we voted and concluded on the parts to prototype.</li><li>Making a Storyboard: We each chose an opening scene and drew up our storyboard. This was a grid of 5–15 squares which tells the story of how our user gets to encounter our app up till the end when the goal is achieved.</li><li>Voting on the storyboard: We each voted on the storyboard which best fitted what we wanted our app to do. Unfortunately, there was a tie and we had to call on the decider <a href="https://medium.com/u/63bdc9ff9450">Nwangwu Ositadinma</a> to pick for us. And he chose mine, yippeeee…(<em>not that it matters anyway</em>)</li></ul><p><strong>Day 4: Prototype</strong></p><p>Prototyping day… We assigned different tasks to ourselves: UX writer, interviewer, designer, prototype pre-testers. We all got to work, reading up articles , UX writing, preparing interview questions for tomorrow, designing the prototype using Adobe XD, reminding our customers for the prototyping session.</p><p><strong>Day 5: Validate</strong></p><p>So the d-day came. I was tres nervous that our prototype would not be ready before time(<em>Scary stuff</em>). However, our designers, <a href="https://medium.com/u/e3ef60e9b66a">Nnadozie Henry</a> and <a href="https://medium.com/u/a8c677f6d15">Angel Opoku</a> came through for us, with the amazing prototype.</p><p>Our customers came, as expected, we had both negative and positive feedbacks.</p><p>I was amazed and satisfied with what we came up with just after 5 days.</p><p><a href="https://medium.com/u/63bdc9ff9450">Nwangwu Ositadinma</a> emphasized on the importance of this design sprinting. He told us the story of his friend whom, the project he has been working on since January(<em>that’s like 5months</em>) got cancelled because of the lack of proper structure and user testing.</p><p><em>The End.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5da020bee852" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The worst part about growing up]]></title>
            <link>https://medium.com/@jenniferolibie/https-medium-com-jenniferolibie-the-worst-part-about-growing-up-d18d160a887c?source=rss-525dc7c87fe2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d18d160a887c</guid>
            <category><![CDATA[decision-making]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[consequences]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[growing-up]]></category>
            <dc:creator><![CDATA[Jennifer Olibie]]></dc:creator>
            <pubDate>Tue, 05 Jun 2018 08:26:56 GMT</pubDate>
            <atom:updated>2018-06-05T08:28:22.083Z</atom:updated>
            <content:encoded><![CDATA[<p>To me, is having to make decisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/296/0*V89m09N97t_-R3_t" /></figure><p>Ever since I was small, I’d always been a brilliant student. Well, not particularly, but for the majority of it anyway. I had my mother’s genes, I am my mother’s daughter indeed. I only had one major issue, making decisions.</p><p>Growing up, I could get away with throwing my decisions at my mom or my siblings and allowing them do the hard work, I thought it was going to be like that forever. My mum died when I was 19 years old, 10 days after my birthday, so that deciding factor was out. I still had other options though, or so I thought.</p><p>Fast forward, 2 years later, my school’s internship program, I submitted several forms and wrote some exams for each. I got accepted into three companies and that was when my biggest hurdle yet came. I was faced with the biggest decision of my life, deciding which company to go to.</p><p>As usual, I thought I could play the people-deciding-for-me card but nobody was going to take that up. All I kept hearing was a couple of advice, followed by, ‘You have to find out what you want for yourself and take that path. Whatever the outcome, live with it’. I was devastated. I cried myself to sleep most times, I did endless research which all ended up to be null. I wished I never had to grow up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*f60cHUqxbgHUuHfc" /></figure><p>Out of the three, one was automatically disqualified, as the duration did not reach the required duration for the internship. Phew, work made easier. After much deliberations, I chose company A: the one I thought I would learn more at.</p><p>A month into the internship, company B called my dad and requested that I come for medical screening. Company B was a big and reputable company so obviously, I had a lot of explaining to do for my choice of company A. I did explain and he understood.</p><p>Then came my sister, she’s a lawyer, so if she didn’t shatter my brain with believable reasons to go with company B, then I wouldn’t see her as a good lawyer. The night I called her, she really did convince me that company B was better. I was indeed in a mix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/0*Fu0vkWST8c18ojnF" /><figcaption>facing the consequences</figcaption></figure><p><strong>But after thinking about it, I decided to stay where I was and face the consequences.</strong></p><p>It might not be the best decision and it might not be the right decision but it is my decision and I am prepared to face the consequences, come what may.</p><p>For everyone going through the same hurdle, just know that you’re not alone and it’s not always going to work out well like it did for GitHub founder, <a href="https://medium.com/u/57664b9fe502">Tom Preston-Werner</a> but just own up to it. I hope it works out well though.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/204/0*uL78LWT6DvtmI-G7" /></figure><p>This life is yours to live and eventually, you’ll realize that no one is going to definitively move you through it and be grateful for everything that happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/0*8tWkuac0pgZlMrns" /></figure><p>I’m just going to pick books on decision-making skills and equip myself better.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d18d160a887c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I hate GenesysTechhub]]></title>
            <link>https://medium.com/@jenniferolibie/why-i-hate-genesystechhub-91fd7801b3f4?source=rss-525dc7c87fe2------2</link>
            <guid isPermaLink="false">https://medium.com/p/91fd7801b3f4</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[genesystechhub]]></category>
            <category><![CDATA[worklife]]></category>
            <category><![CDATA[life-lessons]]></category>
            <dc:creator><![CDATA[Jennifer Olibie]]></dc:creator>
            <pubDate>Fri, 25 May 2018 00:57:05 GMT</pubDate>
            <atom:updated>2018-05-25T00:57:05.547Z</atom:updated>
            <content:encoded><![CDATA[<p>The people here make me...</p><p>It’s been a month now into my SIWES program at Genesys. I’d been very nervous about working because it’d be my official first time working.<br> <br> I’ve come to learn that the people in your life make it what it is not you as an individual. Don’t get me wrong, it all depends on your reaction though.</p><p>My story:<br> <br>I’m a sleep lover so imagine how it feels having to sleep late and wake up really early by 4–5am every morning then rush out for work. Often, I’d have to stand for not less than 20mins awaiting the bus that comes out nearly full.</p><p>But would you believe me if I said that I now look forward to those early mornings and 8–5s?</p><p>What happened?</p><p>Every morning I wake up, I look forward to another day at the office. I look forward to seeing Kene’s face at that bus stop with a smile awaiting my arrival or my energetic mentor, Nwando who’s eagerness is infectious.</p><p>I look forward to walking into the office and fist-bumping or hi-fiving my instructor and colleagues both senior and juniors, instead of the normal official ‘goodmorning, sir’ greeting. I can walk into any office without having to knock and they don&#39;t look at me with disdain or seniority, even the boss&#39;s.</p><p>I look forward to sitting with my colleagues in the office and eagerly await the argument which must surely erupt for the day. There’s not a day that passes that, despite the workload, I don’t laugh myself silly because of some joke or something. The people at genesys have time management at their tips. They party like there’s no work tomorrow but work like they never partied. <br>The energy and fun I feel at Genesys is contagious.<br>The people here make me happy.<br> <br> I hate Genesys because if I’d never be satisfied if I don’t end up working in a similar environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91fd7801b3f4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Here’s what you need to know about Regular Expressions]]></title>
            <link>https://medium.com/@jenniferolibie/heres-what-you-need-to-know-about-regular-expressions-ac5f1148effa?source=rss-525dc7c87fe2------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac5f1148effa</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[writer]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[regex]]></category>
            <category><![CDATA[regular-expressions]]></category>
            <dc:creator><![CDATA[Jennifer Olibie]]></dc:creator>
            <pubDate>Mon, 21 May 2018 12:07:07 GMT</pubDate>
            <atom:updated>2018-05-21T14:45:11.226Z</atom:updated>
            <content:encoded><![CDATA[<p>I feel like I’m the only one who still likes RegEx…maybe you would too.</p><p>I hear a lot of people complaining about how difficult and annoying RegEx can be. I&#39;ve seen a lot of negative statements about it. Yeesh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*eiqUk8yDrfMCGwsN.jpg" /></figure><p>The first time I used RegEx, I was amazed. In just a few minutes, I was done with what I wanted to do. Simple as that. You can imagine my shock when I browsed online and saw a lot of hate speeches on my new love. Well, maybe I just haven’t worked for long with it..</p><p><strong>Let’s talk about this Regular Expression(RegEx)</strong></p><p>A regular expression is an expression/sequence of characters used to describe a pattern in a string.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/0*s4lnPT5Rm6DQPgEZ.png" /><figcaption><em>imgflip.com</em></figcaption></figure><p>It allows you to define the pattern/arrangement of characters you are looking for in a string, e.g an email pattern.</p><p>Thus, if I am looking for all the emails in a string, I can simply ‘regex’ the string and it gives me the emails.</p><p><strong>How does one create these expressions?</strong></p><p>Regular Expressions can be constructed in two ways:</p><ol><li>Literally: Formally known as <em>using a regular expression literal</em>. The pattern is enclosed between forward slashes. This is cool and makes work faster when the pattern is not changing.</li></ol><pre>let pattern = /pattern/;</pre><p>2. Constructing: Otherwise known as <em>calling the constructor function of the RegExp object</em>. This is good for when the pattern is changing or are getting the pattern from another source.</p><pre>let pattern = new RegExp(&#39;pattern&#39;);</pre><p><strong>What makes up this pattern?</strong></p><p>The RegEx patterns are made of the normal characters you know. Nothing scary or out of the ordinary, they just have special meanings here. Let’s look at some of them..</p><ol><li><strong>Alphabets and numbers</strong>: Of course, the pattern can contain the letters of the alphabet and numbers, afterall the strings are mostly made of alphabets and numbers. These characters can be themselves or mean something else depending on what you want. For direct matching, let the characters be themselves. They are <strong>non-special characters</strong>. Eg, the pattern /love/ matches only when it sees the characters ‘love’ together as in ‘I <strong>love</strong> you’. It doesn’t match in ‘I lo ve you’ because there’s a space character in-between ‘o’ and ‘v’.</li></ol><p>Most times, we need something more than a direct match, or we dont know what exactly we’re searching for, then we’ll involve <strong>special characters. </strong><em>Some are:</em></p><p>2. <strong>Escaped characters: </strong>A <strong>backslash(\)</strong> is generally an escape character which means that, when it precedes a character, it gives the character a different meaning.</p><p>A backslash before(preceding) a non-special character makes it a special character. E.g</p><pre>The letter &#39;w&#39; in itself finds w but \w finds all word characters ie a-z, 0-9 and underscore(_).</pre><p>A backslash before(preceding) a special character makes it non-special. E.g</p><pre>* by itself means 0 or more of the preceding character whereas \* finds * itself.</pre><p>3. <strong>Anchors: </strong>Anchors are characters used to specify the position in which a match must occur. When you specify the anchors, the regex looks for a match only in the specified position. Examples include:</p><p>i. <strong>^ </strong>: This specifies that the match must occur at the beginning of the input or line.</p><pre>The regex, /^c/ matches the c in children and not the c in can or cook in the string: &#39;children can cook&#39;</pre><p>ii. <strong>$</strong>: This specifies that the match must occur at the end of the input or line. It can match the character before the newline character is the <em>multi-line flag</em> is set.</p><pre>The regex, /k$/ matches the k in sick and not in kids in the string: kids get sick.</pre><p>iii. <strong>\b </strong>: This specifies that the match must occur on a word boundary ie beginning or ending of a word where <strong>\B </strong>is the opposite.</p><pre>The regex, /b\b/ matches the first b in <strong>b</strong>abies and not the third b, ba<strong>b</strong>ies. </pre><p>For more, visit <a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/anchors-in-regular-expressions"><em>this</em></a><em>.</em></p><p>3. <strong>Character Classes : </strong>A character class defines a set of characters, of which, any of them can occur in a string and be matched. They include:</p><p>i. []: Called positive character groups. Any character inside the square bracket is matched.</p><pre>/da/ matches a and d in abcd but doesn&#39;t match c and d.</pre><p>ii. [^]: Called negative character groups. Any character inside the square bracket is not matched. Eg</p><pre>/^da/ matches bc in abcd but doesnt match a and d.</pre><p>iii. dot(.): This matches one out of any character. Eg</p><pre>/d./ matches d and any other character after it like da, do, d_, etc</pre><p>iv. \w: Known as the word character. This matches any one of the word character i.e a-z, 0–9 and underscore(_). Can also be written as [a-z0–9_].</p><p>v. \W : Non-word character. It is the opposite of \w. It matches any non-word character. It can also be written as [^a_z0–9_].</p><p>vi. \d: Known as digit character. Matches any digit from 0–9. Also written as [0–9]</p><p>vii. \D: Known as non-digit character. Matches non-digits. Also written as [0–9].</p><p>4. <strong>Groups:</strong> This enables you to combine some parts of a regular expression and work on them as a singular entity. Sub-expressions are usually grouped using brackets(). Grouping Sub-expressions can enable you to:</p><p>i. Capture the expression: Also known as capturing parenthesis. This essentially tells the regex to remember the captured expression and you can reference to them later. Eg:</p><pre>using /(abc).\1/ on the string &#39;this string captures <strong>abcdabc&#39; . </strong>The abc is captured and remembered and the \1 specifies that it should use the remembered expression. The . in-between means any character in this case &#39;d&#39;.</pre><p>Capturing parenthesis are numbered sequentially, i.e the first capture is 1, the second is 2 and so on and the the computer remembers them like that. Eg</p><pre>/(hi)(hello)\2\1/ will match &#39;hellohi&#39;</pre><p>ii. Non-capturing parenthesis: To group elements but not capture them, use /(?:pattern)/. The ?: tells the computer that it should just group but not remember the expression.</p><p>iii. Lookaheads: I’ll explain this using examples.</p><pre>/a(?=b)/ means match a only if it is followed by b. Thus, it matches the a in &#39;<strong>a</strong>bcd&#39; but not the a in &#39;<strong>a</strong>cfd&#39;.</pre><pre>/a(?!b)/ means match a only if it is not followed by b. Thus, it matches the a in &#39;<strong>a</strong>cfd&#39; but not the a in &#39;<strong>a</strong>bcd&#39;.</pre><p>Visit <a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/grouping-constructs-in-regular-expressions">here</a> for more of these.</p><p>5. <strong>Quantifiers</strong>: This<strong> </strong>specifies the number of the characters or group that has to be present before a match is made. They include:</p><p>i. <strong>*</strong>: This specifies that it should match 0 or more of the preceding character. Thus:</p><pre>/ca*/ matches c in cloth, ca in catch, caa in caald essentially means match c and any number of a&#39;s following it.</pre><p>ii. <strong>+: </strong>This specifies that it should match 1 or more of the preceding character. Thus:</p><pre>/ca+/ does matches any in cloth, but matches ca in catch, caa in caald essentially means match c and 1 or more of the a&#39;s following it.</pre><p>iii. ? : This specifies that it should match 0 or 1 of the preceding character. Thus:</p><pre>/ca?/ matches c in cloth, ca in catch but doesn&#39;t match caa in caald. It essentially means match c and 0 or 1 of the a&#39;s following it.</pre><p>iv. {n} : n is an integer specifies the exact number of times the preceding expression is to be matched. {n,m} specifies that it should match the preceding character from n to m times. If the m is omitted, it should match n and above times.</p><pre>/c{2}/ - matches c that o<strong>cc</strong>urs exactly 2 times<br>/c{2,}/ - matches c that o<strong>cc</strong>urs<strong> </strong>2 or more times<br>/c{2,5}/ - matches c that occurs 2 times but not greater than 5 times.</pre><p>v. Greediness and Laziness: Most regular expressions are <strong>greedy</strong>, in that they match the longest possible characters/occurence as possible. To make it <strong>lazy,</strong> appending ? after it specifies it should match as few characters as it can at a time. Eg</p><pre>using the string &#39;&lt;html&gt;Hi&lt;/html&gt;&#39;<br>The regex /&lt;.+&gt;/ matches the whole string <strong>&lt;html&gt;Hi&lt;/html&gt; </strong>whereas<br>The regex /&lt;.+?&gt;/ matches just &lt;html&gt; and &lt;/html&gt;.</pre><p>6. <strong>Alternation: </strong>This enables conditional matching in regex.</p><p>i. or (|): This allows the regex to match any of the specified expression. Eg</p><pre>/bl(ac|ak)s/ matches blacs and blaks in a string</pre><p>ii. Conditional Matching with an Expression: This enables matching one of two patterns depending on if an initial pattern is matched or not. Eg</p><pre>(?(abc)d|0) matches abcd in &#39;abcdef0&#39; but matches 0 in &#39;fgh0&#39;.</pre><p>Visit <a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/alternation-constructs-in-regular-expressions">here</a> for more explanation.</p><p>7. <strong>Flags: </strong>Flags in regular expressions are used to specify how the expression in regular expressions are inteerpreted by the computer. The flags are appended at the end of a regular expression as follows ‘/pattern/flag’. We have:</p><p>i. global flag(g): It prevents the search from getting only the first match. It enables it to also get the subsequent searches in a string.</p><p>ii. ignore case flag(i): It makes the search case insensitive.</p><p>iii. multiline flag(m): This enables searches to done line by line. This is essential for start(^) and end($) anchors to match start and end of lines instead of start and end of the whole string.</p><p>iv. unicode flag(u): This when set, makes other escapes strictier. Thus unrecognised escapes cause errors. Also, it enables one to use extended unicode escapes. That is</p><pre>Without the flag, things like \u{1234} can technically still occur in patterns, but they won’t be interpreted as Unicode code point escapes. /\u{1234}/ is equivalent to /u{1234}/, which matches 1234 consecutive u symbols rather than <a href="https://codepoints.net/U+1234">the symbol with code point U+1234</a>.<br>Setting the u flag allows the expression /u{1234}/u to match the symbol with the unicode character(U+1234)</pre><p>v. sticky flags(y): This allows one to specify the index(0 indexed) to start from in searches. The y flag indicates that it matches from only the index specified by the lastIndex property of the regex. Eg</p><pre>var str = &#39;chidera&#39;<br>var regex = /hi/y;<br>regex.lastIndex = 3;<br>str.match(regex); // this returns null because the search starts from position 3.<br>regex.lastIndex = 1;<br>str.match(regex); this matches because it starts from position 1.</pre><p>Wow.. That feels like a lot to take in. Break Timeee:D</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*9gbqYHBM7mqoNWd3." /></figure><p><strong>So, we know about Regex and all. How exactly do we apply it?</strong></p><p>Basically, from all the above, Regex are used to find patterns in strings. What then? You can choose to</p><ol><li>Just check if the pattern exists in a string and/or return the position.</li><li>Find and bring out the matched patterns.</li><li>Find and replace the matched patterns.</li><li>For validation i.e to check if an input matches the required pattern.</li></ol><p>In JavaScript, you can use regex in the following methods :</p><ol><li><strong>exec : </strong>It searches a string for a match and returns an array of the match or null if no result is found. This is called on the regex and the string passed in as argument.</li></ol><pre>syntax: regex.exec(string)</pre><p>2.<strong> match : </strong>Same with exec except that this function is called on strings and the regex passed in as a parameter.</p><pre>syntax: string.match(regex);</pre><p>3. <strong>test</strong>: It tests for a match in a string and either returns true or false depending on if a match is found or not. It is faster than exec/match.</p><pre>syntax: regex.test(string);</pre><p>4. <strong>search</strong> : It tests for a match in a string and returns the index of the match or -1 if not match.</p><pre>syntax: string.search(regex);</pre><p>5. <strong>replace</strong>: It searches for a match and replaces the match with a specified replacement.</p><pre>syntax: string.replace(regex, replacement);</pre><p>6. <strong>split</strong>: It searches for a match in a string and breaks the string into arrays at that match.</p><pre>let str = &#39;Icneedctoceat&#39;<br>let words = str.split(&#39;c&#39;); //outputs [&#39;I&#39;, &#39;need&#39;, &#39;to&#39;, &#39;eat&#39;]</pre><p>That’s it for now.</p><p>Work your way into regex. It’ll be fun.</p><p>Remember:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*bMjL4mnTfd6Dpd5poHQKjg.jpeg" /><figcaption>Believe!!</figcaption></figure><p>For more extensive read, visit <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions">this</a>.</p><p>I’d recommend <a href="http://www.regexr.com/">www.regexr.com</a> for testing out and <a href="https://jex.im/regulex/#!flags=&amp;re=%5E(a%7Cb)*%3F%24">this</a> for visualizing the expression.</p><p>Feel free to correct any errors though :D</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac5f1148effa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get Git — The Basics(2)]]></title>
            <link>https://medium.com/@jenniferolibie/get-git-the-basics-2-b718b2536b9d?source=rss-525dc7c87fe2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b718b2536b9d</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[collaboration]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Jennifer Olibie]]></dc:creator>
            <pubDate>Fri, 18 May 2018 19:56:12 GMT</pubDate>
            <atom:updated>2018-05-18T19:56:12.695Z</atom:updated>
            <content:encoded><![CDATA[<h3>Collaboration, Do’s and Don’ts, Best Practices</h3><p>Here we are again trying to get git :D</p><p>Remember the gig ‘you’ got in my <a href="https://medium.com/@jenniferolibie/get-git-the-basics-30e5323182a2">first article</a> on git, to work on a project? That’s the case study 1.</p><h3>Case study 2:</h3><h3>a.</h3><p>You already have a stable version of the work but the customer has a lot of new ideas. It turns out the work is pretty bulky and you can’t do it alone. So you involve your knowledgeable friend(s) to collaborate with you. Y’all are working remotely. They already know the git basics (<a href="https://medium.com/@jenniferolibie/get-git-the-basics-30e5323182a2">here</a>).</p><p>Before you start working, you’re going to have to agree on the <strong>naming convention</strong> you’re going to use, discuss the roles each is to perform and other important issues you feel might arise so as to make the work even and avoid unnecessary issues. You, as the creator of the repo, has to give them access to the repo by:</p><ol><li>Click on Settings</li><li>Click on Collaborators on the left tab and then, using the person’s email or GitHub username(say Friend A) and then add collaborator button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*CEbDu7_8I_An3khc4cj9CA.png" /><figcaption>Adding collaborator</figcaption></figure><p>The person will receive an email and then has push access to the repo.</p><p>Then work starts.</p><p>I’ll explain the terms as we go. Any technical term that I don’t explain has probably been explained in my <a href="https://medium.com/@jenniferolibie/get-git-the-basics-30e5323182a2"><strong>other article</strong></a>. Please ensure to read it before proceeding.</p><p>Friend A now has full access to the repo. He clones the repo and in order not to affect the stable version, he has to create a<em> branch</em> in the repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*WuECaC0B7ubk501fu_5CzQ.png" /><figcaption><a href="https://www.atlassian.com/git/tutorials/using-branches">https://www.atlassian.com/git/tutorials/using-branches</a></figcaption></figure><p>Remember that a repo is like a tree, with nodes(1,2,3…) as commits and the trunk as the master branch. The other branches of the tree do not directly affect the master branch. Branching allows you to continue work on a repo from the point where you branched but not directly on the master branch that is, your local branch which started after commit 2, has all information up until commit 2. Commits 2.1 and 2.2 are now commits on that your branch. These commits do not affect commits 3 and 4(master branch) directly. How does one branch?</p><p>To create a new branch and <em>checkout</em> (enter/select) the branch, run the command</p><pre>git checkout -b &#39;branchname&#39;</pre><p>The -boption is a convenience flag that tells Git to run git branch &lt;new-branch&gt; before running git checkout &lt;new-branch&gt;.</p><p>From here on out, all the work you do will be in that branch. After working, you can push back to your branch by running</p><pre>git push origin &#39;branchname&#39;</pre><p>After Friend A is done working on his branch and you’ve reviewed it, Friend A can then merge into the master branch by running the following commands:</p><pre>git checkout master<br>git pull origin master<br>git merge &#39;branchname&#39;<br>git push origin master</pre><p>Git checkout master — This enters/selects the master branch. That is, you’re now working from master branch.</p><p>Git pull origin master — This fetches the changes in the master branch and merges it into your local master branch.</p><p>Git merge ‘branchname’ — Obviously, this merges your branch to the master brnach.</p><p>Git push origin master — This then pushes the changes to the origin master.</p><blockquote><strong>Did you know</strong>: Press “<strong><em>?</em></strong>” on any GitHub page and get a list of shortcuts which can be applied to this particular page</blockquote><h3>b.</h3><p>Another friend of yours, Friend B sees the project you’re working on, notices some bugs and decides to make some changes. She does not have access to the repo but <strong><em>she wants her changes to be merged into your work when she’s done</em></strong>. What does she do?</p><p>That’s where <strong>forking</strong> the repo comes in. Without access to the repo, forking the repo enables her create a copy of the repo as a repo in her account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CnYBTq3Z99WDn0HPzvc-PQ.png" /><figcaption>Fork the repoooo</figcaption></figure><p>After forking the repo, she now has a copy of the original repo in her own github account. She can now make all the changes she wants, as if it was her original repo using all the commands. When she’s satisfied with her work, she then sends a pull request to the original repo. You then access her changes and either accept or decline her pull request.</p><p><a href="https://help.github.com/articles/fork-a-repo/"><strong>Learn to fork more.</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/236/0*z0K_8_H-APpGRy2B.jpg" /><figcaption>I know you’re trying this out. :D</figcaption></figure><p><strong>While collaborating, there are many rules and practices to follow. Here are a few of them:</strong></p><ol><li>Commit messages:</li></ol><p>i. A single line is fine, especially when the change is so simple that no further explanation is necessary. In this case, keep it simple and straight to the point.</p><pre>Changed name from &#39;Jennifer&#39; to &#39;Chidera&#39; in name.file</pre><p>ii. However, when a commit merits a bit of explanation and context, you need to write a subject and a body. For example:</p><pre>Derezz the master control program<br><br>MCP turned out to be evil and had become intent on world domination.<br>This commit throws Tron&#39;s disc into MCP (causing its deresolution)<br>and turns it back into a chess game.</pre><pre>//copied from <a href="https://chris.beams.io/posts/git-commit/">https://chris.beams.io/posts/git-commit/</a></pre><p>2. Pulling and Pushing: If collaborating on a project, always ensure to pull, to incorporate changes in the remote repo into your local repo and <a href="https://www.git-tower.com/learn/git/ebook/en/command-line/advanced-topics/merge-conflicts">resolve</a> any <em>merge conflicts(errors that come in due to multi-change in same part of a code) </em>before pushing.</p><p><strong>Avoid force pushing at all times(pushing without resolving merge conflicts). </strong>Pushing without pulling, sometimes, might overwrite relevant changes made and lead to merge conflicts in the remote repo which breaks the program.</p><p>3. Naming Conventions: Always use a uniform naming convention for a code. If collaborating/contributing, read through the existing code and note their naming conventions and writing styles to ensure uniformity and readability.</p><p>Git and GitHub commands/conventions are very vast and cannot be fully captured in one article. Remember, <strong><em>Google is your friend.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b718b2536b9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Get Git — The Basics]]></title>
            <link>https://medium.com/@jenniferolibie/get-git-the-basics-30e5323182a2?source=rss-525dc7c87fe2------2</link>
            <guid isPermaLink="false">https://medium.com/p/30e5323182a2</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[basics]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Jennifer Olibie]]></dc:creator>
            <pubDate>Mon, 07 May 2018 20:43:05 GMT</pubDate>
            <atom:updated>2018-05-07T20:43:05.618Z</atom:updated>
            <content:encoded><![CDATA[<p>I know you must have asked couple of questions on what git is and what it does, and how it works. If I’m to guess, I’d say you must have come across the word <strong>Version Control </strong>a lot during your search.</p><p>What does this version control mean?</p><p>Let’s say you have a couple of people working on the same project, a text file for instance, each contributing, modifying, deleting and saving their parts simultaenously on that same text file. Now, it would be hard to know who changed what, when and why they changed something without asking everyone around. Here comes in version control.</p><p>Version control enables one to change, edit, delete, or work on a file by yourself or with a couple of people simultaneously while at the same time, taking note of what, when and why something was changed, that is, tracking each change. Not just that, you have the ability to revert changes, prevent someone from changing something or even recall a deleted part of the file. Isn’t that great?</p><p>There are many companies that host ‘git-ted’ applications but I’ll be using GitHub for my illustrations.</p><p>Simply put, GitHub is an application for hosting git applications in same way as Ms Word can be used to store word documents.</p><p>What Github is, is an online platform where such actions as version control explained above and collaborations on a file or project can be carried out by people in different locations.</p><p>I’ll explain the git terms as I proceed.</p><p>Let’s use a case study.</p><p>You, not necessarily a software developer, maybe writer, got a gig to work on a project and the customer insists she wants to see the progress of the work on GitHub. But you have no idea how to use GitHub, here are basic pointers.</p><p>First download and install git to your local working system (laptop). It’s really simple, just google this up.</p><p>Then visit <a href="http://www.github.com/">Github.com</a> and create an account.</p><p>Next you need to create a git <em>repository -</em> <em>A repository is simply a place where the history of your work is stored. Git stores the version control information here.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*g1-zMCLAvAjn5OqmwQsSsA.png" /></figure><p>Let’s say the name of the project is <a href="http://www.genesystechhub.com/">genesys.</a></p><p>For now, your repo is empty because you have not done any work. So next, you need to have a version of this repo in your local working area (laptop in this case) in order to work easily either online or offline, you need to have a copy of the repo in your local working system (laptop).</p><p>So you open your git bash in the directory you want the repo to be stored by right-clicking and selecting ‘Git Bash Here’. Make sure you have installed git.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*r_T3hF8kc-nupwJg_3C1Gg.png" /></figure><p>This opens up a terminal, from which you would be issuing your commands.</p><p>The first thing to do is to<em> clone</em> (download) the repo which you had created earlier. Copy the link to the repo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*eJimI0OEKnfY_UB4g5DuTw.png" /></figure><p>And paste it in the terminal after the git clone command. Now, you have a copy of the repo in your laptop(local repo) and it should appear as a folder in the directory that you git bashed at and we have to the change directory in order to start working inside the repo we just cloned using the <em>cd </em>command<em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/570/1*fereVespyBn6HDtE7gT5OQ.png" /></figure><p>All the work we do will be done in relation to the genesys folder.</p><p>Here, I have a file in the genesys folder and the customer wants to see the progress I’ve made so far and make changes. So I need these changes to reflect in the repo online. I run the commands as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*_9pguBTb3uLrgn8YDF6mtA.png" /><figcaption>basic git commands</figcaption></figure><ul><li>git add . -&gt; This is to prepare ALL my files to be committed(saved), technically known as staging my files. It allows git to tracking the files and changes made to it. Note the . after the add, you can add a particular file by specifying the file path after add instead.</li><li>git commit -m “commit message” -&gt; This is saving my file in my local repo. They serve as checkpoints for changes made to a file. -m indicates message while the message itself is inside quotes. The message must indicate clearly, what you saved/changed and why</li><li>git push origin master -&gt; This is the final stage in which I send the committed files to the repo online. So the customer now has access to it and can modify it if they so wish. origin indicates the source of the repo while master indicates the branch we are on(we’ll talk about this in another article).</li></ul><p>Assuming we add made other changes to the local repo folder-genesys, we can check the state of that repo using git status command.</p><p>Here, I added a new file without staging it for commit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/589/1*lp5M8Ol4mFzBe80UxLb_pQ.png" /></figure><p>Here, I added a new file, staged it for commit but have not commited it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*O0I7e2rtWLxgDTxywtEj3g.png" /></figure><p>There are so many other git commands like git log which lists all the commits made on a repo , git diff which you can use to check the difference between two commits, git pull which you can use to keep your repo up to date with changes in the online repo, etc. Try them out. Take courses on git. Pave your way to open source contribution.</p><p><strong><em>Never stop learning.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30e5323182a2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building my mini E-commerce app’s basic backend — buyFromDera]]></title>
            <link>https://medium.com/@jenniferolibie/building-my-mini-e-commerce-apps-basic-backend-buyfromdera-5379a1d82fb0?source=rss-525dc7c87fe2------2</link>
            <guid isPermaLink="false">https://medium.com/p/5379a1d82fb0</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Jennifer Olibie]]></dc:creator>
            <pubDate>Thu, 03 May 2018 18:30:29 GMT</pubDate>
            <atom:updated>2018-05-03T19:45:04.547Z</atom:updated>
            <content:encoded><![CDATA[<p>At Genesys TechHub, we believe that ‘everything is learnable’ and with that in mind, I’m going to put you through on how I built my first e-commerce app’s basic back-end. It’s not perfect and probably has a lot of bugs, but it’s a starter pack.</p><p>My last article was on code readability and with thtat in mind, I tried as much as I could to make my codes readable and refactor-able.</p><p>What does the app do? It performs a basic function of taking a customer’s order, running it through the products available in the store and returning the output. The output involves either, returning the total cost of items, telling the customer that the product/s are not in stock or that the quantity in stock is not enough. I know this sounds basic but it was actually tough for us beginner programmers.</p><p><strong>Read and Learn</strong></p><p>Steps:</p><ol><li>I created an array to represent my store. Each element of the array is an object which represents an item in the store and each item has a name, price and quantity in stock. Here, I have a total of 5 items in my store.</li></ol><pre>//declaring the stores array</pre><pre>var foodStore = [</pre><pre>{name: &#39;yam&#39;, price: 500, quantity: 80},</pre><pre>{name: &#39;beans&#39;, price: 1400, quantity: 30},</pre><pre>{name: &#39;rice&#39;, price: 3000, quantity: 15},</pre><pre>{name: &#39;noodles&#39;, price: 2700, quantity: 17},</pre><pre>{name: &#39;garri&#39;, price: 300, quantity: 20}</pre><pre>]</pre><p>2. Next, I created another array to represent the cart i.e things that have been ordered for. This array is in the same format as the store without the price property. The quantity represents the quantity the customer ordered for.</p><pre>// declaring the products in the cart</pre><pre>var inCart = [</pre><pre>{name: &#39;beans&#39;, quantity: 10},</pre><pre>{name: &#39;rice&#39;, quantity: 12},</pre><pre>{name: &#39;yam&#39;, quantity: 10},</pre><pre>]</pre><p>3. Then I declared the variable to hold the output after the search.</p><pre>var output;</pre><p>4. I consequently went ahead to create a function which loops through the cart and does the necessary calculations. This is the brain of the code. I’ll take this bit by bit.</p><pre>function buyFromDera(store, inCart){</pre><pre>var newStore = [{totalPrice:0},store];</pre><pre>var availableProduct = 0</pre><pre>var quantityIsEnough = true;    //item quantity is deemed enough</pre><p>i. The first line does the function declaration. The function is named buyFromDera with two parameters; store, which is the store to search from and inCart, which is the array for the products that have been ordered. This makes the function dynamic in case I want to search the store using a different cart or search from another store. I did not implement this in the current code as we have just one store and one cart.</p><p>The second line creates a newStore which is an array that contains the total cost of items that have been ordered as totalPrice and the updated contents of the store after the purchase has been made.</p><p>The third line declares the number of products in the cart that are available in the store. It is initialized to 0 because we have not searched the store yet.</p><p>The fourth line is a Boolean variable which is true if the number of goods in the store is enough for number of goods the customer wants.</p><p>ii. To loop through the items of the cart, I initially used a ‘forEach’ loop which did not work because I could not break out of the loop when I needed to. After much brainstorming and googling, I happened upon a ‘for … of’ loop. Yippee.</p><pre>for (var item of inCart){</pre><pre>var itemAvailable = false;          //assume the item is not available</pre><pre>store.forEach(function(product){ //checking if the item is in the store</pre><pre>if (item.name == product.name){</pre><pre>itemAvailable = true;           //items has been proven available</pre><pre>availableProduct++;</pre><p>So, the first line is the ‘for…of’ loop which loops through each item of the cart array and still allows me to break out of the loop.</p><p>The second line is a Boolean named itemAvailable which is initialized to false because the item has not been found in the store.</p><p>So for each item in the cart, I search through all items in the store using a forEach loop to see if the item is in the store.</p><p>Using the ‘ if’ conditional statement, I check if the item has been found by comparing the item’s name with that in the store as seen in the fourth line. If item is found, I assign itemAvailable to true to indicate that, ‘hey, I found your item’. I also go ahead the increment the number of available products.</p><pre>if (!itemAvailable){ //if item is not available, stop search</pre><pre>break;</pre><p>If the item is not found, the itemAvailable remains false and that triggers the break out of the loop statement.</p><p>iii. However, even if item has been found, I still need to check if the quantity in stock is enough for the quantity ordered.</p><pre>if (item.quantity &lt;= product.quantity &amp;&amp; item.quantity &gt;= 0){</pre><pre>newStore[0].totalPrice += item.quantity * product.price;  //calculate the price</pre><pre>product.quantity -= item.quantity;  //calculate the quantity that&#39;ll remain in store</pre><pre>}else{</pre><pre>quantityIsEnough = false;  //dummy variable to check when item quantity is not enough</pre><pre>}</pre><p>This I achieve using the if statement in line 1 above. I also had to make sure that the quantity of items ordered is greater than or equal to 0 in case the customer orders for a negative value(I know, I know, wouldn’t happen but we never know).</p><p>After that, I calculate the cost of the items by multiplying the cost of each item by the quantity of items ordered. Then I add them to the totalPrice.</p><p>I also subtract the quantity purchased from the the one in the store to know the quantity of items remaining in the store.</p><p>If the quantity is not enough, it assigns the value false to the quantityIsEnough variable to indicate that the quantity is not enough.</p><p>iv. When all the iterations are done, the values gotten from the iterations determine the output of the function.</p><pre>if (availableProduct == inCart.length &amp;&amp; quantityIsEnough==true){   //if all products are in store and enough quantity</pre><pre>console.log(newStore);</pre><pre>output = newStore;</pre><pre>}</pre><pre>return output;</pre><pre>}</pre><pre>buyFromDera(foodStore, inCart);</pre><p>First, I check if all items are available in the store and in the right quantity. If this condition is satisfied, the output becomes the total price and newstore values in an array as below:</p><pre>[ { totalPrice: 55000 },<br>  [ { name: &#39;yam&#39;, price: 500, quantity: 70 },<br>    { name: &#39;beans&#39;, price: 1400, quantity: 20 },<br>    { name: &#39;rice&#39;, price: 3000, quantity: 3 },<br>    { name: &#39;indomie&#39;, price: 2700, quantity: 17 },<br>    { name: &#39;garri&#39;, price: 300, quantity: 20 } ] ]</pre><p>If the first condition is not true, I then check if the number of products ordered i.e items in cart does not equal the availableProduct. Then I return the output as that ‘the product is not in store’.</p><pre>else if (availableProduct != inCart.length){  //if some are not in store</pre><pre>output = &#39;Product/s is not in Store&#39;;</pre><pre>console.log(&#39;Product/s is not in Store&#39;);</pre><pre>}</pre><p>Finally, if all those things don’t evaluate to true, it means that the quantity in store is not enough.</p><pre>else{ //if they are in store but not enough</pre><pre>output = &#39;Quantity is not enough&#39;;</pre><pre>console.log(&#39;Quantity is not enough&#39;);</pre><pre>}</pre><p>So I return the output and call the function.</p><pre>return output;</pre><pre>}</pre><pre>buyFromDera(foodStore, inCart); //this invokes the function to check the items in inCart against the items in the foodstore</pre><p><em>NB: console.log(output) logs/prints the output on the console and is used for debugging purposes whereas the return specifies the value that the function would return and which would be used for further programs when the function is invoked.</em></p><p>I hope you learn’t something. Do not hesitate to debug and correct me.</p><p>SEE THE COMPILED CODE BELOW:</p><pre>//03/05/2018</pre><pre>//By OLIBIE CHIDERA JENNIFER</pre><pre>//At GenesysTechHub, Tenece</pre><pre>//write a code representing an e-commerce store</pre><pre>//The store should be an array of products with name, price and quantity</pre><pre>//The cart should contain the name of the product and quantity to buy.</pre><pre>//the output should contain the total price and the new stock values</pre><pre>//declaring the stores array</pre><pre>var foodStore = [</pre><pre>{name: &#39;yam&#39;, price: 500, quantity: 80},</pre><pre>{name: &#39;beans&#39;, price: 1400, quantity: 30},</pre><pre>{name: &#39;rice&#39;, price: 3000, quantity: 15},</pre><pre>{name: &#39;indomie&#39;, price: 2700, quantity: 17},</pre><pre>{name: &#39;garri&#39;, price: 300, quantity: 20}</pre><pre>]<br></pre><pre>// declaring the products in the cart</pre><pre>var inCart = [</pre><pre>{name: &#39;beans&#39;, quantity: 10},</pre><pre>{name: &#39;rice&#39;, quantity: 12},</pre><pre>{name: &#39;yam&#39;, quantity: 10},</pre><pre>]<br></pre><pre>var output;<br></pre><pre>//function to buy from store with two parametes: 1 as the store, 2 as the things in d cart</pre><pre>function buyFromDera(store, inCart){</pre><pre>var newStore = [{totalPrice:0},store];</pre><pre>var availableProduct = 0</pre><pre>var quantityIsEnough = true;    //item quantity is deemed enough<br></pre><pre>//looping through each of the items in the cart</pre><pre>for (var item of inCart){</pre><pre>var itemAvailable = false;          //assume the item is not available</pre><pre>store.forEach(function(product){ //checking if the item is in the store</pre><pre>if (item.name == product.name){</pre><pre>itemAvailable = true;           //items has been proven available</pre><pre>availableProduct++;</pre><pre>if (item.quantity &lt;= product.quantity &amp;&amp; item.quantity &gt;= 0){</pre><pre>newStore[0].totalPrice += item.quantity * product.price;  //calculate the price</pre><pre>product.quantity -= item.quantity;  //calculate the quantity that&#39;ll remain in store</pre><pre>}else{</pre><pre>quantityIsEnough = false;  //dummy variable to check when item quantity is not enough</pre><pre>}</pre><pre>}</pre><pre>})</pre><pre>if (!itemAvailable){ //if item is not available, stop search</pre><pre>break;</pre><pre>}</pre><pre>};</pre><pre>if (availableProduct == inCart.length &amp;&amp; quantityIsEnough==true){   //if all products are in store and enough quantity</pre><pre>console.log(newStore);</pre><pre>output = newStore;</pre><pre>}</pre><pre>else if (availableProduct != inCart.length){  //if some are not in store</pre><pre>output = &#39;Product/s is out of Store&#39;;</pre><pre>console.log(&#39;Product/s is not in Store&#39;);</pre><pre>}</pre><pre>else{ //if they are in store but not enough</pre><pre>output = &#39;Quantity is not enough&#39;;</pre><pre>console.log(&#39;Quantity is not enough&#39;);</pre><pre>}</pre><pre>return output;</pre><pre>}</pre><pre>buyFromDera(foodStore, inCart);</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5379a1d82fb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Few Things About Code Readability]]></title>
            <link>https://medium.com/@jenniferolibie/a-few-things-about-code-readability-454e4871603c?source=rss-525dc7c87fe2------2</link>
            <guid isPermaLink="false">https://medium.com/p/454e4871603c</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Jennifer Olibie]]></dc:creator>
            <pubDate>Wed, 02 May 2018 17:46:42 GMT</pubDate>
            <atom:updated>2018-05-02T19:38:28.470Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever entered a room and felt disoriented? Like you can’t find the head or tail of the room, everything is scattered and things are misplaced? Imagine that being a thousand lines of code: with no comments, indentation or good name conventions. Any motivation you had to work on the code would be lost and even if you start, it’d be tiring and exhausting.</p><p>Compare this with entering a room, with the bed well-dressed, the books are stacked(alphabetically at that), clothes are not lying around and everything is in order. Relate that to your code. Things would be much easier for you or any other person who tries to work on your code.</p><p>That is where Code Readability comes in…</p><p>From the above analogies, Code Readability involves well, in plain terms: having readable codes. Lol. More explanatory, code readability involves having codes which at first look, is understandable, easy to maintain and use and motivational to work on i.e not unnecessarily tiring.</p><p>For a code to be readable, it should have at least some of the following:</p><ol><li>Indentation: Not just indentation, consistent indentation. If you’re using tab, be consistent with it. If it’s double-spacing, be consistent with it. If your using a particular format, just be consistent with it. Just make sure to indent. When you have a block of code, indentation is used to indicate the degree of nesting or relationship between the different lines of codes. It helps to easily different the parent from the child or to recognize siblings.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*FIOV_tCbQ1gOIXcOGUSISQ.png" /><figcaption><a href="https://www.pinterest.com/pin/40884309094177649/">https://www.pinterest.com/pin/40884309094177649/</a></figcaption></figure><p>2. Code Commenting: Sometimes, we tend to write some lines of codes that we would not remember their functions after some time without going back to documentation or searching the web. Commenting on codes makes it easier to recognise what a line of code does without much trouble. It also enables a third-party to recognise and know the functions of certain lines of code. However, we do know that too much of everything isn’t good. Try and avoid over commenting as much as possible so as not to cluster the code. To be honest, I am guilty of this, but we all learn everyday. Do not comment on lines whose actions are self-explanatory.</p><blockquote>For example, for php;</blockquote><blockquote><em>echo ‘I am a good girl’ //echoes I am a good girl.</em></blockquote><blockquote>The comment, i.e the sentence that starts after // is a redundant because the code is self explanatory.</blockquote><p>3. Avoid Lengthy Lines: Nobody wants to be reviewing a line of code and have to scroll horizontally to end to the end of the line. The standard maximum number of characters is 80 so as to avoid scrolling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*BiYiX0PwGhuGRI1wALVlzA.png" /><figcaption>Write shorter lines</figcaption></figure><p>4. Good Naming Convention: Any language you’re using has it’s own acceptable naming convention. Check the suitable ones for your language, pick one and stick to it. If it’s camel-case or hyphenated, etc, just pick one. Also, use names that indicate the function/content of the variable, function, class,method etc that you’re writing.</p><blockquote>For example,</blockquote><blockquote>var myHead;</blockquote><blockquote>it is obvious that the content of this variable would be related to a head. This makes them recognizable and find-able.</blockquote><p>5. Avoid Duplicate Codes: If you have a couple lines of code that seem to perform the same function, it would be better to write it as a single function which you can call repeatedly using the different values you need, instead of writing the code over and over and over and … again.</p><p>In essence, code readability makes code both easily navigational, manipulatable, readable and many other advantages.</p><p>From time to time, when you advance in programming, you can go back and refactor your codes. Refactoring means rewriting the way in which your codes are arranged or written without necessarily affecting their functions.</p><p><em>Say No To Unreadable Codes.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=454e4871603c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guesser Game vs First Day]]></title>
            <link>https://medium.com/@jenniferolibie/guesser-game-vs-first-day-1f739f66e8f?source=rss-525dc7c87fe2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f739f66e8f</guid>
            <category><![CDATA[first]]></category>
            <category><![CDATA[short-story]]></category>
            <dc:creator><![CDATA[Jennifer Olibie]]></dc:creator>
            <pubDate>Tue, 01 May 2018 06:58:27 GMT</pubDate>
            <atom:updated>2018-05-01T06:58:27.575Z</atom:updated>
            <content:encoded><![CDATA[<p>Guesser Game vs First Day</p><p>Talk about a remarkable first day. I woke up early, 5:30.. but somehow, I managed to leave my house by 7:23. Walking up my streets, it kept resounding, &#39;if you enter bus to the busstop, you&#39;re going to miss the company bus&#39;, on my first day? Noo way. I hailed down the first tricycle (keke) and jumped in. Got to the bus stop in less than 5 mins. I looked around and there they were, &#39; The Tenece Gang&#39;, looking auspicious with their laptops. I joined in, greeted and started the wait. The bus took a while and my back started hurting from the weight of my school bag. Kind Kene helped me with it. Soon enough, the bus came and alas, it was filled up. We had to wait for the next bus and in my mind I was like, &#39;So after all my hurrying and paying 500% of what I would&#39;ve paid if I&#39;d come with public bus instead of keke, yikes, shit happens anyway&#39;.</p><p>So we got to the company, settled down and I opened my laptop. I felt like &#39;my village people&#39; had a meeting on my sake and decided they&#39;d let things go my way for too long. I freaked, on the inside though, trying my best to keep a calm expression. I tried all I knew and googled but my laptop, refused to turn on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*ZHlLgPIOhC2dlEa07xC0Vw.png" /></figure><p>Mehn, after sharing my problem with my colleagues with no solutions working, I then asked Osita, our (no qualifying adjective yet) facilitator, who then directed me to a couple of guys who kindly dealt with the laptop. I thought my problems were over, little did i know, hehehe. I tried connecting the laptop to Wi-FI but I couldn&#39;t😳 , like &#39;twas asif some parts of the laptop were missing because I also couldn&#39;t change my powerplan and probably other things I hadn&#39;t noticed. We had a class by 3, at least the laptop was working. I fervently prayed that I wouldn&#39;t need to use the internet in class and thankfully, I didn&#39;t. We were introduced to NodeJs + a simple assignement, the Word Guesser Game.</p><p>I was busy, writing plain JavaScript, and the next thing I knew, someone somewhere was downloading an npm (a node module) and reading documentation and calling strange names for that same assignment. I was shook, struck outta balance, to say the least. I could not fathom how the seemingly simple assignment required those complications and soon after some delegations with them, we decided to ask for clarification. Well, guess what, it was a simple assignment afterall. No npm, no readfile, nada. I heaved a sigh of relief. I didn&#39;t have difficulties writing mine because I had prior knowledge but it served as a revision.</p><p>Still thinking of how I&#39;d submit my assignment since my laptop couldn&#39;t connect to Internet and praying that driving it would get it back to track, I got home, ran the driver and much to my stress, it didn&#39;t work. I freaked, worked up, I solicited from Osita and he said I could use my phone&#39;s slack. Cool then, I tried copying the file from my laptop to the smartphone but it wouldn&#39;t copy. I broke down😨. I thought it was part of the laptop issues that started today. Then, I went to the kitchen, made dinner, ate, tried it again and voila, it worked. So I successfully submitted my assignment and feeling awfully dizzy and worked up, I slept off.😴</p><p>Freaky First Day🤗</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f739f66e8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>