<?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 Devonte M on Medium]]></title>
        <description><![CDATA[Stories by Devonte M on Medium]]></description>
        <link>https://medium.com/@devontem?source=rss-37d3623e744------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*THlGHD4qCP3Hvr2wXRW7Sg.jpeg</url>
            <title>Stories by Devonte M on Medium</title>
            <link>https://medium.com/@devontem?source=rss-37d3623e744------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 23:59:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@devontem/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[Testing Asynchronous Methods in React (handle setState, http, fetch, etc)]]></title>
            <link>https://medium.com/@devontem/testing-asynchronous-methods-in-react-handle-setstate-http-fetch-etc-d71929770464?source=rss-37d3623e744------2</link>
            <guid isPermaLink="false">https://medium.com/p/d71929770464</guid>
            <category><![CDATA[jest]]></category>
            <category><![CDATA[enzyme]]></category>
            <category><![CDATA[functional-testing]]></category>
            <category><![CDATA[react-testing-library]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <dc:creator><![CDATA[Devonte M]]></dc:creator>
            <pubDate>Mon, 10 Feb 2020 04:29:53 GMT</pubDate>
            <atom:updated>2020-02-10T04:29:53.967Z</atom:updated>
            <content:encoded><![CDATA[<p>Testing is very useful, however writing great functional tests can be a pain. This is true especially when writing tests for the front-end, when there are so many variables and edge-cases to look out for. In this tutorial, I’ll demonstrate a simple React component that calls to an API and also share how to write a functional test for this functionality.</p><p>In this example, I am testing functionality on a React component after typing in a search term and clicking the search button, it should post to an endpoint. Below you can see I’ve mocked the fetch method to return dummy data and I simulate a click to begin the functionality for the test.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2880a18bf63698cf5d48f6efa816a6b9/href">https://medium.com/media/2880a18bf63698cf5d48f6efa816a6b9/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d71929770464" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Write Simple Tests for Node & Express API’s with Supertest]]></title>
            <link>https://medium.com/@devontem/write-simple-tests-for-node-express-apis-with-supertest-c92099d03ccf?source=rss-37d3623e744------2</link>
            <guid isPermaLink="false">https://medium.com/p/c92099d03ccf</guid>
            <category><![CDATA[supertest]]></category>
            <category><![CDATA[nod]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[express]]></category>
            <category><![CDATA[unit-testing]]></category>
            <dc:creator><![CDATA[Devonte M]]></dc:creator>
            <pubDate>Mon, 10 Feb 2020 03:56:31 GMT</pubDate>
            <atom:updated>2020-02-10T03:56:31.493Z</atom:updated>
            <content:encoded><![CDATA[<p>The <a href="https://github.com/visionmedia/supertest">Supertest</a> NPM module has made it incredibly easy to write unit tests for your backend API’s on Node and Express. If you are interacting with a database, it’s best to use a local development database seeded with test information. Best practices for this can be found <a href="https://www.freecodecamp.org/news/heres-how-you-can-actually-use-node-environment-variables-8fdf98f53a0a/">here</a>.</p><p>To test your API with supertest, all you need to do is import your express app server and then begin writing your tests!</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/75fd13440bcf97956d6bcda2e09f1f8b/href">https://medium.com/media/75fd13440bcf97956d6bcda2e09f1f8b/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c92099d03ccf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Hooks: Creating a simple app]]></title>
            <link>https://medium.com/@devontem/react-hooks-creating-a-simple-app-b2cc9657bb79?source=rss-37d3623e744------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2cc9657bb79</guid>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Devonte M]]></dc:creator>
            <pubDate>Tue, 17 Dec 2019 11:43:14 GMT</pubDate>
            <atom:updated>2019-12-17T13:17:13.997Z</atom:updated>
            <content:encoded><![CDATA[<h3>React Hooks: Creating a Simple App without Using Classes</h3><p>A few months ago I heard about React Hooks in the latest version of React (16.8), but I didn’t really look too much into it since I read that it was completely optional to use.</p><p>However, today I did some extensive reading on the topic and I learned how cool and easy to use hooks actually are!</p><p>Hooks are javascript functions that allow you to use <strong>state and other react features</strong> in functional components (formally known as stateless components, not anymore!). There are many benefits to this new design pattern. One is that its backwards compatible so you can integrate it into legacy code bases, it’s less verbose than writing React classes, and it simplifies and combines many of the different lifecycle methods.</p><p>I created an application that fetches a HTTP request on load (usually a task fit for componentDidMount), and that uses and mutates state. It’s a simple application all contained within one component, but a look at the code down below shows how much easier it is to write react components by using hooks.</p><p>Have a look at the code down below!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*VSNvrefe_iy0-X3_3MsFiw.gif" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d668e70a984f0481cc6219cf8d55276/href">https://medium.com/media/8d668e70a984f0481cc6219cf8d55276/href</a></iframe><p>Github Project: <a href="https://github.com/devontem/fortune-cookie-react-hooks">https://github.com/devontem/fortune-cookie-react-hooks</a></p><p>More on hooks: <a href="https://reactjs.org/docs/hooks-intro.html">https://reactjs.org/docs/hooks-intro.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2cc9657bb79" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Removing Pre-Filled iCloud / Apple ID Account from Mac]]></title>
            <link>https://medium.com/@devontem/removing-pre-filled-icloud-apple-id-account-from-mac-3002fd177f93?source=rss-37d3623e744------2</link>
            <guid isPermaLink="false">https://medium.com/p/3002fd177f93</guid>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[macbook]]></category>
            <category><![CDATA[icloud]]></category>
            <category><![CDATA[apple-id]]></category>
            <dc:creator><![CDATA[Devonte M]]></dc:creator>
            <pubDate>Tue, 30 Apr 2019 17:02:52 GMT</pubDate>
            <atom:updated>2019-04-30T17:02:52.735Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve had a friend recently create an apple id, or log into their Apple ID on your MacBook, you might find that even after you log out their username is pre-filled.</p><p>This happened to me! This can be easily fixed by just logging in with a different Apple ID. However, if you don’t want to have an Apple ID logged into a particular user account, you will still see your friends’ original pre-filled Apple ID.</p><p>When you go into settings, it probably looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RLBdwD0LyOuXU-TihmKC8A.png" /></figure><h3><strong>How to Fix It?</strong></h3><ol><li>Open up terminal and delete the Accounts directory</li></ol><pre>$ rm ~/Library/Accounts/</pre><p>2. Do nothing! It should be gone.</p><p>It looks looks like under the hood, after a computer restart or shutdown, the folder is regenerated by the operating system, and the database of previously used Apple ID’s are cleared.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3002fd177f93" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Diversity Gap in Tech]]></title>
            <link>https://medium.com/@devontem/the-diversity-gap-in-tech-d0e0884088ba?source=rss-37d3623e744------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0e0884088ba</guid>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Devonte M]]></dc:creator>
            <pubDate>Mon, 29 Apr 2019 22:56:04 GMT</pubDate>
            <atom:updated>2026-11-15T12:44:12.273Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4mOes1GEVOVks5SrEtcGnA.jpeg" /></figure><p>There is a big gap in the tech industry when it comes to diversity. Black and Latino people comprise just 1% of engineering leadership at Twitter, 2% at Google, and 2% at Facebook (according to their publicly released data). One way to help combat this is to make tech education available and accessible to these communities at a young age.</p><p>Yesterday, I worked with <a href="https://www.linkedin.com/company/27061704/">Black Boys Code</a>, a foundation that offers workshops teaching black boys how to code. It was such a cool experience, and I hope to work with some of these people in the next 15 years. I take networking very seriously. Jokes aside, I met a lot of bright kids who walked away proud of their new skills.</p><p>Exposure to careers you’ve never heard of, achieving competency with new skills, and having fun is a recipe for an interest that will shape the decisions these kids make throughout their academic career.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0e0884088ba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing the React ErrorBoundary Component with Chai & Enzyme]]></title>
            <link>https://medium.com/@devontem/testing-the-react-errorboundary-component-with-chai-enzyme-ff564ec1e7b7?source=rss-37d3623e744------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff564ec1e7b7</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Devonte M]]></dc:creator>
            <pubDate>Mon, 15 Oct 2018 22:35:49 GMT</pubDate>
            <atom:updated>2018-10-15T22:35:49.084Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently I’ve found myself needing to handle errors for a React application I’ve been working on. Using the ErrorBoundary pattern in ReactJS, it allows you to catch all errors that might occurs from the parent component and all of its sub components. More on the ErrorBoundary component <a href="https://reactjs.org/docs/error-boundaries.html">here</a>.</p><p>While writing some tests for this component I encountered some dilemmas on how to best test the component using Jasmine &amp; Enzyme. After some research, and trial and error, here’s a solution I began implementing.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/27d687b8e7561782b6f1ac07bd06d408/href">https://medium.com/media/27d687b8e7561782b6f1ac07bd06d408/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff564ec1e7b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solved! “invalid ELF header” with Docker and Bcrypt]]></title>
            <link>https://medium.com/@devontem/solved-invalid-elf-header-with-docker-and-bcrypt-444426d63605?source=rss-37d3623e744------2</link>
            <guid isPermaLink="false">https://medium.com/p/444426d63605</guid>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Devonte M]]></dc:creator>
            <pubDate>Sun, 07 Jan 2018 17:20:01 GMT</pubDate>
            <atom:updated>2018-01-07T17:20:23.143Z</atom:updated>
            <content:encoded><![CDATA[<p>The reason this error occurs is because the node module bcrypt is first compiled on your original machine (specific for your OS) and when an image is built on docker it cannot run since the OS is no longer the same.</p><p>How to fix it? Just build the node modules inside the container instead of sending them already built. The fastest way to do this is to:</p><ol><li>Create a .dockerignore file in the root of your app and add:</li></ol><pre>node_modules</pre><p>* This way the node modules aren’t being sent already built.</p><p>Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=444426d63605" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to pull a Docker Image from Docker Hub]]></title>
            <link>https://medium.com/@devontem/how-to-pull-a-docker-image-from-docker-hub-e99eb216594f?source=rss-37d3623e744------2</link>
            <guid isPermaLink="false">https://medium.com/p/e99eb216594f</guid>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Devonte M]]></dc:creator>
            <pubDate>Sat, 06 Jan 2018 22:01:59 GMT</pubDate>
            <atom:updated>2018-01-06T22:02:53.253Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m writing this because the process seemed very confusing before I learned how to do it!</p><p>Take into account this assumes that your app’s server code points to using PORT 3000 on default. If not, update that part of the code.</p><h3><strong>Instructions for pulling in Docker Image</strong></h3><ul><li>Open up your terminal (mac) or shell (windows)</li><li>Install <a href="https://docs.docker.com/engine/installation/">Docker</a> (&amp; start the program)</li><li>Run the following commands:</li></ul><pre>docker pull &lt;username&gt;/&lt;docker_image_name&gt;<br>docker run -t -p 8080:3000 &lt;username&gt;/&lt;docker_image_name&gt;</pre><p>**Note: You should see “Listening on Port 3000” on the terminal — and you’re connected.</p><ul><li>Navigate to: <a href="http://localhost:8080/">http://localhost:8080</a> to start using the application</li></ul><h3><strong>How to Stop the Image</strong></h3><p>To stop the server and remove the container, run the following commands in the terminal</p><pre>CTRL + C (to end the process)<br>docker ps <em>(copy the ID of the container, looks like “dc85329ce9db”)<br>docker stop &lt;id_number&gt; (this stops the image from running)<br></em>docker rm &lt;<em>id_number&gt; (this removes it from your cpu)</em></pre><p><em>*NOTE: replace id_number with actual ID number under “NAMES” column</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e99eb216594f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To: Create a NodeJS Docker Image and Push it to Docker Hub]]></title>
            <link>https://medium.com/@devontem/how-to-create-a-nodejs-docker-image-and-push-it-to-docker-hub-ab23d0a9e4d3?source=rss-37d3623e744------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab23d0a9e4d3</guid>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Devonte M]]></dc:creator>
            <pubDate>Mon, 06 Nov 2017 22:28:45 GMT</pubDate>
            <atom:updated>2018-01-06T21:50:11.149Z</atom:updated>
            <content:encoded><![CDATA[<p>Docker is a great tool that allows you to take a snapshot of an application as an image and run it in different environments without worrying about system requirements, app dependencies, etc.</p><ol><li>Create an account on <a href="https://hub.docker.com/">Docker Hub</a> if you have on already and install docker using brew install docker</li><li>In your application root, create a file called Dockerfile — Inside this file paste the following contents:</li></ol><pre>FROM node:7<br>WORKDIR /app<br>COPY package.json /app<br>RUN npm install<br>COPY . /app<br>CMD node server.js<br>EXPOSE 8080</pre><p>These are the instructions for docker when building you image. Modify as needed! This assumes you have a file called server.js that is in the root of your directory that runs your node server. Also, after the docker image is built it will run from port 8080 on your localhost.</p><p>3. Build your docker image! (already? that was fast!) <br>*Note: remove angle brackets when you replace with your username<br>*Note: Make sure Docker Daemon is running (not sure what that is? <a href="https://www.docker.com/get-docker">download docker</a> and hit start)</p><pre>docker build -t &lt;<em>replace_with_app_name&gt;</em> .</pre><p>4. Login to your docker hub account on terminal, and tag your application</p><pre>docker tag &lt;<em>replace_with_app_name&gt; &lt;your_username&gt;/&lt;replace_with_app_name&gt;</em></pre><p>You must follow the naming convention for your docker image in order to push it to Docker Hub (<em>users_name/app_name</em>).</p><p>5. Push your application to Docker Hub, then find it on your docker hub web portal</p><pre>docker push &lt;username&gt;/&lt;app_name&gt;</pre><p>That’s it folks! Leave a comment if you have any questions!</p><h3><strong>Some Other Useful Docker Commands</strong></h3><pre>docker images ls // view all images you&#39;ve created<br>docker ps -a // view all containers running<br>docker stop &lt;container_id&gt; // stop a container from running<br>docker rm &lt;container_id&gt; // delete a container<br>docker rmi &lt;image_name&gt;// delete an image<br>docker run -t -p 8080:3000 &lt;app&gt; // run an app, map the port to your<br>docker pull &lt;app_name&gt; // pulling remote repo from dockerhub</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab23d0a9e4d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NodeJS / Express: Using SSH to access MySQL remotely]]></title>
            <link>https://medium.com/@devontem/nodejs-express-using-ssh-to-access-mysql-remotely-60372832dd08?source=rss-37d3623e744------2</link>
            <guid isPermaLink="false">https://medium.com/p/60372832dd08</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Devonte M]]></dc:creator>
            <pubDate>Wed, 01 Nov 2017 22:32:49 GMT</pubDate>
            <atom:updated>2018-01-07T17:21:04.060Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m currently completing a course at University of Hertfordshire and for a project we’re working on we need to use our local MySQL database on our student account’s on our school’s server.</p><p>For the project I’m working on I’m using NodeJS / Express on the backend. I’ve spent a lot of time looking for node modules that could get the job done and came across an implementation using two node modules. Normally I would just connect to a mysql database with the npm modulemysql and then export the connection variable to be use it within my app. However, this doesn’t include connecting via SSH and then connecting to a MySQL database.</p><h3><strong>Database File — db.js</strong></h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/879264abfab0177393dc8b7be4be6cb7/href">https://medium.com/media/879264abfab0177393dc8b7be4be6cb7/href</a></iframe><h3><strong>Controller File — controller.js</strong></h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe9b767114cd9b90ea29bfc4bd43fd1d/href">https://medium.com/media/fe9b767114cd9b90ea29bfc4bd43fd1d/href</a></iframe><p>As you can see in the above code samples, first we need the npm module ssh2 to connect to our server, then once we’re connecting we use the npm module mysql2 to connect to our local MySQL server. Be sure to pass in the stream variable into the createConnection method (line 24).</p><p>When exporting the variables we wrap it in a promise so that when using it in other parts of the app we can execute our code when the promise is fulfilled, and we are passing the connection variable in the callback.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60372832dd08" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>