<?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 Oussema Miled on Medium]]></title>
        <description><![CDATA[Stories by Oussema Miled on Medium]]></description>
        <link>https://medium.com/@oussemamiled?source=rss-37f07d6f8ac1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YMTNsatxriF41bP5EYudrw.jpeg</url>
            <title>Stories by Oussema Miled on Medium</title>
            <link>https://medium.com/@oussemamiled?source=rss-37f07d6f8ac1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 01:31:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@oussemamiled/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[Unlocking Your Memory Potential: A Journey from Doubt to Mastery]]></title>
            <link>https://oussemamiled.medium.com/unlocking-your-memory-potential-a-journey-from-doubt-to-mastery-0f450e640d82?source=rss-37f07d6f8ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f450e640d82</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[lessons-learned]]></category>
            <category><![CDATA[health]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Oussema Miled]]></dc:creator>
            <pubDate>Tue, 26 Dec 2023 10:06:48 GMT</pubDate>
            <atom:updated>2023-12-26T10:06:48.917Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zrw_-bfgh0isiHOv" /><figcaption>Picture source: <a href="https://www.redefineyouredge.com/7-strategies-to-stop-making-excuses-for-not-taking-action-on-your-big-goals/">redefineyouredge.com</a></figcaption></figure><p>Looking up my profile, you might find it odd that I am writing about memory and memorisation in this article since it’s not a programming topic but it is actually very related. We need that in order to function and learn everyday.</p><p>If you are like me, someone who says “My memory sucks” or “I won’t be able to memorise this”, we should stop feeding our minds negative thoughts and do the opposite instead, because IT GETS TRANSLATED TO REALITY. This is a scientific fact.</p><p>In addition to that, reading about memory and memorisation online and from the book “Unlimited Memory” by Kevin Horsley, I learned few tips that I thought I might share some with you and it’s up to you to explore the rest.</p><p>To learn anything, find a very good WHY, because this should be the motivation that keeps you on the track. Write down as many good reasons as you can and read that list whenever you feel you are giving up.</p><p>Then, STOP MAKING EXCUSES (I actually hang these words on the top of my desk), especially the “I don’t have time” excuse and as Benjamin Franklin said “He that is good for making excuses is seldom good for anything else”. Read that again.</p><p>After that, CONCENTRATE. We all have social media and many other more fun things we can do instead of learning and those are the distractions we have to eliminate. Train yourself to concentrate and to focus on one thing at a time. Don’t be fooled by the “multi-tasking” myth, it is actually proven to be counter-productive. Be home when you are home and keep your mind in peace.</p><p>Now, bring what you’re learning to life. SEE (sense, exaggerate, energise) the info. Use your body or your car as a map to memorise lists, names…<br>Create images from it (in your head or real), make it more fun, make it “stupid”.</p><p>We are what we can memorise, everything we do is because of a related information we have in mind.<br>“Memory… is the diary that we all carry about with us” — Oscar Wilde.</p><p>Looking forward to reading your comments about the topic and I would love to hear about your experiences.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f450e640d82" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Concepts of Single Page Application Frameworks (React/Angular/Vue.js…)]]></title>
            <link>https://oussemamiled.medium.com/basic-concepts-of-single-page-application-frameworks-react-angular-vue-js-5d72eabe1128?source=rss-37f07d6f8ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d72eabe1128</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <dc:creator><![CDATA[Oussema Miled]]></dc:creator>
            <pubDate>Sun, 02 Apr 2023 12:27:28 GMT</pubDate>
            <atom:updated>2023-04-02T12:27:28.063Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article we discuss the basic concepts that you should know to be able to start with any SPA framework to build more robust applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*VSLwFo1ErmioTpBRyto8lg.jpeg" /></figure><h3>Introduction</h3><p>In modern frontend web development, using only JS is becoming more and more rare since SPA (Single Page Application) frameworks has a lot to offer and make development nicer and faster, besides the very known feature that you don’t have to reload the entire page every time a new piece of content is displayed. SPAs are designed to provide a more seamless and interactive user experience by loading and updating content dynamically on a single web page.</p><p>While these frameworks can be very different in terms of structure, techniques and so on… They still share few fundamental concepts which we will be learning today. Let’s do it!</p><h3>First Things First</h3><p>I totally do not recommend to start with SPA frameworks (React and such) without being comfortable enough with JS first. After all, JS is the main building block of these frameworks.</p><p>Few topics to learn before switching are:</p><ul><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions">Functions</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions">Arrow Functions</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Objects</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array">Arrays and array methods</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment">Destructuring</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals">Template literals</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator">Ternary Operators</a></li><li><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules">ES Modules and Import / Export Syntax</a></li></ul><h3>Concept 1: Components</h3><p>A component is an element or a group of elements in a page. Typically, you should transform a part of your page into a component whenever you think that part can be reused, making it easier to maintain and update a web application over time. Components can also improve the overall user experience by providing consistent and predictable behaviour across different parts of a web application. Here’s an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Np3rZnJOCDy4nXg58XPX1A.png" /></figure><p>Using the old way, we would write the same code and copy it 4 times to be able to generate that content. But with components, we would write it only once and reuse it. In pseudo-code it would be something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*O0K90dX88OnikN_6onoWxQ.png" /></figure><p>Nice and clean, right? Here the main page would be called a <strong>parent</strong> component and an item is a <strong>child</strong> component.</p><p>“ But wait, If we do that then we will have the same image, title and description 4 times, that’s not good! ” You are right my friend that’s why we can move to talk about the second concept 😉</p><h3>Concept 2: Props</h3><p>Component props are a way to pass data from a parent component to a child component. Props (short for properties) can be thought of as a set of parameters or inputs that a component can receive in order to customize its behavior and appearance.</p><p>When a parent component renders a child component, it can pass data to the child component through props. These props can be any type of JavaScript data, such as strings, numbers, objects, or functions.</p><p>Let’s get back to our previous example and build on it. The result would be something like this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55a981b8e18d5910a09820f8f47bf549/href">https://medium.com/media/55a981b8e18d5910a09820f8f47bf549/href</a></iframe><p>We can go even further and create a loop that iterates in an array of object and have as a result:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/22704188be34d9a0b4ddc17688af01b2/href">https://medium.com/media/22704188be34d9a0b4ddc17688af01b2/href</a></iframe><p>Now this is more dynamic, isn’t it?</p><h3>Concept 3: State</h3><p>Component state is the current set of values or information that a particular component is currently holding.</p><p>Imagine you have a button that changes color when you click it on a web page. You can utilize component state to keep track of whether the button is currently <strong>on</strong> or <strong>off</strong>. The state of the button component is updated to reflect the new color when the button is clicked.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6c93b376fd3562036ae313f580f1645a/href">https://medium.com/media/6c93b376fd3562036ae313f580f1645a/href</a></iframe><p>Again, this is only a simple example. Imagine you have an inventory of products and you want to control whether a user sees that product listed or not based on its availability. That would be a bit more helpful.</p><h3>Conclusion</h3><p>In summary, components, props, and state are essential concepts in modern web development. Components are reusable building blocks that allow developers to create complex user interfaces. Props are used to pass data from one component to another, allowing for customization and flexibility. State represents the current values or data held by a component at any given time and can be updated to reflect changes in the user interface. By understanding these concepts and how they work together, developers can build powerful and dynamic web applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d72eabe1128" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Progressive Web Apps (PWAs)]]></title>
            <link>https://oussemamiled.medium.com/progressive-web-apps-wpas-ae6b9f515d11?source=rss-37f07d6f8ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae6b9f515d11</guid>
            <category><![CDATA[insights]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Oussema Miled]]></dc:creator>
            <pubDate>Fri, 05 Aug 2022 09:46:45 GMT</pubDate>
            <atom:updated>2022-08-05T09:58:21.070Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we’ll be talking about progressive web apps, its benefits and then finally finish with building a “Hello World” PWA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dsmJabe6tChPmvZ2tixsjQ.jpeg" /></figure><h3>What is a PWA?</h3><p>A PWA is a web app that offers better performance, more capabilities and reliability compared to a traditional web app. We can think of it as the result of combining the features of web and native apps.</p><p>Web applications can reach <em>anyone, anywhere, on any device</em> with a single codebase. In the other hand, native apps (or platform specific apps) work regardless of network connection, they make it easier for us to conect with the hardware and the operating system to do things like taking a picture, use keybaord shortcuts and much more. PWAs offer all the above.</p><h4>For users</h4><p>PWAs help the user to benefit from a very good experience especially mobile users who are the most important nowadays since mobile traffic share is over 54%, surpassing desktop computers (42%) as the most used device to access the internet. Mobile users, since they often use smartphones on the run, with a poor network connection or an expensive data plan, are the most impatient ones, that’s why PWAs provide fast loading and offline working apps since it’s actually <strong>installable </strong>so it works directly on the system (loads images, viewed posts…).</p><h4>For businesses</h4><p>It turns out that it’s easier to get people to install a PWA directly from the browser rather than going through app stores and that independency frees them from paying any middleman for distribution and offers faster update process, which makes the cost of user acquisition (CAC) much lower. It is also enough for businesses to build one web version of their app and then distribute it to be used easily on any platform which reduces the cost of development and increases the marketing ROI.</p><h3>PWAs Work</h3><p>Since it got introduced years ago, PWAs are getting more and more adopted by companies like Twitter, Tinder and Alibaba.</p><p>Let’s take Twitter as an example: Nicolas Gallagher, the Engineering Lead for Twitter Lite (Twitter’s PWA) affirmed “Twitter Lite is now the fastest, least expensive, and most reliable way to use Twitter. The web app rivals the performance of our native apps but requires less than 3% of the device storage space compared to Twitter for Android”. They also claim that Twitter Lite consumes less data by default, relying on cached data and optimized images as much as possible. It allows reducing data consumption by as much as 70% as users scroll through their timelines.</p><h3>Let’s Build a Simple PWA</h3><p>A “Hello World” app is the way to go always to learn a new thing, so let’s do that!</p><p>We’re going to need 4 files:</p><ul><li><em>logo.png</em></li><li><em>index.html: </em>it contains the HTML, CSS and JS of our app. We need to reference the manifest (manifest.json) and register our server worker (sw.js)</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e45d0ee97d89a075608305b526bb36c/href">https://medium.com/media/1e45d0ee97d89a075608305b526bb36c/href</a></iframe><ul><li><em>manifest.json: a</em>s every manifest file, this will hold our app’s metadata. The icons array should contain the list of the icons generated from our logo by running npx pwa-asset-generator logo.png icons. The final content will look like so:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/afc7c015a3b3b75e4400dfa73628aac8/href">https://medium.com/media/afc7c015a3b3b75e4400dfa73628aac8/href</a></iframe><ul><li><em>sw.js: </em>we will basically use this file to enable cashing for our app’s images. To make our lives easier, we will be using Workbox which is is a set of modules that simplify common service worker interactions such as routing and caching.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/15d9c5648c89f253be42ac58183aa09f/href">https://medium.com/media/15d9c5648c89f253be42ac58183aa09f/href</a></iframe><p>Now everything is ready, we can go ahead and launch our app by running npx serve. YaY!</p><h3>Conclusion</h3><p>The Progressive Web Apps are very promissing and it seems like it’s going to be much more adopted and why not the standard of building apps. What do you think?</p><p>That’s it for now, seeya soon 😄</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae6b9f515d11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps Explained]]></title>
            <link>https://oussemamiled.medium.com/devops-explained-bddc74731dba?source=rss-37f07d6f8ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/bddc74731dba</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Oussema Miled]]></dc:creator>
            <pubDate>Sat, 23 Jul 2022 16:18:30 GMT</pubDate>
            <atom:updated>2022-07-23T16:18:30.493Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we’ll get to understand what is DevOps and why do we need it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/1*3Z13nob-xJZwCCeXgLAqIA.png" /></figure><h4>Prerequisites</h4><p>To get the most out of this article, it’s <em>recommended </em>that you have a basic software development and deployment processes knowledge.</p><h3>The story</h3><p>Before DevOps, the software department in a company was comprised of two teams: the <strong>Dev</strong>elopment team that develops the plan, designs and builds the software and the <strong>Op</strong>eration<strong>s</strong> team that tests and deploys (puts online) the product.</p><p>The ops team gives feedback to the dev team about the bugs found and the changes needed after every iteration of the development cycle. Which means that the timeline will be extended and the software will take more time to be finally released. What can also happen is that the dev team moves on to work on the next project and then receive feedback about the one they thought they finsihed it, so a developer needs to remember and understand again what’s needed and so on. Long story short, a lot of time is wasted going back and fourth to the development and now the dev team hates the ops team since it’s annoying.</p><p>Now imagine that we fill that gap between both teams and we make it easier for them to work together. The solution is DevOps, so instead of waiting for a dev cycle to end to be able to test and deploy the changes, now theses phases are IN the cycle.</p><h3>What is DevOps?</h3><p>DevOps is the combination of anything (mindset, practices and tools) that creates the process of releasing a software fast and with high quality. It highlights the need for the collaboration between the dev and ops teams and focuses on a constant cycle of rapid iteration, measurement,assessment, and reevaluation. That was the theoritical definition.</p><p>DevOps as a role is automating the process from building the software to getting it online while assuring the quality. This process is what’s known as the CI/CD pipeline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*f1ZUdulNBlpmvxOS.png" /><figcaption>Unoffical DevOps Logo</figcaption></figure><p>You can see that the logo is an infinite cycle because the application improvement is infinite, new features and bug fixes get added over time that need to be deployed.</p><h3>CI/CD stages</h3><p>The standard of building a successful CI/CD pipeline is to go through 8 different phases as shown earlier in the logo. Let’s go through these again while keeping in mind why devops exists:</p><ol><li>The <strong>Plan</strong> phase is all about what happens before starting to code anything, it’s when the project manager gathers all information from stakeholders and customers and used it to build a product roadmap.</li><li>The <strong>Code</strong> phase focuses on core development tasks from within IDEs and appropriate sandboxing and frameworks.</li><li>The <strong>Build</strong> phase starts when a developer creates a pull request (PR) to add his new code to the old one. By creating a PR, an automated process starts which builds the codebase and runs a series of tests to identify any regressions.</li><li>The <strong>Test</strong> phase consists of a manual and an automated testing for the software, it can be a user acceptance test, security scans and a lot of other forms of testing. This phase highlights any issues that should be addressed before deploying into production.</li><li>The <strong>Release</strong> phase means that we are at a stage when it’s unlikely to catch any bugs or have any kind of issue. So the company can decide when she wants to deploy the changes to production.</li><li>The <strong>Deploy</strong> phase is when we actually release the new build into the production system.</li><li>The <strong>Operate </strong>phase occurs once the code is made live, and consists of making sure that everything is running correctly. We check the configurations, the system environment capabilities and so on.</li><li>The <strong>Monitor </strong>phase takes place parallel to the Operate phase and consists of data collection, analysis, and feedback to the start of the pipeline and to other phases as needed.</li></ol><h3><strong>More DevOps goodies</strong></h3><p>We previously mentionned how DevOps improves the work environment for the developers, but it’s better that we focus more on other advantages on different levels so we can feel more the importance of it.</p><p>For IT managers, the focus is mostly on improving all the metrics: how fast the software is built and how well it’s performing. As a result, the full cycle and especially the monitor phase of DevOps govern the advantages from an IT manager’s point of view. The benefits are:</p><ul><li>Less software defects</li><li>Lower cost and faster releases</li><li>Improved software performance and MTTR (Mean Time To Recovery)</li></ul><p>The CTO / CIO of the organization focuses more on having an efficient team collaboration, a good working atmoshpere and also on ensuring product quality and availability. From the lens of a CTO/ CIO, DevOps offers the following benefits:</p><ul><li>Individual improvement and cross-skilling</li><li>Greater flexibility, adaptability and engagement</li><li>Freedom to brainstorm and experiment</li><li>Cooperative and happier teams</li><li>Better process management</li><li>Reliable and faster fixes, along with enhanced operational support.</li></ul><p>We can now notice that implementing DevOps practices within a company offers big benefits which will help the company to be more successful and to generate higher profits.</p><h4>Conclusion</h4><p>During this article, we talked about DevOps without digging deeper into details. In the upcoming articles, we’ll go through each stage and discuss how it’s done nowadays, the tools used and much more.</p><p>Hopefully you found this helpful 😄, seeya soon!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bddc74731dba" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Host a Static App on AWS S3 and Link a Custom Domain]]></title>
            <link>https://aws.plainenglish.io/hosting-a-static-app-on-aws-s3-and-linking-a-custom-domain-43917e152178?source=rss-37f07d6f8ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/43917e152178</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[hosting]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Oussema Miled]]></dc:creator>
            <pubDate>Sat, 16 Oct 2021 12:03:19 GMT</pubDate>
            <atom:updated>2021-10-17T12:56:51.493Z</atom:updated>
            <content:encoded><![CDATA[<p>During this article, we will host a simple React app on AWS S3 and then use AWS Route53 to link our custom domain.</p><p>There are many steps included but it’s totally worth it. So let’s get started!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b7pd1yEIkjZe8Ypqrk_lFw.png" /></figure><h4>Prerequisites</h4><ul><li>Knowing what static hosting is.</li><li>Basic understanding of AWS S3 and Route53.</li><li>AWS account and your app domain name on Route53 if you’re going to follow along.</li></ul><h4>Creating the React app</h4><p>Since we’re gonna work on a react app, obviously we need to create one. So let’s quickly do that by running npx create-react-app awsapp and here I am assuming you have <em>node</em> installed.</p><p>We won’t actually change the default content of the app, since it’s not a react dev article.</p><p>After that we need to generate the static files which will be actually hosted, running npm run build inside the app directory will do the work.</p><h4>Hosting on S3</h4><p>Let’s now create an S3 bucket, I’m gonna use www.awsapp.com but you need to include your own domain. Just make sure you include www and leave the rest as it is and click Create bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*KLAhcuigNXOsgwsT_x4r7Q.png" /></figure><p>Now that our bucket is created, we can upload all the content of the build directory into it. To do so, in the Objects tab, we hit Upload , select all directory content and Upload again.</p><p>By default, AWS blocks public access to the bucket so we need to disable that by going to Permissions tab and then Block public access section,edit<em>, </em>uncheck<em> </em>Bloc all public access<em>, </em>Save changes and confirm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*4Qxp95hVFxpXpzDFL9slzA.png" /></figure><p>Under the Bloc all public access section there is Bucket policy which we need to edit by adding the policy below. Don’t forget to change Bucket-Name with the name of your bucket then save the changes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c71e36041416486c4758ffeb54b38ba/href">https://medium.com/media/1c71e36041416486c4758ffeb54b38ba/href</a></iframe><p>Now, we’re going to enable static web hosting on the bucket in the Properties tab, we scroll all the way down to Static website hosting section and click Edit then fill the form like so and leave the rest blank:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*6MDjPgCIijKMLs1CO_AHDA.png" /></figure><p>Now, if you go back to Static website hosting section you’ll find the app’s public URL. Here you go, your website is live 💪.</p><h4>Linking your own domain</h4><p>Until now, if we try to access our website awsapp.com on the browser, we still can’t access it because we need to do extra steps. The first step will be creating a redirection from awsapp.com to www.awsapp.com . To do that, we’ll create another bucket with the name awsapp.com and then go to Properties ,Static website hosting then fill the form like so:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*N_pVtYEbhxlFIdj55F3s8Q.png" /></figure><p>From now on, I’m gonna assume that you have a domain name within AWS Route53, you still can do the same if you registered your domain from elsewhere but I am not gonna cover that.</p><p>Let’s go to Route53 Dashboard, Hosted zone and select our domain and now we need to create two new records, one for awsapp.com and the other for www.awsapp.com . Click Create record , choose Simple routing and click Define simple record and we have to fill another form:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*BIvqwKY-64iiwkXMjoV-oQ.png" /></figure><p>Of course, if your bucket exists in another region, choose that one. Now we click onDefine simple record and yes, another form:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*zPJCtAPT47ROdrBzLZHAnw.png" /></figure><p>Finally, hit Create records .</p><p>Keep in mind that these configurations may take some time to work, so let’s wait for at least 60 seconds and then we go on the browser and visit awsapp.com . We can see that we got redirected to www.awsapp.com . That’s awesome, it works as intended.</p><p>That’s it for now, If you have any question please leave a comment.</p><p>Hope you enjoyed reading and found this useful. See you soon! ✌️</p><p><em>More content at </em><a href="http://plainenglish.io/"><strong><em>plainenglish.io</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43917e152178" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/hosting-a-static-app-on-aws-s3-and-linking-a-custom-domain-43917e152178">How to Host a Static App on AWS S3 and Link a Custom Domain</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is AWS Lambda Container Image?]]></title>
            <link>https://aws.plainenglish.io/aws-lambda-container-image-a5eab06a445?source=rss-37f07d6f8ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5eab06a445</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Oussema Miled]]></dc:creator>
            <pubDate>Thu, 09 Sep 2021 08:18:32 GMT</pubDate>
            <atom:updated>2021-09-24T07:51:35.759Z</atom:updated>
            <content:encoded><![CDATA[<h4>What is AWS Lambda Container Image along with an example to help understand the workflow</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vlHMOWuX1jXgkDXBiyxNhg.png" /></figure><h4>Prerequisites</h4><ul><li>Basic understanding of containers</li><li>An AWS account</li><li>Basic Knowledge of AWS such as the console and roles</li></ul><h3>What is Lambda Container Image?</h3><p>Before we dive into Lambda Container Image (Let’s refer to it with <strong>LCI</strong> from now on), we need to understand Lambda service first. So what is it?</p><p><strong>Lambda</strong> is a serverless computing service provided by AWS which we can use to run functions, self-contained applications written in one of the supported languages (Node.js, Python, Go, Java, and more). <strong>Serverless </strong>doesn’t mean that there are no servers but it means that developers can write and execute code without worrying about administrative tasks such as maintaining servers.</p><p>It’s also important to understand that each Lambda function runs in its own container. So when we create a function, Lambda will package it in a container and then run that container in a cluster.</p><p>Now with <strong>LCI</strong>, we can package our Lambda function and the needed dependencies in an image using Docker CLI for example. Then we upload that image to AWS <a href="https://aws.amazon.com/ecr/">ECR</a> (Elastic Container Registry). After that, we can go ahead and deploy the Lambda function based on the image we’ve created.</p><p>You can learn more about details such as the requirements from <a href="https://docs.aws.amazon.com/lambda/latest/dg/images-create.html">the official documentatio</a>n. But for now, enough of theories, let’s actually build something!</p><h3>LCI Example</h3><p>Let’s build a pretty simple LCI, it takes a name as payload and prints Hi + name . We’re going to use Node.js to write the code and Docker to build the image.</p><p>In the <em>same</em> directory let’s create two files, one for our code app.js and Dockerfile for the image.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb22340afd3e1d99a2d57943baa484b3/href">https://medium.com/media/eb22340afd3e1d99a2d57943baa484b3/href</a></iframe><p>The above code is the Lambda handler which will be executed when we invoke the function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1cb62d0f5c072d2d5644a1a9f7ceb7ae/href">https://medium.com/media/1cb62d0f5c072d2d5644a1a9f7ceb7ae/href</a></iframe><p>Here we use the lambda-node base image from AWS, we copy the file containing the Lambda handler app.js in the container and finally run it.</p><p>To build the image, run:</p><pre>docker build -t example .</pre><p>Now, we need to create an ECR repo or use an existing one to host our image. To do so, we open the AWS console and visit the ECR service, you can follow <a href="http://console.aws.amazon.com/ecr/repositories">this link </a>for quick access. Choose the region you want, click on Create repository button, name your repo and leave the rest as it is then click the Create repository button. To finish, we need to push our image to this repo. Just follow the steps provided when you click View push commands button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Bw2rW_XwzDNLENx4Edhsw.png" /></figure><p>Let’s now create the Lambda function, keep in mind that the Lambda function and the ECR repo should be created in the same AWS account.</p><p>Visit the Lambda service and click Create function , choose Container image option, give it a name, browse images and select the one we just created, finally hit Create function button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZjmIf5xtIjy0jOoLTB8pHw.png" /></figure><p>Now we are ready to go and test our work. In the Test tab, write the event which will be sent to the Lambda and click the Test button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*6fJh1lroOdYyRbPO7ocn-Q.png" /><figcaption>Creating Test Event</figcaption></figure><p>Here we go, The Lambda works as intended. Good job my friend 🙌</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*6yW9518bOvlypMV9LVD4uw.png" /><figcaption>Execution Result</figcaption></figure><p>You can also check the CloudWatch logs to see the executed steps and some details by clicking on logs link.</p><p>That’s it for today, I wanted to keep it as straightforward as possible. I hope you liked it, feel free to ask any question in the comments section.</p><p>Thanks! 😄</p><h4>PS: If you like what I do and want to support me, you can do that by becoming a medium member using this <a href="https://oussemamiled.medium.com/membership">link</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5eab06a445" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/aws-lambda-container-image-a5eab06a445">What is AWS Lambda Container Image?</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with AWS]]></title>
            <link>https://oussemamiled.medium.com/getting-started-with-aws-2851890aeff9?source=rss-37f07d6f8ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2851890aeff9</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[amazon]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Oussema Miled]]></dc:creator>
            <pubDate>Tue, 04 May 2021 13:49:40 GMT</pubDate>
            <atom:updated>2021-09-24T07:51:59.416Z</atom:updated>
            <content:encoded><![CDATA[<p>This article introduce you to AWS covering some of its advantages and some basic topic which can help you start learning and using AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ytC_DIm9dH8SKh40.jpg" /></figure><h3>Satisfying the needs</h3><p>In today’s competitive market, customers demand low latency, highly scalable, responsive applications that work all the time. Customers expect to receive the same level of performance and consistency of applications regardless of their location and how often they use those applications.</p><p>With the classic infrastructures, there are always problems related to cost, flexibility, scalability and more. The cloud solved all these issues.</p><p>The AWS Cloud provides infrastructure services, such as compute, storage, networking, and databases, and a broad set of platform capabilities such as mobile services, analytics, and machine learning (ML). These services are available on demand, through the internet, and with pay-as-you-go pricing. With these features and capabilities, AWS fully satisfies the needs of the companies, developers, users…</p><p>Despite there is other significant and powerful cloud providers such as Microsoft Azure and Google Cloud Platform, AWS proved itself to be the best out there for many reasons which you can learn more about following <a href="https://www.veritis.com/blog/aws-vs-azure-vs-gcp-the-cloud-platform-of-your-choice/">this link</a>.</p><h3>Create an account to start</h3><p>Obviously, so that we can use AWS, we first need to <a href="https://portal.aws.amazon.com/billing/signup?nc2=h_ct&amp;src=header_signup&amp;redirect_url=https%3A%2F%2Faws.amazon.com%2Fregistration-confirmation#/start">create an account</a> and activate it providing a valid credit card. It’s as easy as following some steps and it won’t take more than 5 minutes and also don’t worry, you don’t need to pay anything as long as you use the free tier plan. Jeff is generous enough to provide us with hundreds of services to use for free always or for the first 12 months or via trials. Here’s <a href="https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&amp;all-free-tier.sort-order=asc&amp;awsf.Free%20Tier%20Types=*all&amp;awsf.Free%20Tier%20Categories=*all">the full list</a>.</p><h3>AWS Management Console, SDKs &amp; CLI</h3><p>After creating an account, we can start to explore the AWS Management Console</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Vjz7kiRMjt5Kx-BF_-5nmA.png" /><figcaption>Previewing AWS MC</figcaption></figure><p>Because all the functionalities of AWS is exposed through APIs, AWS provides more than only the web interface for managing resources. For example, the console is also available as a mobile app for iOS and for Android.</p><p>I recommend that you take the time to explore the management console, discover what you can do on it, list and learn more about AWS services etc.</p><p>After you become familiar with a service, you can manage AWS resources programmatically through either the AWS Command Line Interface (AWS CLI) or the AWS software development kits (AWS SDKs), as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/518/1*RSsvDyWlQt-fgQSS2PEvww.png" /><figcaption>Options for managing AWS resources</figcaption></figure><h4>AWS SDKs</h4><p>If you’re not familiar with SDKs, basically a software development toolkit (SDK) is a set of software tools and programs provided by hardware and software vendors that developers can use to build applications for specific platforms.</p><p>AWS SDKs are available in many popular programming languages such as Java, .NET, JavaScript, PHP, Python, Ruby, Go, and C++. AWS also provides specialty SDKs such as the AWS Mobile SDK and AWS Internet of Things (IoT) Device SDK.</p><h4>AWS CLI Tools</h4><p>In addition to the AWS Management Console and SDKs, AWS provides tools to manage AWS resources from the command line. One such tool is the AWS CLI, which is available on Windows, Linux/Unix, and macOS.</p><p>The AWS CLI allows you to perform actions similar to those from the SDKs but in an interactive scripting environment. Because the AWS CLI is interactive, it is a good environment for experimenting with AWS features. Also, the AWS CLI and the SDK on the same server can share configuration settings.</p><h3>Working with Regions</h3><p>AWS operates facilities in multiple regions across the world, as shown below. Each AWS Region is designed to be isolated from the other AWS Regions. This design achieves the greatest possible fault tolerance and stability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d8EkqNEt0RgDEDKuSkDXlQ.png" /><figcaption>AWS Global Infrastructure Map</figcaption></figure><p>When you view your resources, you see only the resources that are tied to the AWS Region that you specified (on the top right of the management console).</p><p>AWS has 80 Availability Zones (we’ll talk about it in a moment) across 25 geographic regions, with plans to launch 15 more Availability Zones and five more AWS Regions. The number is growing each year.</p><h4>Availability Zones</h4><p>Each AWS Region contains multiple data centers, grouped together to form Availability Zones. Regions are composed of multiple Availability Zones, which allows AWS to provide highly available services in a way that differentiates them from traditional architectures with single or multiple data centers.</p><p>Availability Zones are physically separated from each other and are designed to operate independently from each other in the case of a fault or natural disaster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/412/1*su_MOP_3XFqWc9kSHpqcMg.png" /><figcaption>Regions and Availability Zones</figcaption></figure><p>AWS customers can improve the resilience of their applications by deploying a copy of each application to a second Availability Zone within the same region. This allows the application to remain available to customers even in the face of events that could disrupt an entire data center. Similarly, many of the AWS services automatically replicate data across multiple Availability Zones within an AWS Region to provide high availability and durability of the data.</p><p>An example of an AWS service that replicates data across Availability Zones within a region is Amazon Simple Storage Service (Amazon S3). Amazon S3 enables you to upload files and store those files as objects within a bucket. By default, Amazon S3 automatically replicates objects across a minimum of three Availability Zones within the region hosting the bucket. This design protects data even against the loss of one entire Availability Zone.</p><h4>Choosing a Region</h4><p>One factor for choosing an AWS Region is the availability of the services required by your application. Other aspects to consider when choosing a region include latency, price, and data residency. The image below describes selection criteria to include when choosing an AWS Region.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*jr0R9gxQgw0ZZhBdr3fkBw.png" /><figcaption>Selecting an AWS Region</figcaption></figure><h3>That’s it for now</h3><p>I guess the mentioned informations and topics that I included in this article are enough as an introduction and to stimulate your curiosity so you learn more about it. Personally, I found AWS very interesting and fun to work with and I am happy to share what I learned with you from time to time. Stay Tuned! 😄</p><h4>PS: If you like what I do and want to support me, you can do that by becoming a medium member using this <a href="https://oussemamiled.medium.com/membership">link</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2851890aeff9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trading: Binary Options are SCAM]]></title>
            <link>https://medium.datadriveninvestor.com/trading-binary-options-are-scam-fe1e2c535958?source=rss-37f07d6f8ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe1e2c535958</guid>
            <category><![CDATA[scam]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[trading]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[market]]></category>
            <dc:creator><![CDATA[Oussema Miled]]></dc:creator>
            <pubDate>Sun, 14 Feb 2021 17:30:24 GMT</pubDate>
            <atom:updated>2022-10-23T08:04:55.390Z</atom:updated>
            <content:encoded><![CDATA[<p>We’ll be discussing binary options, and why you shouldn’t trade in these.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/1*nXlO6wJveb5P5b5hIgvngQ.png" /></figure><p>Everyone should have seen it and I bet you did too, an ad on social media and on many websites showing a nice and attractive chart with 2 buttons, a green one to ‘call ‘and a red one to ‘put’. Hitting those two buttons is called trading in binary options. If you don’t know what these are, you can read the definition below. Otherwise, feel free to skip it.</p><h3>What are binary options?</h3><p>Binary options are one among the derivatives available in the market like CFD’s, Futures and Options. Using binary options you can trade in anything because you’re not really buying those but just speculating the price direction. You do that using the easiest way possible, you just need to answer the following question “will the price go up?”, if yes then you hit the green button otherwise the red one. That’s why it’s called ‘binary’, cause you can only perform 2 actions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*lBpQwULwcpBQRGBZ28K6Ew.png" /><figcaption>a screenshot from IQ Option broker</figcaption></figure><p>Let’s explain the picture more: we have our two buttons which we’ve explained, above that you can specify the expiration time(presented by the red line on the chart) and the size of your trade and see the profit percentage. So if you trade using 5 dollars with the profit set to 84% and if you answer the question correctly, you get 9.2$ otherwise you lose all your money. The white bar shows the time up to which you can rebuy options.</p><p>So trading in binary options is not a hard thing to do, it’s actually so simple, that’s why people who don’t know how to trade and new traders are attracted to it.</p><h3>Why Binary Options are scam?</h3><p>To know if a broker is scamming people or not, we need to ask a question first “How does the broker makes money?”.</p><p>Trading in binary options has a risk-reward ratio &gt; 1 which means obviously the risk is greater than the reward. As we mentioned before, if you get to answer the question correctly you get a specific profit percentage, but this percentage is always less than 100% and it depends on what you trading: stocks, forex… In the other hand if you get it wrong, you lose all your money which is 100%. So in this case the broker will win whether you win or lose but if you lose, he gets more. So does he want you to win?</p><p>Also, the profit percentage is fixed by the broker and the trader has no control over it at all, that’s another shady problem. There is more, usually a good trader will analyze the chart so he can take a better decision, but there is the red line which sets the deadline to close the trade, which if you choose to make it longer, the profit percentage will usually decrease. Which means the trader doesn’t really have the needed time to run analytics.</p><h4>Let’s go further</h4><p>As far as I know, most binary options brokers, if not all of them, are not ECN brokers but they are Market Makers. Which means they can apply another price to the stock or whatever, different from the real price in the market.</p><h4>Some Quick Math</h4><p>Let’s say you’re going to perform 100 trading operations, each operation costs 10$ and the profit percentage is set to 70%. The percentage of you winning is 50% and it’s the same if you lose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*75sbEazSlWv7qkFBXVNdVw.png" /></figure><p>So you won 50 of the operations and got 350$ profit but you lost the other 50 and you lost 500$, which means you lose exactly 150$.</p><p>Ok, let’s say you are way smarter and can win. In this case you need to increase the wining percentage to 60%, so we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*r9_o4JSiH2qKgPbTJijqEQ.png" /></figure><p>First, it’s so hard to reach that percentage(if not impossible), especially with the previous problems which we talked about, like the time to close the trade etc.. And second, the profit still isn’t good and I don’t think it’s worth it. 20$ represents only 2% of the money you put in the beginning(10$*100).</p><h4>So why all people talking about it and saying they made a ton of money from it?</h4><p>Simply because they get payed to do that. Brokers like IQ Options pays up to 70% of the revenue they make from a client to the person who brought that client through an affiliate program. So don’t believe these assholes please!</p><p>That’s it, I hope now you understand why it’s dangerous to trade in binary options and if you still have questions or you don’t agree with me, just leave a comment. Thanks for following along 😄</p><h4>PS: If you like what I do and want to support me, you can do that by becoming a medium member using this <a href="https://oussemamiled.medium.com/membership">link</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe1e2c535958" width="1" height="1" alt=""><hr><p><a href="https://medium.datadriveninvestor.com/trading-binary-options-are-scam-fe1e2c535958">Trading: Binary Options are SCAM</a> was originally published in <a href="https://medium.datadriveninvestor.com/">DataDrivenInvestor</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I wanna be financially independent?]]></title>
            <link>https://oussemamiled.medium.com/why-i-wanna-be-financially-independent-323970ef5c75?source=rss-37f07d6f8ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/323970ef5c75</guid>
            <category><![CDATA[mindset]]></category>
            <category><![CDATA[money]]></category>
            <category><![CDATA[business]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[life]]></category>
            <dc:creator><![CDATA[Oussema Miled]]></dc:creator>
            <pubDate>Mon, 18 Jan 2021 15:59:14 GMT</pubDate>
            <atom:updated>2021-09-24T07:52:39.707Z</atom:updated>
            <content:encoded><![CDATA[<p>We’ll be talking about how we SHOULD change the way we think about money and why you SHOULD learn about this and actually plan something!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UQ2EyC6pIBP5YmLq6uumFg.png" /></figure><p>If you list my previous articles, you’ll be like ‘what the heck!?’ cause yeah, I usually write about programming related stuff, but here I go with the first article sharing my thoughts about financial independence. If you can relate, that’s great! If you don’t, please take the time to write a comment and tell me why I am wrong.</p><p>The thing is, I don’t wanna pass the rest of my life programming. It’s true that I like it, but even now, while I’m 22 years old, I get annoyed to keep working almost everyday for a long time, If you’re a programmer, you can understand what I am saying: sitting in front of your PC for more than 10 hours a day, back pain, eyes hurt, drinking too much coffee, sucky social life maybe…</p><p>Some people say “If you like what you do, you’d do it always even if you do it for free”’. I used to agree with that until no more and I realized deep down that’s not true, because when you do what you like, you do it <strong>whenever</strong> you like. When you don’t feel like it, you just don’t do it. If you love playing video games for instance, for sure sometimes you got to a point when you’re like “argh, enough of it for now.” But If you gonna rely on video games to live (to earn money), you can’t just stop, you<strong> have</strong> to do it.</p><p>It’s is so traumatizing to think I need to work until I’m like 65 years old, by then I won’t have the perfect health to use the money the way I always wanted, like traveling and many other things. Actually I may die before I get there or maybe I won’t have extra money, maybe I won’t even have the mindset of enjoying stuff. I go back with my thoughts to the past to see how much I gave and to the future to see how much I still should give in order to have a ‘good’ job (job security). But is it worth it? Years and years of studying things I am not actually interested in, all I worry about is to get good enough grades to pass, not actually how to use that in my life. The school system made me feel so many times that I’m just a robot: study the lesson → pass the exam → forget the lesson. I HATE to feel like that.</p><p>So during those really bad feelings and thoughts, I kept asking, what’s the solution then? What can I do so I don’t live like that? And of course I kept thinking of the rich people, how did they make that money? How is that possible? Till now, you can see how many questions I had and how lost I was. And yeah, most of those people don’t have a college degree or studied at the best universities, but still they are the bosses of people who did. This reminds me of what Elon Musk once said:</p><blockquote><strong>“Don’t confuse education with schooling, I didn’t go to Harvard, but people who work for me did”</strong></blockquote><p>So, will I pass 20 years studying to work 30 years for someone who probably doesn’t even have a degree? No, I won’t(hopefully) and obviously school doesn’t make you financially smarter, which is actually the goal.</p><p>Then I started to search about this, watch those rich people do Ted talks, take courses and all that kind of stuff until I understood most of the ways they did it (without details for now obviously). First book I read about this subject was the famous ‘Rich dad, Poor dad’ by Robert Kiyosaki and of course I loved the book and recommend you read it if you haven’t yet.</p><p>After a long period of searching, I got to understand the key phrase “<strong>Don’t work for money, make it work for you”</strong>. The idea is to find a way which allows you to earn money even while you’re asleep in your bed, because if you don’t, you’ll pass your life chasing money. But of course that’s not easy to do, that’s why we’re not all rich. Some people wanted it and got it, some people didn’t, because those who did it worked on a plan and actually invested their time and money trying stuff while the others were only dreaming. So you gotta move, you gotta take actions!</p><p>Being rich is a mindset, I learned that there are common thoughts and rules rich people follow, things like you shouldn’t be afraid to fail and that’s actually the best way to learn, that you shouldn’t give up, that you shouldn’t worry about what people think about you and so on… You need to liberate yourself from the idea of job security and just find your way to rise. Don’t limit your dreams, dream big even if you think it’s insane to reach that.</p><p>The phase after that is choosing the way that suits me, I finally decided to learn investing in stocks and maintain working on dev for now, because I need to make money to invest of course and because I can fail doing that so I have a plan B (still a bad one for now). Will I succeed? I don’t know. What if it doesn’t work? I’ll try another way. As Jeff Bezos said:</p><blockquote><strong>“I knew that if I failed I wouldn’t regret that, but I knew the one thing I might regret is not trying.”</strong></blockquote><p>For now, that’s all. I need to go study and make my dream come true. But I promise, I’ll keep you updated and I’ll share what I learn with you in some of the next articles. Peace ✌️!</p><h4>PS: If you like what I do and want to support me, you can do that by becoming a medium member using this <a href="https://oussemamiled.medium.com/membership">link</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=323970ef5c75" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Node.JS Under the Hood]]></title>
            <link>https://medium.com/swlh/node-js-under-the-hood-86934aad55e3?source=rss-37f07d6f8ac1------2</link>
            <guid isPermaLink="false">https://medium.com/p/86934aad55e3</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[learning]]></category>
            <dc:creator><![CDATA[Oussema Miled]]></dc:creator>
            <pubDate>Sat, 31 Oct 2020 18:02:05 GMT</pubDate>
            <atom:updated>2021-09-24T07:53:35.563Z</atom:updated>
            <content:encoded><![CDATA[<h3>Node.JS In C++?</h3><p>We gonna explore in simple terms how Node.js actually works. All the stuff you need to know so you build efficient node apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*E-ed335ti3uFJI2fXkNaRQ.png" /></figure><h4>Perquisites</h4><p>To follow along, you need to have some basic understanding about <a href="https://medium.com/weekly-webtips/intro-to-async-js-6f2270c11a10">asynchronous</a> and backend programming.</p><h3>Architecture</h3><p>In terms of Node’s dependencies, there’s basically a couple of libraries that Node depends on in order to work properly:</p><p><strong>V8 JavaScript engine: </strong>converts JavaScript code into machine code that a computer can actually understand, because JavaScript is built to work on browsers and not operating systems. (Written in C++)</p><p><strong>Libuv: </strong>an open source library with a strong focus on asynchronous Input/Output, this layer is what gives node access to many functionalities such as file system, networking and more. Besides that, Libuv implements two extremely important features of Node.js which are <em>Event Loop</em> &amp; <em>Thread Pool </em>and we’ll talk about these bad guys soon. (Written in C)</p><p>So Node.js takes advantage of these powerful libraries written in C and C++ and gives us access to their functions in pure JavaScript. That provides us with a very nice layer of abstraction to make our lives a lot easier, not all of us like messing with low level programming languages, right? 😆 How awesome is that! ❤️</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*q1votd3SY_J8UM1tBQo_Ow.png" /></figure><p>Those as we said are the main libraries, but there are other ones that Node uses: <a href="https://github.com/nodejs/http-parser">http-parser</a> for parsing http obviously, <a href="https://c-ares.haxx.se/">c-ares</a> for some DNS stuff, <a href="https://www.openssl.org/">openSSl </a>for cryptography and <a href="https://z-lib.org/">zlib</a> for compression, and these are not so important to understand.</p><h3>Threads &amp; Thread Pool</h3><p>Node.js is single <a href="https://en.wikipedia.org/wiki/Thread_(computing)">threaded</a>, so whether you have a single user or 10 millions of users accessing your application, there is only one thread to deal with that, so you need to be very careful about not blocking that thread. So how does it work?</p><p>This is what happens in our thread when we start a Node application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*b4KBzoFlpAYqarbe0-Oksg.png" /></figure><p>So as we can see, the main thread is handled by<em> event loop </em>(more about it later, I promise) but we got a problem; some tasks are heavy and executing these with event loop will block our entire application, that’s when the thread pool comes in. When the event loop encounter a heavy task, it sends it to the thread pool to handle it, after finishing that task, the thread pool let the event loop know that the task is completed and so on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*FuwQlBbJXvc_MZ5f_N7rHw.png" /></figure><p>So with the Thread Pool, we have at least 4 (up to 128) additional threads to offload work from event loop and handle the heavy tasks such as Cryptography, File system APIs… I hope you get it 😅</p><h3>Event Loop (Finally)</h3><p>The event loop is for all the application code that is inside <strong>callback functions</strong> (non top-level code) which are the heart of Node, so event loop is the most important thing to understand.</p><p>Any time something happens in a NodeJS application, an <em>event</em> is created.</p><p>New events are loaded onto the event queue. These events are processed serially. The event loop takes events from the head of the event queue one at a time and hands them off to the file system, network, or another process.</p><p>As those events are processed, they create more events. Those new events are placed at the back of the event queue, and the cycle continues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*WafxFp8I6WU70qg9Ot2Ffg.jpeg" /></figure><h3>Example</h3><p>Let’s now take an <a href="https://www.quora.com/In-Node-js-how-does-the-event-loop-work/answer/Asmit-Basu">example</a> that explains all that</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4fd020c85d0f9583d6e47b9959bd48d4/href">https://medium.com/media/4fd020c85d0f9583d6e47b9959bd48d4/href</a></iframe><p>The script will run like so:</p><ol><li>fs.readFile called and is in the event queue</li><li>The internal readFile() code attaches a “complete” event with myfunc callback</li><li>The event gets registered to this operation via libuv</li><li>Libuv requests a new thread from its internal thread pool</li><li>Libuv delegates I/O file read to the thread and starts it</li><li>Thread completes and fires “complete” event</li><li>V8 event watcher runs in a loop &amp; checks for any new event in the event queue</li><li>On receiving event, it fetches registered call back and passes to Node</li><li>Node receives callback and pushes it to callback queue</li><li>The almost famous node task/event loop checks for any new callback in queue</li><li>On receiving callback, it tries to fire callback as soon as call stack is empty</li><li>Callback myfunc is pushed to call stack</li><li>It is executed and console.log is added to call stack</li><li>Print appears in console ‘Task done’</li></ol><h3>Bonus: How Requiring Modules Actually Work?</h3><p>To include a module in a file, node.js follows 5 steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*XCcPf08zrKZSMn2TJ0OZJA.png" /></figure><p><strong>Resolving:</strong> Since there are 3 types of modules:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*dntDzghGYfMmK5bL07eCKw.png" /></figure><p>Node needs to know which one to get and from where, in other words, it needs to resolve the path of the module. The steps node will follow are:</p><p>1- Starts with core modules.</p><p>2- If the path begins with <strong>./</strong> or <strong>../</strong> , it tries to load developer module.</p><p>3- If no file found, it tries to <strong>find</strong> <strong>a folder</strong> with index.js in it.</p><p>4- Go to <strong>node_modules/</strong> and try to find the module there.</p><p>And of course, if it finds nothing, an error will be thrown and the execution of the app stops.</p><p><strong>Wrapping:</strong> During this step, node wraps the module code in an immediately invoked function expression (<a href="https://www.tutorialsteacher.com/javascript/immediately-invoked-function-expression-iife">IIFE</a>) which will give us access to some objects, here we get the answer to the question ‘Where does the require function come from and why do we have access to it?’ That’s what I call Magic<strong> 💖</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*h1pvWKmokBQlnyGV8Y0IIg.png" /></figure><p><strong>Execution:</strong> Execution of the module code.</p><p><strong>Returning Exports:</strong> After executing a function, we get a return. In this case, we get the exports of the required module (module.exports or exports.funcName).</p><p><strong>Caching: </strong>This means if you require a specific module again, node will not execute it again but it will use the already executed one.</p><p>That’s all folks, thank you for following along and seeya soon! 😄</p><h4>PS: If you like what I do and want to support me, you can do that by becoming a medium member using this <a href="https://oussemamiled.medium.com/membership">link</a></h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86934aad55e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/node-js-under-the-hood-86934aad55e3">Node.JS Under the Hood</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>