<?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 Murphy Ekwere on Medium]]></title>
        <description><![CDATA[Stories by Murphy Ekwere on Medium]]></description>
        <link>https://medium.com/@murphydhee?source=rss-a414383876a2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pzH4ptTE2hXz8eg4DAcBKA.jpeg</url>
            <title>Stories by Murphy Ekwere on Medium</title>
            <link>https://medium.com/@murphydhee?source=rss-a414383876a2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:49:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@murphydhee/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[Using Celebrate with node.JS]]></title>
            <link>https://murphydhee.medium.com/using-celebrate-with-node-js-543f635c29f7?source=rss-a414383876a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/543f635c29f7</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[middleware]]></category>
            <category><![CDATA[celebrate]]></category>
            <dc:creator><![CDATA[Murphy Ekwere]]></dc:creator>
            <pubDate>Thu, 21 Apr 2022 11:13:21 GMT</pubDate>
            <atom:updated>2022-04-21T11:13:21.156Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*ChePKo35TZDf2BDFpe5q9w.jpeg" /></figure><p>What is Celebrate ? and how do we make use of it in Node.JS?</p><p>Celebrate is an express middleware function that wraps the joi validation library. This allows you to use this middleware in any single route, or globally, ensuring that all inputs used are correct before any handler function.</p><p>Before going further what are Middleware functions?</p><p>They are functions that have access to the request object ( req ), the response object ( res ), and the next function in the application’s request-response cycle.</p><p>They carry out the following tasks :</p><ul><li>Execute any code.</li><li>Make changes to the request and the response objects.</li><li>End the request-response cycle.</li><li>Call the next middleware in the stack.</li></ul><p>Celebrate as a middleware function has been tested and found to have full compatibility with express 4 and 5. It likely works correctly with express 3ss, but including it in the test matrix causes more trouble than it&#39;s worth, so i don’t advice it. This is primarily because express 3 exposes route parameters as an array rather than an object.</p><p>The middleware allows you to validate</p><p>req.params, req.headers, req.query.</p><p>as well as</p><p>req.body- provided you make use ofbody-parser</p><p>req.cookies,- provided you make use of cookie-parser</p><p>req.signedcookies,- provided you make use of cookie-parser</p><p>Joi is listed as a formal dependency in Celebrate. This means that celebrate as a middleware function will always use a predictable known version of joi during the validation and compilation steps.</p><p>There are a few reasons why and they are as follows:</p><p>(1) Celebrate will be given access to the latest version of Joi as soon as it is published</p><p>(2) Compatibility of the Joi version so that it can be exported to the user and with that maximizing compatibility with the user</p><p>An Example of using celebrate on a single POST route to validate req.body.</p><pre>const express = require(&#39;express&#39;);<br>const BodyParser = require(&#39;body-parser&#39;);<br>const { celebrate, Joi, errors, Segments } = require(&#39;celebrate&#39;);</pre><pre>const app = express();<br>app.use(BodyParser.json());</pre><pre>app.post(&#39;/signup&#39;, celebrate({<br>  [Segments.BODY]: Joi.object().keys({<br>    name: Joi.string().required(),<br>    age: Joi.number().integer(),<br>    role: Joi.string().default(&#39;admin&#39;)<br>  }),<br>  [Segments.QUERY]: {<br>    token: Joi.string().token().required()<br>  }<br>}), (req, res) =&gt; {<br>  // At this point, req.body has been validated and <br>  // req.body.role is equal to req.body.role if provided in the POST or set to &#39;admin&#39; by joi<br>});<br>app.use(errors());</pre><p>Example of using celebrate to validate all incoming requests to ensure the token header is present and matches the supplied regular expression.</p><pre>const express = require(&#39;express&#39;);<br>const { celebrate, Joi, errors, Segments } = require(&#39;celebrate&#39;);<br>const app = express();</pre><pre>// validate all incoming request headers for the token header<br>// if missing or not the correct format, respond with an error<br>app.use(celebrate({<br>  [Segments.HEADERS]: Joi.object({<br>    token: Joi.string().required().regex(/abc\d{3}/)<br>  }).unknown()<br>}));<br>app.get(&#39;/&#39;, (req, res) =&gt; { res.send(&#39;hello world&#39;); });<br>app.get(&#39;/foo&#39;, (req, res) =&gt; { res.send(&#39;a foo request&#39;); });<br>app.use(errors());</pre><p>In conclusion according the the HTTP spec, GET requests should <em>not</em> include a body in the request payload. For that reason, celebrate does not validate the body on GET requests.</p><p>Congratulations you now know what Celebrate is and how to use it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=543f635c29f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Submit A Sitemap to Google Search Console Using Rank Math.]]></title>
            <link>https://murphydhee.medium.com/how-to-submit-a-sitemap-to-google-search-console-using-rank-math-d45b9a6348de?source=rss-a414383876a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d45b9a6348de</guid>
            <category><![CDATA[google-search-console]]></category>
            <category><![CDATA[sitemap]]></category>
            <category><![CDATA[rank-math]]></category>
            <dc:creator><![CDATA[Murphy Ekwere]]></dc:creator>
            <pubDate>Tue, 22 Feb 2022 00:47:09 GMT</pubDate>
            <atom:updated>2022-02-22T01:01:06.582Z</atom:updated>
            <content:encoded><![CDATA[<p>WHAT IS A SITE MAP?</p><p>In a simple explanation, a sitemap is an organized XML file containing all the URLs of your website which helps search engine bots find your website easily.</p><p>To understand it simply think of your website as a book and the sitemap as the table of content. Sitemaps are generally arranged in a hierarchical manner to help search engines crawl your content effectively.</p><p>Keep in mind that your site map is merely a suggestion and it is up to google to follow it. By using a site map you are specifying to web bots saying:</p><blockquote>‘Hey, these are a list of URLs I want you to index.’</blockquote><p>Using the rank math plugin, it combines all the individual sitemaps that contain posts, videos, pages all-inclusive in a single sitemap index. By doing this you save time spent manually building a sitemap, all you have to do is submit the link to the google search console it automatically updates when you change the site content and structure in the future.</p><p>In this knowledgebase article, I&#39;m going to walk you through how to submit a sitemap to Google in four easy steps; let’s get started:</p><p>STEP ONE:</p><p>To get started, you’ll need to sign in to the <a href="https://search.google.com/search-console/about">Google Search Console</a> using an account that has been <a href="https://rankmath.com/kb/google-site-verification/">verified</a> by google &amp; connected to your website.</p><p>STEP TWO:</p><p>In the search console dashboard go to the index section and click on sitemaps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*jWhp9ZX6Qu7wbJczOLWs9A.png" /></figure><p>STEP THREE:</p><p>Enter “sitemap_index.xml” in the Add a new sitemap field in order to complete the sitemap URL as seen below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*kelJTo11y_5htXiAq4g0SA.png" /></figure><p>STEP FOUR:</p><p>Click on submit and your sitemap will be submitted to google. You can also ensure that the <a href="https://rankmath.com/kb/exclude-sitemaps-from-caching/">sitemap is not cached.</a> Also, if you are using the <a href="https://rankmath.com/kb/analytics/">Analytics</a> feature of Rank Math, it will automatically submit the sitemap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*WHs-mzFtsMXUj79Wv-9WXg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d45b9a6348de" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IS RAILS IS A BAD IDEA?]]></title>
            <link>https://murphydhee.medium.com/is-rails-is-a-bad-idea-97cd12298b9d?source=rss-a414383876a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/97cd12298b9d</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[2022]]></category>
            <category><![CDATA[rails]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Murphy Ekwere]]></dc:creator>
            <pubDate>Fri, 24 Dec 2021 05:59:56 GMT</pubDate>
            <atom:updated>2021-12-24T05:59:56.451Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*PBcUb2h4tdaiKpde00c2NQ.png" /></figure><p>I’ll start this article with a disclaimer:</p><blockquote>“ I don’t hate Rails as a framework. I just have certain opinions about it“</blockquote><p>I am a fan of the ruby on rails framework and I started courses on the framework earlier last year. The framework itself is So beginner-friendly, and one of the things that stood out to me was the fact that it is easily maintainable for small projects but tackling much larger projects might have you in a bind. It also tends to open itself up for collaboration.</p><p>So if you are considering to hope on the rail wagon, here are some things that should give you that extra nudge:</p><ul><li>The community is strong</li><li>It’s a beginner-friendly framework</li><li>It has support for pragmatism</li><li>It’s got the best standards and practices</li><li>It enables fast development</li><li>It’s very easy to migrate and modify</li></ul><p>Ruby on Rails, which is an open-source web application framework for the server-side operates on Don’t Repeat Yourself(DRY), which provides a standard setup convention.</p><p>However Ruby on Rails is annoying! it feels like working with a teenager with attitude issues. It has its way of just getting underneath my skin sometimes — Brrr! I guess that&#39;s the price you have to pay for its architecture based Model-View-Controller (MVC) and fast development style which comes in handy when you’re under the pressure of a short deadline or a tight budget.</p><p>Okay, some tweets to further buttress my point:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*MYJKOa4pEvKkBmU0.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*804QdYDWpKkh-NtC.png" /></figure><h3>Speed &amp; Architectural Precession</h3><p>Huge projects with large-scale traffic tend to have slower speed and performance compared to other frameworks like Django, Go, or Node.js. And as usual, all the blame goes to the developer, but honestly, He/She isn&#39;t entirely to blame as Rails has a hand in it as well.</p><p>Rails is a powerful and nice tool, but when misused by inexperienced developers, performance can take a very bad hit. Now don&#39;t get me wrong I know I said earlier that it is beginner friendly but at the same time only for small projects, using Rails to tackle large projects without the experience will have you turning in circles. Having a bad architecture drops the performance together with its hunger for memory this hinders the garbage collectors to do their work causing the whole project to become very slow. Unlike languages like Go and C++, which are compiled, Ruby and Rails require more time to execute code.</p><p>So, issues regarding performance still boil down to server or database architecture, rather than Rails itself.</p><p>One good side is that you can make your application faster with code optimization, caching, and scaling. To achieve the same performance with Rails as you do with other frameworks like Django, you might need to spend more money and time on better server infrastructure. Obviously, that can be a pain.</p><p>Optimization can be a forgotten aspect of Rails development with the lucidity of quickly throwing in some gems, queries, Active Records, and deploying your project. You’ll most likely find your article struggling in the performance area. Although this article isn’t a <em>‘How to optimize your Rails project’</em>, articles from Cheyne Wallace give a guide on <a href="https://www.cheynewallace.com/ruby-on-rails-performance-tuning/">this</a>.</p><h3>Railway or the Highway</h3><p>For Rails most of its dependencies and modules — if not all — come out of the box and disregard customization. Developers tend to configure modules, most especially database migrations and routing, which can be exhausting to model especially when your project requires a different setup.</p><p>Is this really frustrating for all developers? you might ask and I don&#39;t speak for everyone but I can confidently say that quite a number of developers have some complaints about this as seen in the tweets above.</p><p>The point is, Rails has it all! Rails is crazy about gems(a library used in your application). While this is good for developers that just want to jump into a project and get things done quickly, it is annoying for some when you have to use things that don’t feel right for your project. One could add that it’s either its way or you spend time and money paving your own way to customization or if you want to build something extended or unconventional.</p><h3>Poof! Ta-Da!</h3><p>A lot of things happen behind the scenes and you often don’t know how or why. It feels good not having to micro-manage everything but can also make you prone to unnecessary mistakes. More specifically, the Ruby on Rails code looks simple but yet so complex. Having the ability to take or perform a lot of actions and connect to gems (libraries).</p><p>Personally, I believe that Rails takes on more than it can handle at the being of development, some of these things which don&#39;t get used by the developer and as such become redundant weighing down on the CPU and slowing things down. The complex capabilities of Rails may seem awesome, but a lot of what happens in a line of code might be unknown. A faction of developers are okay without knowing and focus on getting results as they say <em>“Ignorance is bliss”</em> however another faction tends to lose their composure leaving certain things without their control — I belong to this faction but don&#39;t take my word for it have your own experience and make a choice for yourself. for me, it has to do with most of these underlining processes slowing things down with the number of actions performed in a single line of code in Rails making it hard to maintain.</p><h3>Fewer web hosts</h3><p>Ruby on Rails is more resource-demanding than some other popular frameworks. It requires more CPU usage, which some web hosts might not give. Hosts that are Virtual Private Servers are much more convenient because they do not support the physical server in the sense that resources like RAM and CPU are not a consideration.</p><p>The point is that not all web hosts can keep up with most Rails projects.</p><h3>Handling the Rails Framework</h3><p>I know that the above paragraphs might have you tilting away from Rails however performance and speed are not based on the framework alone and so here are ways to handle the framework that will still give you your desired results.</p><p>The solution to your issue with performance is quite obvious Caching. The few pages and content blocks that are most likely to be opened by the user should be cached. This alone improves your performance significantly.</p><p>In addition to that, making assets like that of the important resources (including images, fonts, etc.) for your pages external be it big, small, or heavy. Whatever the size also significantly boosts performance as offloading away from your server gives it less work to do.</p><p>Another way you can improve your performance is by using Unicorn for Heroku. Unicorn is a multi-threaded server (or web worker) for Rails in particular. This handles connections by tripling its amount. A web worker handles one connection, 5 workers handle 5 concurrent connections, and so on.</p><p>You can also use eager loading to boost query performance and utilize indexing to boost database performance.</p><p>Finally, remember: Don’t repeat yourself (DRY). This is really common advice, but a lot of developers neglect to follow it. Please don&#39;t be like those developers.</p><p>These are the most common solutions most developers tend to use when using Ruby, and they can make a real difference when it comes to your performance and make your experience with the framework a lot better.</p><h3>Conclusion</h3><p>Finally, I’ll like to point out the fact that Rails supports the idea of convention over configuration. It’s time-saving, and enables you to write more business logic code and lay less groundwork that has no connection to the business code.</p><p>While it has its advantages, Rails is wrong on a few things. Rails is definitely not flexible — in fact, it is a one-way street bottled into a one-way mechanism. and as such it doesn&#39;t make scaling up for large projects easy.</p><p>Did the creators of Rails take convention over configuration a little too literal or did we the developers water down their intent when it was first introduced. As a result, they reduce the flexibility of users’ patterns in favour of patterns in-built in the framework. This has made trending concepts complicated to implement without sacrificing other choices.</p><p>Upcoming releases seem pretty promising, however, most of the downsides are being fixed, and more features are being added. Rails should be on track to improve in the future.</p><p>Rails is the ideal choice if you have deadlines and budget requirements that require fast development. But a more flexible framework like Django is probably a better option just because it allows you full control. Heavy real-time applications, which always require faster performance and scalability, will require consideration if you’re planning to use Rails.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97cd12298b9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enjoy the moment.]]></title>
            <link>https://murphydhee.medium.com/enjoy-the-moment-e98772603263?source=rss-a414383876a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e98772603263</guid>
            <category><![CDATA[poetry]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[creative-writing]]></category>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[advice]]></category>
            <dc:creator><![CDATA[Murphy Ekwere]]></dc:creator>
            <pubDate>Sat, 06 Aug 2016 21:46:34 GMT</pubDate>
            <atom:updated>2016-08-06T21:46:34.505Z</atom:updated>
            <content:encoded><![CDATA[<p>We have to realize that our lives could be gone in a moment. There are no guarantees that we will be here at this time next year. Learn to live each day to the fullest. Don’t complain. Don’t focus on what’s wrong. Be grateful for the opportunity to experience each day. so here’s my advice to you.</p><p>STOP…</p><p>stop waiting for Fridays;</p><p>for summer;</p><p>for someone to fall in love with you;</p><p>for life.</p><p>Happiness is when you stop waiting for it and make the most of the moment you are in now.</p><p>ℳ u r p h y….</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e98772603263" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>