<?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 Madalitso Nyemba on Medium]]></title>
        <description><![CDATA[Stories by Madalitso Nyemba on Medium]]></description>
        <link>https://medium.com/@madalitsonyemba?source=rss-c72f29620c13------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lxXxaoR8dvTQW9KwSeU-GA.jpeg</url>
            <title>Stories by Madalitso Nyemba on Medium</title>
            <link>https://medium.com/@madalitsonyemba?source=rss-c72f29620c13------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 01:59:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@madalitsonyemba/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[I built a video editor that renders sharp 1080p MP4s entirely in the browser]]></title>
            <link>https://madalitsonyemba.medium.com/i-built-a-video-editor-that-renders-sharp-1080p-mp4s-entirely-in-the-browser-a321a95ea22a?source=rss-c72f29620c13------2</link>
            <guid isPermaLink="false">https://medium.com/p/a321a95ea22a</guid>
            <category><![CDATA[website]]></category>
            <category><![CDATA[showdev]]></category>
            <category><![CDATA[webdev]]></category>
            <category><![CDATA[marketing]]></category>
            <dc:creator><![CDATA[Madalitso Nyemba]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 09:50:14 GMT</pubDate>
            <atom:updated>2026-10-06T09:50:14.019Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eKFNNiUh5pgwxEZXlpNv-g.png" /></figure><p>I build websites for clients. A few weeks ago I finished one I was really proud of and wanted to show it off on TikTok.</p><p>The options were not great. A raw screen recording looked flat. Mockup tools were built for static images. Video editors meant an hour of keyframes for a 20 second clip.</p><p>So I did what developers do. I opened an empty HTML file.</p><h3>The first version: one file, one effect</h3><p>The idea was simple. Play the desktop recording inside a laptop, morph the laptop into a phone, switch to the mobile recording, and end on a call to action.</p><p>The first version used DOM elements and CSS-style animation. A laptop frame was just a div with a dark border, the screen was a &lt;video&gt; element, and the morph animated width, height and border-radius from laptop proportions to phone proportions while crossfading the two videos.</p><p>It looked good. Then I exported it.</p><h3>Problem 1: the video was blurry</h3><p>To get a video out of a web page, my first approach was screen capture: getDisplayMedia, crop to the frame with Region Capture, and record with MediaRecorder.</p><p>The result was soft and smeary. The reason is obvious in hindsight: <strong>you can only capture what is on the screen.</strong> A 1080 x 1920 vertical frame on a normal laptop screen is displayed at roughly 600 x 1080 pixels. The recording is scaled back up for phones, and everything goes soft. Tab capture also compresses on the fly.</p><p>No amount of tweaking bitrate fixes missing pixels.</p><h3>The fix: stop recording the screen</h3><p>Instead of recording what the browser displays, I render every frame myself onto a full-size canvas and encode it directly.</p><p>That meant moving the whole animation from DOM to a &lt;canvas&gt; of exactly 1080 x 1920, and writing it as a pure function of time:</p><pre>function draw(t, settings) {<br>  drawBackground(t);<br>  drawHook(t, settings);<br>  drawDevice(t, settings);<br>  drawCaptions(t, settings);<br>  drawCallToAction(t, settings);<br>}</pre><p>This one decision unlocked everything else. If draw(t) always produces the same frame for the same t, then preview and export are guaranteed to match. The preview runs it in requestAnimationFrame. The export runs it frame by frame, as fast or slow as the encoder needs.</p><h3>Easing without a library</h3><p>Since every value is calculated from t, I needed easing functions I could call directly. A small cubic-bezier solver does the job:</p><pre>const cubicBezier = (x1, y1, x2, y2) =&gt; (t) =&gt; {<br>  if (t &lt;= 0) return 0;<br>  if (t &gt;= 1) return 1;<br>  let lo = 0, hi = 1, u = t;<br>  for (let i = 0; i &lt; 24; i++) {<br>    u = (lo + hi) / 2;<br>    const x = 3 * (1 - u) ** 2 * u * x1 + 3 * (1 - u) * u ** 2 * x2 + u ** 3;<br>    if (x &lt; t) lo = u; else hi = u;<br>  }<br>  return 3 * (1 - u) ** 2 * u * y1 + 3 * (1 - u) * u ** 2 * y2 + u ** 3;<br>};</pre><pre>const EASE = cubicBezier(0.65, 0, 0.35, 1);<br>const progress = (t, start, duration, ease) =&gt;<br>  ease(Math.min(Math.max((t - start) / duration, 0), 1));</pre><p>Bisection instead of Newton’s method is a little slower but never misbehaves, and at 24 iterations it is more precise than any screen can show.</p><h3>Encoding with WebCodecs</h3><p>Chrome and Edge ship VideoEncoder, which encodes H.264 in the browser, often with hardware acceleration. Each frame becomes a VideoFrame straight from the canvas:</p><pre>const encoder = new VideoEncoder({<br>  output: (chunk, meta) =&gt; muxer.addVideoChunk(chunk, meta),<br>  error: (e) =&gt; console.error(e),<br>});</pre><pre>encoder.configure({<br>  codec: &quot;avc1.640028&quot;, // H.264 High profile, level 4.0<br>  width: 1080,<br>  height: 1920,<br>  bitrate: 14_000_000,<br>  framerate: 30,<br>});</pre><pre>for (let i = 0; i &lt; totalFrames; i++) {<br>  const t = i / fps;<br>  await seekVideosTo(t);<br>  draw(t, settings);</pre><pre>  const frame = new VideoFrame(canvas, {<br>    timestamp: Math.round((i * 1e6) / fps),<br>    duration: Math.round(1e6 / fps),<br>  });<br>  encoder.encode(frame, { keyFrame: i % (fps * 2) === 0 });<br>  frame.close();</pre><pre>  // back-pressure: don&#39;t flood the encoder<br>  while (encoder.encodeQueueSize &gt; 8) {<br>    await new Promise((r) =&gt; setTimeout(r, 5));<br>  }<br>}</pre><pre>await encoder.flush();</pre><p>A few lessons from this part:</p><ul><li><strong>Check codec support first.</strong> VideoEncoder.isConfigSupported() tells you whether a codec string works on the user&#39;s machine. 60 fps at 1080 x 1920 needs a higher AVC level (avc1.64002A) than 30 fps does.</li><li><strong>Always close frames.</strong> Forget frame.close() and memory climbs fast.</li><li><strong>Respect back-pressure.</strong> Without the encodeQueueSize check, a fast canvas can queue hundreds of frames.</li></ul><p>VideoEncoder only gives you encoded chunks, so you still need a muxer to wrap them in an MP4 file. I used mp4-muxer, which is tiny and did exactly what I needed. If you are starting today, its author now maintains a successor called Mediabunny that is worth a look.</p><h3>Problem 2: the recordings inside the video</h3><p>The reel contains the user’s own screen recordings. For a frame-perfect export, each recording has to show exactly the right frame at time t, so I seek before drawing:</p><pre>function seek(video, time) {<br>  return new Promise((resolve) =&gt; {<br>    const target = Math.min(time % video.duration, video.duration - 0.02);<br>    if (Math.abs(video.currentTime - target) &lt; 0.0005) return resolve();<br>    video.addEventListener(&quot;seeked&quot;, resolve, { once: true });<br>    video.currentTime = target;<br>  });<br>}</pre><p>Seeking every frame is slower than playing, but it is deterministic, and that matters more than speed for an export.</p><p>Two gotchas cost me time:</p><ol><li><strong>Cross-origin video taints the canvas.</strong> Once a tainted canvas is drawn, you cannot create a VideoFrame from it. All media is served from the same origin as the app.</li><li><strong>Seeking needs HTTP Range support.</strong> Without Range requests, the browser has to download the whole file to seek. The media route streams partial content with a proper 206 response.</li></ol><h3>Problem 3: the videos were cut off</h3><p>Desktop recordings are wide (mine was 1908 x 868) and phone recordings are tall. The first version used fixed device sizes, so recordings were cropped.</p><p>The fix: the device screen takes the aspect ratio of the recording itself, clamped to a sensible size, and the video is drawn with “contain” logic. Even the morph animates from the laptop’s real proportions to the phone’s real proportions.</p><h3>From one file to a product</h3><p>People who saw the reel asked how I made it, so the experiment became a product: <strong>ByteMorph</strong>.</p><p>The core rule I kept from the prototype is that <strong>a reel is data</strong>. Every reel is a JSON spec: a list of scenes with their text, recordings, timing, transitions and styles. The renderer just draws whatever the spec describes.</p><p>That one decision made almost every later feature simple:</p><ul><li><strong>Templates</strong> are saved specs.</li><li><strong>Dragging</strong> elements on the canvas edits positions in the spec.</li><li><strong>Four formats</strong> (9:16, 1:1, 4:5, 16:9) come from a layout module that computes everything relative to the canvas size.</li><li><strong>The upcoming AI assistant</strong> will edit the same spec, so it cannot break anything the renderer does not understand. The server validates every spec anyway.</li></ul><h3>Adding 3D</h3><p>The 2D canvas cannot do a convincing laptop that spins while its lid opens, so 3D scenes use Three.js. It renders into its own WebGL canvas, and each frame is copied onto the main canvas between the 2D background and the 2D overlays. The export pipeline did not change at all.</p><p>The same rule applies: every 3D value comes from t, never from a Three.js clock. Animations are stored as presets (like &quot;lid open, 1.2 seconds, ease out&quot;) that expand into keyframes, so the preset and a user&#39;s customised version always run through the same code. And Three.js only loads when a reel actually uses 3D.</p><h3>Feature callouts and zoom</h3><p>For showing off web apps and dashboards, two features turned out to matter most:</p><ul><li><strong>Callouts:</strong> feature lists, pins and counters as a layer on any scene. Pins store their target in the recording’s own coordinates, so they stay locked to the right spot even while the device moves, morphs or zooms.</li><li><strong>Zoom to region:</strong> the camera glides into part of the recording so a dashboard is readable on a phone. The zoomed frame is drawn from the full-resolution video, not an upscaled copy.</li></ul><h3>The rest of the stack</h3><ul><li><strong>Laravel</strong> with <strong>Inertia</strong> for the app, <strong>Filament</strong> for the admin panel and template management</li><li>A <strong>VitePress</strong> docs site with screenshots and clips regenerated by a Playwright script</li></ul><h3>Try it</h3><p>ByteMorph is live today at <a href="https://bytemorph.app/?ref=devto"><strong>bytemorph.app</strong></a>. It is free to start, and every new account gets 7 days of Pro. We are also launching on Product Hunt today: <a href="https://www.producthunt.com/products/bytemorph?launch=bytemorph">here</a>.</p><p>I would love feedback from other developers, especially on the rendering side. If you have worked with WebCodecs, I am curious what you have run into.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a321a95ea22a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Agentforce + External APIs: The Security Layer Nobody Warns You About]]></title>
            <link>https://madalitsonyemba.medium.com/agentforce-external-apis-the-security-layer-nobody-warns-you-about-c7415adcba45?source=rss-c72f29620c13------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7415adcba45</guid>
            <category><![CDATA[webdev]]></category>
            <category><![CDATA[applink]]></category>
            <category><![CDATA[agentforce]]></category>
            <category><![CDATA[salesforce]]></category>
            <dc:creator><![CDATA[Madalitso Nyemba]]></dc:creator>
            <pubDate>Thu, 09 Apr 2026 19:16:17 GMT</pubDate>
            <atom:updated>2026-04-09T19:16:17.349Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M4Dn9rIF25uIPo23cNSXFg.png" /></figure><p>The Salesforce ecosystem has been buzzing about Agentforce for a while now. But there is a difference between knowing it exists and actually building with it. Having recently worked on an implementation that pushed Agentforce beyond out-of-the-box capabilities, I want to share something practical.</p><p>## The Real Work Starts When External Data Is Involved</p><p>In a recent Health Cloud implementation, we needed Agentforce to respond with data that lived outside Salesforce entirely. The requirement was straightforward on paper: expose an external API endpoint, let Agentforce hit it, get the data back, and respond to the user with it in context.<br>Simple enough until you think about security.</p><p>## AppLink</p><p>Opening an API endpoint that an AI agent can call freely is a risk most clients will not accept, and rightfully so. Anyone with the URL could potentially hit it. So we used AppLink with its service mesh to lock it down which meant the endpoint would only respond to requests originating from that specific Salesforce org. Hit it from anywhere else, you get nothing.</p><p>This is the kind of architectural decision that separates a rushed implementation from one that can actually go to production. The agent calls the external action, AppLink handles the tokens and origin verification, and the data flows back cleanly into the agent’s response.<br>It worked. The agent responded with live external data, scoped correctly, secured properly.</p><p>## Why This Matters in 2026</p><p>Agentforce without external data is a fancy bot within the Salesforce ecosystem. The real value, and what clients are starting to ask for, is agents that can reach into external systems, pull real information, and act on it. That means developers who understand both the Salesforce side and the integration and security layer are going to be in demand in a way that pure Salesforce admins simply won’t be. This is also necessary because the heights at which Agentforce can act will be limitless since the data is not just confined to the one we have in Salesforce but we can easily connect with other systems via REST APIs with minimal effort yet making it very secure</p><p>## If You are a Consulting Partner</p><p>I am a Senior Salesforce Developer and Solutions Architect, certified in Health Cloud, and JS Developer I, and also have experience with Experience Cloud and Marketing Cloud, currently working with international clients and open to remote subcontract engagements with consulting firms globally.</p><p>If your team is getting pulled into Salesforce work and you need certified remote capacity, let us connect on [LinkedIn](<a href="https://www.linkedin.com/in/madalitso-nyemba-0a9516142/">https://www.linkedin.com/in/madalitso-nyemba-0a9516142/</a>).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7415adcba45" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Transformation Mindset]]></title>
            <link>https://madalitsonyemba.medium.com/the-transformation-mindset-62ac4bcfef95?source=rss-c72f29620c13------2</link>
            <guid isPermaLink="false">https://medium.com/p/62ac4bcfef95</guid>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[excellence]]></category>
            <category><![CDATA[transformation]]></category>
            <dc:creator><![CDATA[Madalitso Nyemba]]></dc:creator>
            <pubDate>Tue, 07 Oct 2025 20:22:33 GMT</pubDate>
            <atom:updated>2025-10-07T20:22:33.263Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t4wRU6KpEylV7mvmtc2VRw.png" /></figure><p>I used to hate Mathematics.</p><p>My mother was a Mathematics teacher. My father was an Accountant. Yet there I was, avoiding the subject at every turn, convinced I just was not good at it.</p><p>That version of me would never have believed what came next: scoring perfect marks on both math papers, getting featured in a national newspaper, and eventually graduating with a distinction in Business Information Technology.</p><p><strong>The Turning Point</strong></p><p>The change did not happen because I suddenly became smarter. It happened because I made one critical decision: <strong>stop avoiding what I was bad at and face it head-on.</strong></p><p>But here is what most people do not tell you about transformation, it is not about working harder on everything. It is about working strategically on the right things.</p><p>I am currently reading a book called The Unfair Advantage which emphasizes on capitalizing on your unfair advantages. In this case, capitalizing on what you are good at.</p><p><strong>The Strategy That Changed Everything</strong></p><p>When I realized I was failing at Social Studies and Chichewa in Form 2, I could have made excuses or hoped for the best. Instead, I created what I call the <strong>5X Rule</strong>: spend five times more energy on your weakest subjects than your strongest ones.</p><p>Sounds extreme? It was. But failing wasn’t an option I was willing to accept.</p><p>But before this rule was officially given a title by me, I also discovered something counterintuitive in my primary years as I struggled with maths: <strong>daily practice beats cramming every time.</strong> I committed to solving at least one math problem every single day without exceptions. Not for hours, sometimes just 15 minutes. But every. Single. Day.</p><p>The compound effect was undeniable.</p><p><strong>Beyond Study Techniques</strong></p><p>Here’s what surprised me most: academic excellence is not just about study techniques. It is about:</p><ul><li><strong>Competing with yourself, not others</strong> (your only benchmark should be your previous performance)</li><li><strong>Your environment matters more than you think</strong> (my grades suffered when I was surrounded by distractions)</li><li><strong>Teaching deepens your own learning</strong> (sharing knowledge exposed gaps in my understanding)</li><li><strong>Finding obsession in the right places</strong> (let genuine interest drive your effort)</li></ul><p><strong>The Formula That Works</strong></p><p>During university, while balancing a software development internship with full-time studies, I discovered a powerful equation:</p><p><strong>Work Accomplished = Time Spent × Intensity of Focus</strong></p><p>Two hours of deep, distraction-free work beats six hours of divided attention. Every. Single. Time.</p><p><strong>Your Transformation Starts Now</strong></p><p>My journey from an average student who struggled with basic math to a university graduate with distinction was not about talent. It was about developing what I call the <strong>Transformation Mindset</strong> which is a complete shift in how you approach learning, challenges, and growth.</p><p>The principles are simple:</p><ul><li>Be brutally honest about your weaknesses</li><li>Face what you are avoiding</li><li>Build daily habits that compound</li><li>Create environments that support your goals</li><li>Share knowledge to deepen understanding</li></ul><p>Most importantly: <strong>compete only with yourself.</strong> The goal isn’t to be better than everyone else. It is to be better than you were yesterday.</p><p><strong>Ready to Transform Your Journey?</strong></p><p>If you are tired of being just “okay” at school, work, in your business or just life in general then my story is proof that transformation is possible.</p><p>I have written <strong>“Learning to Excel: A Personal Story of Growth and Mastery”</strong> to share the exact strategies, mindset shifts, and practical techniques that took me from struggling student to academic excellence. The lessons can be applied to various sectors of your life that you feel lacking.</p><p>This is not theory. These are battle-tested methods that worked for me and countless students I have mentored.</p><p><a href="https://learning-to-excel.madanyemba.dev/">Get Your Copy Now</a></p><p>Your transformation does not require overnight miracles. It requires consistent, deliberate improvement over time.</p><p>What will your first step be?</p><p>Get your eBook copy on the below links:</p><p>Debit/Credit card purchases (powered by <a href="https://www.linkedin.com/feed/#">Gumroad</a>) — <a href="https://mnyemba.gumroad.com/l/roryst">https://mnyemba.gumroad.com/l/roryst</a></p><p>Airtel money/Mpamba (powered by <a href="https://www.linkedin.com/feed/#">PayChangu</a>) — <a href="https://learning-to-excel.madanyemba.dev/">https://learning-to-excel.madanyemba.dev</a></p><p><em>Madalitso Nyemba is a Senior Solutions Architect, former Assistant Lecturer, and award-winning tech innovator. His academic journey from struggling with math to scoring perfect marks and graduating with distinction exemplifies the transformation principles he teaches.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=62ac4bcfef95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2024 First Quarter Reads]]></title>
            <link>https://madalitsonyemba.medium.com/2024-first-quarter-reads-33f626e462c4?source=rss-c72f29620c13------2</link>
            <guid isPermaLink="false">https://medium.com/p/33f626e462c4</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[reading-books]]></category>
            <dc:creator><![CDATA[Madalitso Nyemba]]></dc:creator>
            <pubDate>Sun, 14 Apr 2024 01:48:01 GMT</pubDate>
            <atom:updated>2024-04-14T01:48:01.374Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong><em>The three books that have changed my perspective on life, for the better</em></strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JAH6DIhW9XUAIzAcZELzhQ.jpeg" /></figure><p>At the beginning of the year, I jotted down several things I wanted to achieve by the end of the year. One of the things was to read one book a month. I know it is not as many as I can handle but I am also trying to build a reading habit. I looked at my life and what I wanted to achieve. This reflection helped me pick out the 12 books that were ordered in a way that made sense to me. I want to share the 3 I have read from January through March and my brief learnings.</p><p>The book for January is a book by Stephen Covey titled <a href="https://www.amazon.com/Habits-Highly-Effective-People-Powerful/dp/0743269519">The 7 Habits of Highly Effective People</a>. The 7 habits listed are being proactive, beginning with the end in mind, putting first things first, thinking win-win, seeking to understand before being understood, synergising, and sharpening the saw. The key takeaway for me was habit number 2 which is to begin with the end in mind. I believe in purpose and that everyone has it. This point emphasises that we need to have a clear mission statement. You do not need to have it all figured out but just have a vision of the outcome. You take it from there. This also helps one in decision-making because you can easily know if a decision will derail you or push you towards the goal. This book is structured in a way that helps one chronologically from being independent to living interdependent with others. It is a great recommendation if you want to be effective in life as the title suggests.</p><p>The book for February is a book by Nicolas Cole titled <a href="https://amzn.to/43THLSm">The Art and Business of Online Writing: How to Beat the Game of Capturing and Keeping Attention</a>. This was an easy choice for me because online writing is a topic I fancy and want to get to know in depth. Arguably this is the best book I have read for several reasons. Firstly, even though it is about writing, you learn a lot of principles that are essential like consistency is key, how research is fundamental to excel in your field and most importantly the only way you can ever get good at something is by doing it, period. Secondly, it outlines a lot of examples that an aspiring writer can use and grow an online audience and become a successful writer. Third and most interesting for me, it is a fast-paced book. At the end of every reading session, I felt like I had been running a marathon. This is not a bad thing and I wish more book writers embraced this. This book will help one in communicating efficiently and effectively. I highly recommend it even though you are not an aspiring writer as most concepts can be applied in various fields. Oh, and you will write concise and effective emails or application letters that grab the reader and let them know exactly what you want to let them know.</p><p>The book for March is a book by Matthew Dicks called <a href="https://amzn.to/43T8Uot">Someday Is Today: 22 Simple, Actionable Ways to Propel Your Creative Life</a>. I have a lot to say about this book that I could write a whole book about it. This is an awesome read and I recommend it should be the next book you read. Mathew Dicks outlines several strategies that help him be productive like taking 100-second showers, timing emptying the dishwasher, taking 23 minutes to do shopping, eating oatmeal for lunch every day for years, and the list goes on. However, the strategy that got to me was <em>the one-hundred-year-old version of yourself. </em>It is like a check you can use to make a decision. When found to make a decision, you ask if the 100-year-old version of you would look back and be glad that you made that decision. Would that version be glad that you spent a whole Saturday bingeing Netflix? A couple of weeks before reading this book, I uninstalled all social media applications and just left WhatsApp for communication. This boosted my productivity a lot. This book mentioned how you do not need the right environment to get things done but you can rather make the environment right (I paraphrase). This made me use the tiny gaps between activities even better. Those gaps like waiting for your girl as she gets ready or waiting for your turn at the hospital. I used to just whip out my phone and go through my X feed or TikTok but now I read a few lines of the book I’m currently reading and this has helped me. My sister once asked me where I get the time to read as I seem to be always coding and I answered exactly that by saying I utilise the small gaps. 10 minutes in and of itself seems small but compound that over a week, a month, a year then you will see you will be further ahead towards your goals than if you misused the 10 minutes. I can go on and on sharing about this book. Please read this book.</p><p>The first quarter has been amazing and I am already in my first book for the second quarter. The sentence for the first quarter is: Ask the 100-year-old version of yourself what purpose/accomplishment would be worthwhile and keep cranking at it on a daily basis with a clear vision of the ideal and not the current knowing we get better by always doing.</p><p><em>Disclaimer: The links to the books are my Amazon affiliate links.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33f626e462c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating Change: Reflections on the First 10 Days in a New Coding Adventure]]></title>
            <link>https://madalitsonyemba.medium.com/navigating-change-reflections-on-the-first-10-days-in-a-new-coding-adventure-55e0f19347ef?source=rss-c72f29620c13------2</link>
            <guid isPermaLink="false">https://medium.com/p/55e0f19347ef</guid>
            <category><![CDATA[careers]]></category>
            <category><![CDATA[reflections]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Madalitso Nyemba]]></dc:creator>
            <pubDate>Sat, 18 Nov 2023 10:56:50 GMT</pubDate>
            <atom:updated>2023-11-20T16:01:13.887Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xkoUi-huYaG4fgPBTzznhw.jpeg" /></figure><p>I changed employment and moved into a full-time development role as a Principal Salesforce Developer in the middle of my 30-day JavaScript course. I refer to it as a full-time development post since, at my prior position, I was responsible for both internal system development and end-user support. This transfer compelled me to relocate to a different city within my Country. I had to take care of a lot of moving pieces after such a significant change in my life, so I had to put the 30-day coding challenge on hold. Which brings me to this article, where instead of sharing my first 20 days in the challenge, I shall share my first 10 days in the new role and lessons learnt during this transition.</p><h3>Always Lay Your Bed: A Foundation for Smooth Transitions 🛏️</h3><p>As much as other people are of the view that you ought to create dependency syndrome with the company you work for, in some instances, it is better to finish tasks, document and teach others a thing or two about your work. Allow me to illustrate this with examples. In my previous role, I played a pivotal role in developing in-house systems that became integral to daily operations. Then, this new opportunity came up, and I had just about a week and a half to switch jobs. It wasn’t a lot of time, so I spent most of those days writing down everything about the systems — how they work, the code, and the processes. I wanted to make it easier for the person taking over after me. If I had been more focused on finishing up tasks and sharing what I knew with others earlier, the change would have been smoother.</p><h3>Make Decisions based on your personal aspirations 🤔</h3><p>Life is a journey with lots of different paths, and each of us has our own dreams and directions. I took my last job because it was at a big, well-known place, and I thought having that on my resume would be good, even though it wasn’t exactly the kind of coding job I really wanted. However, the job really taught me a lot, made me meet a lot of great people and I am glad I went that route. Before that, I taught programming at the school where I studied. It wasn’t a complete coding job, but I liked it because I got to teach programming. Now, this new opportunity came up, and it’s a full-on coding role, exactly what I’ve been aiming for in my career. So, going for this coding role might seem like a step down in the company hierarchy, but I see it as a step forward towards what I genuinely want to do. It’s a journey, and I’m hoping this path I’m taking lines up with my goals, and I find satisfaction without any regrets.</p><h3>Read the manual 📖</h3><p>On my first day at my new job, they handed me a project that involved using a sort of preview version of a language, called a Release Candidate (RC). It’s like getting a sneak peek at the final version, but there might still be a few issues, like bugs. You won’t find a step-by-step YouTube video for this, though. Instead, all I had was a ton of documentation — pages and pages of it. I had to quickly figure out how to use the documentation to make things work with this language. It’s not as easy as following a tutorial, but I think if I had been better at it from the start, I wouldn’t have had to spend so many hours getting up to speed. This whole experience showed me that while tutorials are good for basics, they only cover what the tutor knows. On the other hand, documentation has everything you can do with a language. I don’t dislike tutorials, but the sweet spot is learning the basics from a tutorial and then diving into the documentation to really understand how to make the most out of the language. So, make it a habit to read the manual of every product, or you’ll likely end up not using it to its full potential.</p><h3>Know your worth 🤑</h3><p>When it comes to talking about how much you get paid, just be clear about what you think you deserve. Think about how any changes, like moving, might affect you. Don’t sell yourself short because you’re scared of being rejected, but also don’t ask for so much that you miss out on a good job. Tell the potential boss what you want in terms of pay and stick to it. I’m assuming you already have a job or some way of making money because you can negotiate better if you can say, “No thanks, I’ll stick with what I’ve got.” But it’s not just about the money. Sometimes, the workplace can be a really bad environment, or the job doesn’t match up with what you want to achieve. If you’re just starting out, it can be tough because you might have lots of skills but not get paid much. For those starting off, I say don’t just focus on the money. Think about what you can learn from the job. Money comes and goes, but knowledge sticks with you. Nobody can take away what you’ve learned, and that kind of knowledge pays off in the long run as long as you keep trying and learning.</p><h3>Pray 🙏</h3><p>I always say no one can convince another to believe fully unless that individual has a personal encounter that shall lead them to believe. I have gone through many paths and hurdles in my life as well as career. One thing that always suffices and gives me peace is prayer. Myles Munroe defined prayer as allowing God to intervene. Thus, it gives me peace knowing that it is all under control even if it might not seem so. The decision to leave a big institution and work for a remote company under a hybrid arrangement was scary. I did all the calculations and had a bunch of what-ifs but still did not find peace. After I prayed about it, I trusted that I would leave and I was at peace with it which was what mattered.</p><p>As I navigate this uncharted coding chapter, I’m thrilled to announce the launch of “<a href="https://madalitsonyemba.substack.com/">The Code Father’s Journal</a>” newsletter, with the first issue dropping tomorrow (19 November 2023). Join me on this coding adventure, subscribe, and let’s unravel the human side of technology together. Happy coding, fellow adventurers! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55e0f19347ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First 10 Days of 30 Days of Javascript]]></title>
            <link>https://madalitsonyemba.medium.com/first-10-days-of-30-days-of-javascript-36672109c531?source=rss-c72f29620c13------2</link>
            <guid isPermaLink="false">https://medium.com/p/36672109c531</guid>
            <category><![CDATA[challenge]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Madalitso Nyemba]]></dc:creator>
            <pubDate>Tue, 24 Oct 2023 12:18:42 GMT</pubDate>
            <atom:updated>2023-10-24T12:18:42.031Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGRwsnS2SR5d77TWzQXk1A.jpeg" /></figure><p>In 2015, my coding journey kicked off, and I plunged headfirst into the world of development, starting with C++. Two whole years were dedicated to mastering this language, setting the stage for my coding adventures. Then, in 2017, a new chapter unfolded as I ventured into the vibrant world of web development, and that’s when JavaScript made its debut in my life.</p><p>Throughout the years, I’ve had the pleasure of crafting various professional projects that have touched the lives of many. From systems development to creating mobile apps and tinkering with chrome extensions, I’ve tried my hand at it all. However, as time went on, a desire to dive deeper into the fundamental concepts of programming started to take root.</p><p>One fine day, while navigating the digital landscape of LeetCode, I stumbled upon a 30-day JavaScript challenge, seemingly tailored for beginners. Now, while I’d certainly graduated from the beginner stage, I decided to take on this challenge for a couple of good reasons.</p><p>Firstly, I was in need of some consistency in my coding journey. You see, I’ve had my struggles with staying consistent, and this challenge seemed like the perfect remedy.</p><p>Secondly, I wanted to expand my knowledge beyond the boundaries of popular frameworks like Vue, React, Angular, and React Native and get back to the basics of JavaScript.</p><p>Lastly, I was eager to shift from the habit of merely copying code from tutorials on how to do something, without truly grasping the intricacies of what was required of me.</p><p>My journey turned out to be quite an adventure, and every day started with a LeetCode challenge. Whether it was a quick five-second puzzle or a more challenging 30-minute quest, I tackled it with enthusiasm.</p><p>So, here’s a peek into the highlights, solutions, and insights gathered during the first ten days of this fun-filled JavaScript exploration.</p><p><strong>On Day 3</strong>, the question was as below in the comments and the solution I gave:</p><pre>//Write a function expect that helps developers test their code.It should take in any value val and return an object with the following two functions.<br>// toBe(val) accepts another value and returns true if the two values === each other. If they are not equal, it should throw an error &quot;Not Equal&quot;.<br>// notToBe(val) accepts another value and returns true if the two values !== each other. If they are equal, it should throw an error &quot;Equal&quot;<br>var expect = function(val) {<br> return{<br> toBe: (v) =&gt; { <br> if(val === v){<br> return true<br> }else{<br> throw new Error(&quot;Not Equal&quot;)<br> }<br> },<br> notToBe: (v) =&gt; { <br> if(val !== v){<br> return true<br> }else{<br> throw new Error(&quot;Equal&quot;)<br> }<br> }<br> } <br> };</pre><p>This was an interesting question where it had to return an object with two functions and show testing proficiency by throwing errors as well as gauge a devs understanding of Javascript’s equality operators (===) as they may behave unexpectedly if not used correctly.</p><p><strong>On Day 7</strong></p><pre>// Given an integer array nums, a reducer function fn, and an initial <br>//value init, return a reduced array.<br>// A reduced array is created by applying the following operation: <br>//val = fn(init, nums[0]), val = fn(val, nums[1]), val = fn(val, nums[2]), …<br>// until every element in the array has been processed. The final value of<br>// val is returned.<br>// If the length of the array is 0, it should return init.<br>// Please solve it without using the built-in Array.reduce method.<br>var reduce = function(nums, fn, init) {<br> let val<br> if(nums.length == 0){<br> return init;<br> }<br>for(let i = 0; i&lt;nums.length;i++){<br> if(i==0){<br> val = fn(init, nums[i])<br> }else{<br> val = fn(val, nums[i])<br> }<br> }<br>return val<br> <br>};</pre><p>This was interesting as it made me further understand how reducers work in Javascript as I studied them after submission of the task.</p><p><strong>On Day 10</strong></p><pre>// Given a function fn, return a new function that is identical to the original function except that it ensures fn is called at most once.<br>// The first time the returned function is called, it should return the same result as fn.<br>// Every subsequent time it is called, it should return undefined.<br>var once = function(fn) {<br> let another = fn<br> let i = 0<br> <br> return function(…args){<br> if(i==0){<br> i = 1<br> return another(…args)<br> }else{<br> return undefined<br> }<br> <br> }<br>};</pre><p>I found this interesting as can be useful in scenarios where you want to restrict certain functions to execute only once, like initialization routines or one-time setup operations.</p><p>In summary, this has been my first 10 days towards 30 days of Javascript challenge. This is the start of a series that shall be documented in chunks of 10 days. See you after 10 days. Happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36672109c531" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Impostor Syndrome — Programmers Perspective]]></title>
            <link>https://madalitsonyemba.medium.com/impostor-syndrome-programmers-perspective-38235a131eb1?source=rss-c72f29620c13------2</link>
            <guid isPermaLink="false">https://medium.com/p/38235a131eb1</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[impostor-syndrome]]></category>
            <category><![CDATA[writing]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[Madalitso Nyemba]]></dc:creator>
            <pubDate>Sat, 10 Dec 2022 08:58:28 GMT</pubDate>
            <atom:updated>2022-12-10T08:58:28.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5nf3aZvQzXLSS2fNhsD2JQ.jpeg" /></figure><h3>Impostor Syndrome — Programmers Perspective</h3><p>Impostor syndrome, also known as impostor phenomenon or fraud syndrome, is a psychological pattern in which an individual doubts their accomplishments and has a persistent fear of being exposed as a “fraud”. This syndrome is not unique to the field of programming, but it can be particularly prevalent among programmers due to the constantly evolving nature of the field and the high standards that are often placed on them.</p><p>Programming can be a challenging and demanding field, and it’s not uncommon for programmers to feel like they don’t measure up to their peers or to the expectations placed on them. This can lead to feelings of inadequacy, self-doubt, and even fear of being discovered as an impostor.</p><p>One of the key factors contributing to impostor syndrome among programmers is the sheer amount of knowledge and skill that is required to be successful in the field. With new technologies and programming languages constantly emerging, it can be easy for a programmer to feel like they are always playing catch-up and that they are not as knowledgeable as their peers.</p><p>Another factor is the high standards that are often placed on programmers. Many companies and clients have very specific requirements for the software and applications that they need, and it can be easy for a programmer to feel like they are not meeting these standards or that their work is not good enough.</p><p>The effects of impostor syndrome can be significant, and they can include a lack of confidence, decreased motivation, and even burnout. In extreme cases, it can lead to depression and other mental health issues. In my case, it led to severe depression which affected my work and developed into a cycle because I could not perform as I wanted.</p><p>Fortunately, there are steps that programmers can take to overcome impostor syndrome and build confidence in their abilities. One of the most important things is to recognize that impostor syndrome is a common experience and that it is not a reflection of a person’s abilities or worth. It can be helpful to talk to other programmers and share experiences, as this can help to normalize the feelings of self-doubt and remind individuals that they are not alone.</p><p>It can also be helpful to set realistic goals and expectations for oneself, and to celebrate small victories and accomplishments along the way. This can help to build confidence and remind individuals that they are making progress and improving their skills.</p><p>Another effective strategy is to seek out feedback and support from mentors, colleagues, and other experienced programmers. This can provide valuable perspective and help individuals to see their strengths and accomplishments from a different perspective.</p><p>Overall, impostor syndrome is a common experience among programmers, but it is important to recognize it and take steps to overcome it. By acknowledging and addressing these feelings, programmers can build confidence in their abilities and continue to grow and succeed in their field.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38235a131eb1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vehicle Duty Calculator (Chrome Extension)]]></title>
            <link>https://madalitsonyemba.medium.com/vehicle-duty-calculator-chrome-extension-fce142a9a8bb?source=rss-c72f29620c13------2</link>
            <guid isPermaLink="false">https://medium.com/p/fce142a9a8bb</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[malawi]]></category>
            <category><![CDATA[cars]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[duty]]></category>
            <dc:creator><![CDATA[Madalitso Nyemba]]></dc:creator>
            <pubDate>Mon, 11 Jul 2022 03:47:13 GMT</pubDate>
            <atom:updated>2022-07-11T03:47:13.357Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*K4sVWZASo6d7Qx5YOMkEmA.jpeg" /></figure><p>When importing a car in Malawi (or elsewhere), you cannot run away from duty. In this post, I will focus on the Malawian context. If one is buying a car from popular sites such as BeForward, one does not know how much duty one will be required to pay. The Malawi Revenue Authority (MRA) has done a great job of putting in place different tools to help individuals estimate the duty a particular vehicle might fetch. They have a USSD application running on *915# on TNM network. They also have a Duty Calculator on their <a href="https://www.mra.mw/">website</a>. On the same <a href="https://www.mra.mw/">website</a>, they have also provided the criteria for one to calculate duty of a vehicle given different parameters like engine size among others.</p><p>To add onto the efforts by MRA, I have developed a Vehicle Duty Calculator Chrome extension which literally <strong>takes one second</strong> to show an interested individual how much the car costs, the tax as well as the total (in Malawi Kwacha) they would have to have to fully acquire the vehicle. It must be noted that the figures used are simply estimates due to the exchange rates.</p><p>Here is the link to the <a href="https://chrome.google.com/webstore/detail/vehicle-duty-calculator/gdkbblpemdjfpnpmnijmjaodhodibakf/related?hl=en-US">Vehicle Duty Calculator</a> Chrome Extension.</p><p>Add it to Chrome and view below video to see it in action:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FtyWAlUcwcNE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DtyWAlUcwcNE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FtyWAlUcwcNE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/97da66b4c414d50938470b396cf64db4/href">https://medium.com/media/97da66b4c414d50938470b396cf64db4/href</a></iframe><p><strong>Note:</strong> This extension currently just works with US Dollars as the currency. It also works on 2 websites namely: <a href="https://www.beforward.jp/">BeForward</a> and <a href="https://autocj.co.jp/">AutoCom Japan</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fce142a9a8bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Continuous Deployment on Shared Hosting with GitHub Actions]]></title>
            <link>https://madalitsonyemba.medium.com/continuous-deployment-on-shared-hosting-with-github-actions-9e80b4842555?source=rss-c72f29620c13------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e80b4842555</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[vue]]></category>
            <category><![CDATA[shared-hosting]]></category>
            <dc:creator><![CDATA[Madalitso Nyemba]]></dc:creator>
            <pubDate>Sun, 02 May 2021 09:50:01 GMT</pubDate>
            <atom:updated>2021-05-02T09:50:01.282Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xck36c6IYK1H58FK_Utm1A.png" /><figcaption>Continuous Deployment</figcaption></figure><h3>Introduction</h3><p>In this fast-paced world, where everything seems to be happening quickly, it is paramount for early as well as frequent deployment of websites/apps to keep up with the competition. There are various ways of deploying your web apps to your server but will shall be looking at how GitHub actions can help us continuously deploy our web app with minimal effort.</p><h3>What is Continuous Deployment</h3><p>First of all, what is continuous deployment you ask? According to <a href="https://searchitoperations.techtarget.com/definition/continuous-deployment">Search IT operations</a>.</p><blockquote>Continuous deployment is a strategy for software releases wherein any code commit that passes the automated testing phase is automatically released into the production environment, making changes that are visible to the software’s users.</blockquote><p>We will not cover tests in this post (but in a later post). As you can see from the definition, simply commit and then all your changes are on the production server.</p><h3>What is Shared Hosting</h3><p>There are different hosting choices with the popular ones now being shared hosting and cloud hosting.</p><blockquote>A shared web hosting service is a web hosting service where many websites reside on one web server connected to the Internet.<br>This is the cheapest way to host your website since the different users split the cost of the web server but it also has drawbacks since the resources are split across a number of users as well.</blockquote><p>I have been using shared hosting for a long time and I got bored with transferring my files via FTP every time I made changes. I then resorted to using <a href="https://github.com/">GitHub</a> where I pushed my code to the repo then pulled it from my shared hosting. I still was not satisfied. I used <a href="https://github.com/git-ftp/git-ftp/blob/master/man/git-ftp.1.md">GitFtp</a> which was alright. Until I learned about CI/CD in my <a href="https://azubiafrica.org/">Azubi Africa</a> class</p><h3>GitHub Actions to the rescue</h3><p>After further research, came across GitHub actions. According to their <a href="https://docs.github.com/en/actions">site</a>:</p><blockquote>Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you’d like, including CI/CD, and combine actions in a completely customized workflow.</blockquote><h3>The Workflow</h3><p>Let us get to the juicy bit by doing some actual work.</p><h3>Setting up GitHub actions</h3><p>(This is assuming you already have a repository in your GitHub account that you want to link to your shared hosting. if not, click <a href="https://docs.github.com/en/github/getting-started-with-github/create-a-repo">here</a>).</p><ul><li>Open your repository on GitHub and head over to Actions tab.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2D0wjaW2mcn52gUEWPbUYw.png" /><figcaption>Press the Actions tab</figcaption></figure><ul><li>Click on the set up a workflow yourself → as shown below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQSEgTOE_9sSeZxVa7QfrQ.png" /><figcaption>Click set up a workflow yourself</figcaption></figure><ul><li>Delete all the contents of main.yml on the page as shown below:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fUj-8J1p9rOH73iMAK5Adg.png" /><figcaption>Delete all the content</figcaption></figure><ul><li>Replace the file with below contents (note this is for a project in Laravel with a Vue frontend)</li></ul><pre>name: Deploy Site on push<br>on:<br>  push:<br>    branches:<br>      - master<br>jobs:<br>  web-deploy:<br>    name: Deploy<br>    runs-on: ubuntu-latest<br>    steps:<br>    - name: Get the latest code<br>      uses: actions/checkout@v2.3.2<br>    - uses: actions/setup-node@master<br>    - name: Installing project dependencies<br>      run: npm install<br>    - name: Building the project<br>      run: npm run production<br>    - name: Copy .env<br>      run: php -r &quot;file_exists(&#39;.env&#39;) || copy(&#39;.env.example&#39;, &#39;.env&#39;);&quot;<br>    - name: Setup PHP<br>      uses: shivammathur/setup-php@v2<br>      with:<br>        php-version: &#39;8.0&#39;<br>    - name: Install Dependencies<br>      run: composer update --ignore-platform-reqs<br>    - name: Generate key<br>      run: php artisan key:generate<br>    - name: Directory Permissions<br>      run: chmod -R 777 storage bootstrap/cache<br>    - name: 📂 Sync files<br>      uses: SamKirkland/FTP-Deploy-Action@4.0.0<br>      with:<br>        server: ${{ secrets.LARAVEL_SITE_SERVER}}<br>        username: ${{ secrets.LARAVEL_SITE_USER}}<br>        password: ${{ secrets.LARAVEL_SITE_PASS}}</pre><p>Let me now explain block by block what is going on</p><pre>name: Deploy Site on push</pre><p>This is the name of the workflow. GitHub displays the names of your workflows on your repository’s actions page after you write it.</p><pre>on:<br>  push:<br>    branches:<br>      - master</pre><p>This is where the GitHub action system is told when to run the workflow. The above snippet triggers the workflow when one pushes to the master branch. For more on the On key, click <a href="https://docs.github.com/en/actions/learn-github-actions/introduction-to-github-actions#:~:text=GitHub%20Actions%20are%20event%2Ddriven,executes%20a%20software%20testing%20script.">here</a></p><pre>jobs:<br>  web-deploy:<br>    name: Deploy<br>    runs-on: ubuntu-latest</pre><p><em>jobs</em> — Groups together all the jobs that run in the workflow file.</p><p><em>web-deploy</em> — Defines the name of the web-deploy job stored within the jobs section.</p><p><em>runs-on: ubuntu-latest</em> — Configures the job to run on an Ubuntu Linux runner. This means that the job will execute on a fresh virtual machine hosted by GitHub.</p><pre>steps:<br>    - name: Get the latest code<br>      uses: actions/checkout@v2.3.2<br>    - uses: actions/setup-node@master<br>    - name: Installing project dependencies<br>      run: npm install<br>    - name: Building the project<br>      run: npm run production</pre><p><em>Remember that the steps are inside the job block.</em></p><p><em>steps</em> — Groups together all the steps that run in the web-deploy job. Each item nested under this section is a separate action or shell command.</p><p><em>name</em> — For identification of the separate action.</p><p><em>uses: actions/</em><a href="/service/mailto:checkout@v2.3.2"><em>checkout@v2.3.2</em></a> — The uses keyword tells the job to retrieve v2 of the community action named actions/<a href="/service/mailto:checkout@v2.3.2">checkout@v2.3.2</a>. This is an action that checks out your repository and downloads it to the runner, allowing you to run actions against your code (such as testing tools). You must use the checkout action any time your workflow will run against the repository’s code or you are using an action defined in the repository.</p><p><em>uses: actions/setup-node@master</em> — This action installs the node software package on the runner, giving you access to the npm command.</p><p><em>run: npm install</em> — The run keyword tells the job to execute a command on the runner. In this case, you are using npm to install the package node dependecies.</p><p><em>run: npm run production</em> — This builds the Vue frontend project.</p><pre>- name: Copy .env<br>      run: php -r &quot;file_exists(&#39;.env&#39;) || copy(&#39;.env.example&#39;, &#39;.env&#39;);&quot;<br>    - name: Setup PHP<br>      uses: shivammathur/setup-php@v2<br>      with:<br>        php-version: &#39;8.0&#39;<br>    - name: Install Dependencies<br>      run: composer update --ignore-platform-reqs<br>    - name: Generate key<br>      run: php artisan key:generate<br>    - name: Directory Permissions<br>      run: chmod -R 777 storage bootstrap/cache</pre><p><em>run: php -r “file_exists(‘.env’) || copy(‘.env.example’, ‘.env’);</em> — This creates a .env file if it does not already exist (this is important as this is automatically added to the .gitignore file).</p><pre>uses: shivammathur/setup-php@v2<br>      with:<br>        php-version: &#39;8.0&#39;</pre><p>This action installs php on the runner, giving you access to php version 8.0.</p><p><em>run: composer update — ignore-platform-reqs</em> — This is used to install and update the composer packages.</p><p><em>run: php artisan key:generate</em> — This generates a key for the Laravel project.</p><p><em>run: chmod -R 777 storage bootstrap/cache</em> — This changes permissions for the specified folder.</p><pre>- name: 📂 Sync files<br>      uses: SamKirkland/FTP-Deploy-Action@4.0.0<br>      with:<br>        server: ${{ secrets.LARAVEL_SITE_SERVER}}<br>        username: ${{ secrets.LARAVEL_SITE_USER}}<br>        password: ${{ secrets.LARAVEL_SITE_PASS}}</pre><p>This is where the files are now transferred to the shared hosting server. Get your FTP details from your <a href="https://docs.cpanel.net/cpanel/files/ftp-accounts/">shared hosting</a>. Then go to your repo&gt;settings&gt;secrets then add the three secrets namely: server, username and then password. This action is courtesy of <a href="https://github.com/SamKirkland/FTP-Deploy-Action">SamKirkland</a>.</p><p>For more information on GitHub actions, <a href="https://docs.github.com/en/actions/learn-github-actions/introduction-to-github-actions#:~:text=GitHub%20Actions%20are%20event%2Ddriven,executes%20a%20software%20testing%20script.">click here</a></p><p>Enjoy 😎</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e80b4842555" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>