<?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 Jose J. Cruz on Medium]]></title>
        <description><![CDATA[Stories by Jose J. Cruz on Medium]]></description>
        <link>https://medium.com/@jjzcru?source=rss-144c52945621------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lUeFXuXZc2tcghEEgLcHeQ.jpeg</url>
            <title>Stories by Jose J. Cruz on Medium</title>
            <link>https://medium.com/@jjzcru?source=rss-144c52945621------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 04:15:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jjzcru/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[ Notes On — The Cult Of The Customer]]></title>
            <link>https://medium.com/@jjzcru/notes-on-the-cult-of-the-customer-e8ec6324713a?source=rss-144c52945621------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8ec6324713a</guid>
            <category><![CDATA[business]]></category>
            <category><![CDATA[business-strategy]]></category>
            <category><![CDATA[company-culture]]></category>
            <category><![CDATA[user-experience]]></category>
            <category><![CDATA[customer-experience]]></category>
            <dc:creator><![CDATA[Jose J. Cruz]]></dc:creator>
            <pubDate>Wed, 28 Dec 2022 20:38:53 GMT</pubDate>
            <atom:updated>2022-12-28T20:38:53.870Z</atom:updated>
            <content:encoded><![CDATA[<h3>📝 Notes On — The Cult Of The Customer</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*hxy3jBhvVIcQuP_iSup_PA.jpeg" /><figcaption>Cult of the Customer — Shep Hyken</figcaption></figure><p>Cult comes from the latin word <em>cultus</em> which originally meant “care or tending”.</p><p>The purpose of the book is to take care of and tend to employees and customers and that culture by itself will create evangelists for your business.</p><p>Those <em>evangelist</em> are people who spend energy and go out of their way to tell the world how great you or your company is, and those are the kind of people you want to cultivate within and outside of your organization….the kind of culture that is rooted in <em>amazement</em> and that is <strong>The Cult of the Customer</strong>.</p><blockquote>No person — and no organization — is perfect. It is the <em>pursuit</em> of perfection, the effort that is put into being amazing and staying amazing, that makes the truly great companies <em>great</em>.</blockquote><h4>What is the purpose of your business?</h4><blockquote>The purpose of every business and organization is to <em>get and keep</em> customers.</blockquote><p>The purpose of your business is not to make money or make profit, that is your <em>goal</em>, business provide either a product or a service for a customer, and customers in return make the business or the organization alive by buying into the, and if they are excited by them as well then also will evangelize it.</p><blockquote>You depend on your customers for a living</blockquote><p>As a business you need to understand what is that your customers wants, if you operate without this they will end up buying to your competition or simply stop buying.</p><blockquote>The customer experience comes in part from service, but in the large sense it is everything created by any and all contact with your operation. Your goal is to improve the quality of the customer experience.</blockquote><h4>What is the cult of the customer?</h4><p><em>Satisfying</em> customer is not enough to build <em>loyal</em> customers, you need to <em>amaze</em> them so they advocate on your behalf.</p><p>This is a method of operating, working, and living that if focused on <em>consistently</em> delivering experiences that are <a href="https://store.hyken.com/products/moments-of-magic/3201087000000952531">Moments of Magic</a>, which are positive touch points that the company (and employees) have with the customer.</p><blockquote>A Moment of Magic is simply an above-average experience</blockquote><p>A single <em>moment</em> is not going to bring <em>amazement</em> but a sequence of those moments <em>will</em> inspire <em>amazement</em>.</p><p>Imagine the experience of going to an Apple Store, the moment you go through the entrance and you get greeted by a smiling employee, in an ambient that is full of energy, by the fact that you don’t need to wait in line and you don’t feel crowded by the decor, all those <em>Magic Moments</em> bring you <em>amazement</em>.</p><p>Only this feeling, the feeling of <em>amazement</em> can bring you legions of faithful, <em>unpaid</em>, passionate advocates for your organization, this <em>evangelists</em> are the best marketing campaign you can get, better than ads, impressions or clicks word of mouth is the most powerful marketing campaign because this advocacy is also rooted in loyalty.</p><h4>Why use the word cult?</h4><p>Since humans are social animals this is part of our humanity, a group of people that share a deeper than usual passion for something which could be a hobby, sport, or band, this makes you a part of a <em>cult</em>, or better yet when you think of the word <em>cult</em> think about the word <em>culture</em>.</p><blockquote>A cult is simply a shared system of belief, experience, or interest.</blockquote><p>If you want to take your businesses to the next level you need to become part of <em>The Cult of Amazement</em>, which focus on building <em>Magic Moments</em> consistently in an ongoing pattern of experiences.</p><blockquote>There is no loyalty without confidence, and there is no confidence without consistency</blockquote><h4>The Five Cults</h4><ol><li><strong>The Cult of Uncertainty</strong>: Customers are not sure of what is going to happened, there is inconsistencies, there isn’t a real loyalty to the business.</li><li><strong>The Cult of Alignment</strong>: Customers are aware of your business and value proposition, they are still unsure but at least have expectation.</li><li><strong>The Cult of Experience</strong>: Customers have a good experience but are not loyal, <em>yet</em>, they still need more positive experiences.</li><li><strong>The Cult of Ownership</strong>: Customers notices that there is a pattern of great experiences, they start to lean more towards your company instead of your competitors, your company get the first sign of customer confidence and loyalty.</li><li><strong>The Cult of Amazement</strong>: At this point your customer becomes <em>evangelist</em>, they feel ownership of your company, their expectation is high and they have high confidence on your business which lead to <strong>loyalty</strong>.</li></ol><p><em>This cults also applies inside your company, the stronger the culture is the better your employees can help you to achieve the next level</em></p><h4>The Three Forces</h4><p>There are three forces that can help you achieve <em>The Cult of Amazement</em>:</p><ol><li>The Force of One</li><li>The Force Within</li><li>The Force of Many</li></ol><h4>The Force of One</h4><p>This is applied when you are a sole entrepreneur, you personally exemplify the cult of amazement with your relationship with your customer, you don’t just satisfy your customer but go above and beyond to fulfill the needs that they don’t even know they had.</p><h4>The Force Within</h4><p>This is applied when you belong inside a large enterprise, you as an individual or group of individuals elevate your company to the next level, when a customer gets in contact with you (or the group) that amazing experience percolates to the company as a whole.</p><h4>The Force of Many</h4><p>This means that everyone in the company works inside the <em>The Cult of Amazement</em>, everywhere you see looks like the entire experience is tailor for you, no detail is left to chance and seems as an amazing experience as a whole, like Apple or Disney Parks.</p><h4>The Five Cults</h4><h4>The Cult Of Uncertainty</h4><blockquote>No upward motion, remaining at the root of uncertainty is inconsistency.</blockquote><p>This is the lowest stage and is static, there is no motion of moving upwards to the other cults, and the movement that it has it’s eroded with inconsistency, this is a place for complacency and is ignorant to the problems that exist with the customers or employees.</p><p>If you operate in this cult the customers do not know what kind of service they are going to receive and expect the worse.</p><p>Signs that you are operating in this cult are:</p><ul><li>Service is inconsistent</li><li>Customer retention is not where it should be</li><li>There is little or no celebration of success.</li><li>Performance reviews are inconsistent.</li><li>Employees have little to no authority to act independently to help the customer</li><li>The company is operation-focused instead of customer-focused</li></ul><h4>The Cult Of Alignment</h4><blockquote>The beginning of the ascent to amusement; moving upward to transform ALIGNMENT into EXPERIENCE.</blockquote><p>Once you got out of the cult of uncertainty, you can begin your journey to the cult of amazement.</p><p>Before you were in a static position but at this stage, you already got the ball rolling, at this point you and your employees should know that is the message that the company is trying to convey and start moving in that direction.</p><p><em>A big part of this alignment comes from training, hiring right, and consistent processes.</em></p><p>You should create the right mantra that your employees can relate to and also guides the experience that your customers can expect to receive.</p><p>Examples of great mantras:</p><ul><li>The Ritz-Carlton: <em>Ladies and gentlemen serving ladies and gentlemen</em></li><li>Outback Steakhouse: <em>No rules</em> and <em>Just Right!</em></li><li>Volkswagen: <em>Out of love for the Automobile</em></li><li>Avis Car Rental’s: <em>We Try Harder</em></li><li>The Beatles: <em>Bigger than Elvis!</em></li></ul><p>The right mantra marks the beginning of the journey of amazement, this will be your north on the compass and it will guide the direction you want to go.</p><p>You know you are in this cult when the members of the company committed to improving the experience for the employees and the customers, when they are being more customer-focused rather than operation-focused, where both employees and customers know where the company is supposed to be going.</p><h4>The Cult Of Experience</h4><blockquote>Moving upward to transform positive interactions into consistent and predictable EXPERIENCES that eventually turn into OWNERSHIP.</blockquote><p>This cult is marked by the actions that support the mantra that you build in the cult of alignment, at this stage the positive experiences are becoming more than one-time events, they start to repeat themselves, and they are becoming more consistent and predictable.</p><p>The customers instead of hoping for a good experience, start to expect it to happen, but this doesn’t mean that everything is perfect, the problems look to be more likely to be resolved to the customer’s satisfaction than in the realm of uncertainty.</p><p>The reason for this is because the training is better, the tools are better and the employees understand what the brand promise is (the mantra), and are more qualified to support the focus on the customer.</p><p>Signs that you are in the cult of experience:</p><ul><li>Create an experience that relates to the company mission</li><li>You are starting to feel empowered</li><li>Have been recognized by a customer or another employee for your good work</li><li>Receive feedback for trying to do the right thing.</li><li>Your customers have begun the process of expecting more from you or at least expecting more of the same</li></ul><h4>The Cult Of Ownership</h4><blockquote>Moving upward to transform predictable and consistent positive — and sometimes amazing — experiences into a culture of consistent AMAZEMENT.</blockquote><p>The hallmark of this cult is the sense of belonging that arise from the predictable experiences in the cult of experience, as a customer you have a feeling of <em>predictability</em>. You achieve this feeling because of a series of positive experiences.</p><p>The sense of being in the right place, that knowing what to expect next and like the idea ahead of time is the goal of the cult of ownership, the company or the brand is not something alien to you, you start feeling a sense of proud, of belonging, like you are a piece of something greater than yourself.</p><p>These are some signs that you are in a the cult of ownership:</p><ul><li>String levels of employee engagement as the norm in the organization.</li><li>Formal internal <em>processes</em> that empower the employees to fix problems</li><li>Higher-than-average retention numbers among the frontlines employees.</li><li>Deep concern at all levels of the organization for the quality of the customer experience.</li></ul><h4>The Cult Of Amazement</h4><blockquote>At the top, yet always moving upwards to determine new and better ways to solidify and expand relationships with EVANGELISTS.</blockquote><p>This cult is marked by the sense of loyalty and belonging, but also a strong desire to <em>recruit others</em> into the community, either as an employee or as a customer.</p><p>When you are working on this cult, you are more likely to be forgiven if you make a mistake, because your customer knows that they can trust you to solve the problem, this also works as an insurance in case the company make a mistake.</p><p>You don’t need to be a cheap option to operate in this cult, actually most of the organizations that operates at this level have a higher price tag that the competition, now you can’t go overboard because there is always a breaking point.</p><p>Example of organization that operates at this level are:</p><ul><li>Disney</li><li>Apple</li><li><a href="https://www.tonysstlouis.com/">Tony’s</a></li></ul><p>This are some signs that you are working from the cult of amazement:</p><ul><li>Your customers act as evangelists for the organization</li><li>Your employees act as evangelists for the organization</li><li>Your organization exceeds people’s expectation in its own unique way</li><li>Your real competition is yourself</li></ul><h4>Touch Points</h4><p>Each and every time you interact with a customer you have the opportunity to make an impression that can make or break the customer relationship.</p><p>This can be face-to-face, conversations over the phone, or internet interactions.</p><p>Examples of touch points for an airline passenger journey:</p><ul><li>Making a reservation</li><li>Checking in a ticket counter</li><li>Boarding the plane</li><li>Being greeted at the destination</li><li>Picking up bags at the baggage claim area</li></ul><p><strong>Touch-points</strong> are a change of events that the customer experience with each item in the list being a link in the chain, every organization has touch points.</p><h4>Impact Points</h4><p>This are all the events that happens behind the scenes, the customers do not see the impact points, or they don’t even know they exist, this impact them nonetheless.</p><p>If touch points are the items in the chain, the impact points are the links between those items, think about the operation behind the scenes that handles the baggage claim, the logistic of the airport once you drop your bags, this kind of interaction do not touch the customer directly but they do affect the overall experience.</p><p>You could say that if the customer becomes aware of this impact points, it means that there is a problem with the service, because the only way that the customer become aware of them is when a problem happens, for example if you order food and it takes a long time, the customer becomes aware that the personal in the kitchen is taking a long time, but if the meal is prepare quickly, the customer doesn’t even became aware of the working staff.</p><h4>Human Resources Strategies to build a customer-focus organization</h4><ol><li>Hire right, and make sure you have the right person for the job.</li><li>Train Constantly.</li><li>Recognized individual success</li><li>Celebrate team Success</li><li>Treat your employees the way you want your customers to be treated.</li></ol><h4>Exercises that help to start an amazement revolution</h4><ol><li>Identify every touch point that the company has with the customers.</li><li>Identify which touch points have the strongest opportunity to turn a one-time customer into a repeat customer</li><li>Look for the weakest link in the chain, and figure out a way to strengthen them</li><li>Recognize all the behind-the-scenes impact points that support those touch-points</li><li>Identify the weak link in the chain of touch points, those which, if failed, would cause a breakdown in the process or system.</li><li>Document this list and review them at least once a month with everyone in the organization. If something could be improved, improve it.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8ec6324713a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Conventional Commits]]></title>
            <link>https://medium.com/@jjzcru/conventional-commits-48ba41ea4530?source=rss-144c52945621------2</link>
            <guid isPermaLink="false">https://medium.com/p/48ba41ea4530</guid>
            <category><![CDATA[conventional-commits]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Jose J. Cruz]]></dc:creator>
            <pubDate>Sat, 10 Dec 2022 18:01:43 GMT</pubDate>
            <atom:updated>2022-12-10T18:01:43.477Z</atom:updated>
            <content:encoded><![CDATA[<h3>Automate release with Conventional Commits</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8iHRom1w9O5fmYOo0U0JbQ.jpeg" /><figcaption><strong>Convent</strong>ional Commits</figcaption></figure><p>When we are working with git we need to create commits which are checkpoints for our code as describe in Git in a Nutshell, commits require a message to know which particular changes were performed at that point in time.</p><p><a href="https://www.conventionalcommits.org/en/v1.0.0/#specification">Conventional Commits</a> is a specification on how to craft our commit messages.</p><p>This specification a simple and easy set of rules for creating an explicit commit history, by following this convention it makes it easy to build automated tool on top of it.</p><h4>Structure</h4><p>The commit message structure follow something like this</p><pre>&lt;type&gt;[optional scope][optional !]: &lt;description&gt;<br><br>[optional body]<br><br>[optional footer(s)]</pre><p>This structure container this structural elements to express the intent of each commit.</p><ol><li><strong>types</strong>: This element is one of the the available types that explain to which category the commit belongs to and is also <strong>REQUIRED</strong>, the types can be:</li></ol><ul><li><strong>feat</strong>: Commit adds a new feature to your application or library.</li><li><strong>build</strong>: Changes that affect the build system or external dependencies</li><li><strong>fix</strong>: Commit represents a bug fix for your application.</li><li><strong>ci</strong>: Changes to our CI configuration files and scripts</li><li><strong>docs</strong>: Commit that are only related to documentation changes</li><li><strong>style</strong>: Commit changes that do not affect the meaning of the code but rather code format convention like white-space, format, missing colons, etc.</li><li><strong>refactor</strong>: Commit that do not fix a bug nor add a feature.</li><li><strong>perf</strong>: Commit change that improves the performance of the program</li><li><strong>test</strong>: Commits related to missing test or correct existing ones.</li><li><strong>chore</strong>: Other changes that don’t modify source code or test files</li></ul><p><strong>2. scope</strong>: This is an optional element that provides a contextual information about the commit, the scope is wrapped in parenthesis. E.g. feat(i18n)</p><p><strong>3. !</strong> : This symbol is optional and indicates a breaking change</p><p><strong>4. description</strong>: This element is <strong>REQUIRED</strong> and describes what happens in the commit, this is the short version of the commit.</p><p><strong>5. body</strong>: This is an optional element that provides a further explanation on what happens in the commit.</p><p><strong>6. footer(s)</strong>: This is an optional element, unless is a BREAKING CHANGE, where you describe what is the breaking change that was introduced.</p><blockquote>The <a href="https://www.conventionalcommits.org/en/v1.0.0/#specification">Full Specification</a> describes all the rules regarding Conventional Commit</blockquote><h4>Benefits</h4><ul><li>Automatically generate <a href="https://keepachangelog.com/en/1.0.0/">CHANGELOGs</a></li><li>Easily determine the semantic version bump</li><li>Easy transfer of knowledge to coworkers, public or stakeholders</li><li>Can be use to run CI/CD</li><li>Makes it easier to contribute to a project by giving potential contributors a change to explore a more structure commit history</li><li>Remove the overhead of thinking what to write in a commit message since they have a format to rely on</li><li>Help developer to focus the work that they are about to perform because they need to think about the commit message before they start working, it also provides them the space to know when to commit once they achieve the goal of the commit.</li></ul><h4>Best practices</h4><ul><li>✅ Use a consistent case for the commit messages</li><li>✅ Introduce this convention at the starting phase of a project, thinking about it as its already launched</li><li>✅ Perform multiple commits with each one with one single goal in mind instead of a big commit with different type of changes</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=48ba41ea4530" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gitflow Workflow]]></title>
            <link>https://medium.com/@jjzcru/gitflow-workflow-a75985277fb8?source=rss-144c52945621------2</link>
            <guid isPermaLink="false">https://medium.com/p/a75985277fb8</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[gitflow]]></category>
            <dc:creator><![CDATA[Jose J. Cruz]]></dc:creator>
            <pubDate>Fri, 09 Dec 2022 16:02:13 GMT</pubDate>
            <atom:updated>2022-12-09T16:02:13.408Z</atom:updated>
            <content:encoded><![CDATA[<h3>Achieve Flow with Git</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*exfBUMUaUxhMqxSqTJ6dDA.jpeg" /></figure><p>Gitflow is a git branching model that involves using a set of features, helper and multiple primary branches to develop software. It was introduced by <a href="http://nvie.com/posts/a-successful-git-branching-model/">Vincent Driessen at Nvie</a>.</p><p>The main concept is that you have two main long lived branches called develop and main that are parallel to each other and used other helper branches like feature, hotfix and release branches to merge changes from one to the other.</p><figure><img alt="Gitflow Workflow" src="https://cdn-images-1.medium.com/proxy/1*mFhHvVH83vvXxMKJtPQK1A.png" /><figcaption>Gitflow Workflow</figcaption></figure><p>This parallel branches coincide with their respective development environments.</p><p>Gitflow has an <a href="https://github.com/nvie/gitflow">extension</a> that introduces commands to make it easier to maintain a gitflow workflow.</p><h4>Main</h4><figure><img alt="Main Branch" src="https://cdn-images-1.medium.com/proxy/1*Df68hdn3-_kB5AgTZGugFA.png" /><figcaption>Main Branch</figcaption></figure><p>Is a long lived branch that stores the official release history of the repository, this branch is used in the production environment and is the most stable of the branches.</p><p>It’s convenient to tag all the commits that belongs to the main branch with a version number</p><blockquote>Never commit directly to the main branch</blockquote><h4>Develop</h4><p>This branch is were all the development work is performed, is the <a href="https://www.investopedia.com/terms/w/workinprogress.asp">WIP</a> for the project, it servers as the integration branch for the features.</p><p>This branch has all the history of the project which differentiates from the main branch that only contains the releases.</p><h4>Feature branches</h4><figure><img alt="Feature Branch" src="https://cdn-images-1.medium.com/proxy/1*LaEqu1wcx-atzLiQRWCYgg.png" /><figcaption>Feature Branch</figcaption></figure><p>When you are developing, each new feature should reside in its own branch, which you can publish to a remote repository for collaboration.</p><p>This branch does not branch off from main, but instead, it branches off from develop as their parent branch and once the feature is completed it gets merged back into develop.</p><blockquote>Feature branches <strong>NEVER</strong> interact with main</blockquote><h4>Release branches</h4><figure><img alt="Release Branch" src="https://cdn-images-1.medium.com/proxy/1*OzJe9xVeTRy1C-RWlONUfA.png" /><figcaption>Release Branch</figcaption></figure><p>Once that develop reach a stage that has enough feature that justifies a release, or the release date reaches, you need to merge these changes to main.</p><p>To do this you need to create a branch to start the release cycle, this is Release branches, at this point in time no new features are going to be introduced, you focus mostly on bug fixes, documentation, or any other task that are related to the release.</p><blockquote>These branches could be attached to a staging environment for further manual testing or QA</blockquote><p>Once the release branch is ready to ship it gets merged to main and tagged with a version number. It also needs to be merged back to develop because some progress could be made since the release was initiated.</p><p>Working in this way provides flexibility for the team because the rest of the team could start working on the feature for the next release while the current release is being worked on.</p><h4>Hotfix branches</h4><figure><img alt="Hotfix Branch" src="https://cdn-images-1.medium.com/proxy/1*CERPbmVgcAcZ-mTI157uUA.png" /><figcaption>Hotfix Branch</figcaption></figure><p>When you have a bug or issue in the production system and you need to be able to patch you, you create branches to fix these issues, these branches are `Hotfix branches.</p><p>They are a lot like <a href="#release-branches">Release Branches</a> but instead of branching off from develop this one branch off from main.</p><blockquote>This is the only kind of branch that should branch off directly from main</blockquote><p>As soon as the bug or issue is fixed it should be merged back to main and develop and main should also be tagged to update the version number.</p><p>You can think of this branch as ad hoc release that works directly on main</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a75985277fb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git in a Nutshell]]></title>
            <link>https://medium.com/@jjzcru/git-in-a-nutshell-b82cc4af5c32?source=rss-144c52945621------2</link>
            <guid isPermaLink="false">https://medium.com/p/b82cc4af5c32</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Jose J. Cruz]]></dc:creator>
            <pubDate>Thu, 08 Dec 2022 17:45:48 GMT</pubDate>
            <atom:updated>2022-12-09T01:33:07.227Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*wMKX0U0wkehkwKjYy4ZXZg.jpeg" /></figure><p><a href="https://git-scm.com/">git</a> is a distributed version-control system that track changes in computer files and coordinate that work among multiple people.</p><p>You do not required to store all the files in a central store, you have clones of the copy of the repository and has the entire history of the project in those clones.</p><p>You can self-host a server to store the code and it’s metadata like:</p><ul><li><a href="https://about.gitlab.com/install/?version=ce">Gitlab CE</a></li><li><a href="https://gitea.io/en-us/">Gitea</a></li><li><a href="https://gitbucket.github.io/">GitBucket</a></li><li><a href="https://gogs.io/">Gogs</a></li></ul><p>Or use third-party service like:</p><ul><li><a href="https://github.com/">GitHub</a></li><li><a href="https://bitbucket.org/">Bitbucket</a></li><li><a href="https://about.gitlab.com/">Gitlab</a></li></ul><h4>Workflow</h4><figure><img alt="Git Workflow" src="https://cdn-images-1.medium.com/max/901/1*h060LH_t0Hbd9EJF_zZtjA.png" /><figcaption>Git Workflow</figcaption></figure><p>When you are working with git you are working with four fundamental elements: Working Directory, Staging Area, Local Repository and Remote Repository.</p><p>You can modify, alter or group changes and files with different command that are related to the different stages.</p><h4>Working Directory</h4><p>When you are working on a git project, in the root of the project you have a hidden directory called .git which stores the metadata of all the changes that were perform to that particular repository and also contains the data of the current state of the files.</p><blockquote>Database of changes. It contains all the edits and historical versions (snapshots) of the project.<a href="#fn1-25906">1</a></blockquote><p>When you have a file in your working directory if could have three possible states:</p><ul><li><strong>Staged</strong>: This means that the files with updated changes are marked to be committed to your local repository but are not yet committed.</li><li><strong>Modified</strong>: This means that the files that have updated changes are not yet stored in the local repository.</li><li><strong>Committed</strong>: This means that the changes that were made are store safely in the local repository.</li></ul><p>If you need to move a file to the Staging Area you need to perform a git add to the files that you which to add.</p><h4>Staging Area</h4><p>This is the middle ground between what you have done to your file, <a href="#working-directory">Working Directory</a>, and the last thing you have committed, <a href="https://initialcommit.com/blog/what-is-git-head">HEAD commit</a>.</p><p>This lets you prepare what would be the next <a href="https://www.atlassian.com/git/tutorials/saving-changes/git-commit">commit</a> and also give you the tools to easily know what is going on.</p><blockquote>Commits can be thought of as snapshots or milestones along the timeline of a Git project.<a href="#fn2-25906">2</a></blockquote><p>This tooling adds more complexity but it also adds flexibility to craft better commits, since you can modify and stage several times before you create a commit.</p><h4>Local Repository</h4><p>Once you finish adding and modifying the files in the staging area you create a commit, which is like a save point in a video game.</p><p>The local repository stores this changes in the .git directory, which stores all the checkpoints and commits.</p><p>A commit simply implies that you want to take a checkpoint of all the changes that have occurred up to this point since the last commit (HEAD commit) as comparison, once you commit the staging area will be empty.</p><h4>Remote Repository</h4><p>All the previous stages are enough if you want to keep track of those changes only to you and your machine, but software is created in conjunction with other people and for that we need a place that everyone has access that would enable developers to collaborate, this is where a Remote Repository comes in.</p><p>Remember that git is a <strong>distributed</strong> version-control system, so you can have a git repository locally and you can synchronize it another git repository that is in a remote location, this particular location is called origin.</p><p>You could have a local repository that targets multiple origin, this is where the distributed nature of git comes into play.</p><p>When you have a group a commits in your local repository and would like to <em>publish</em> those changes to a remote repository you perform a git push.</p><p><em>Since the remote repository can be access by other people, how do I get the changes that were perform by other people on my team?</em></p><p>When you need to synchronised the remote repository to your local repository you perform a git pull to get those changes and add them to your git history.</p><h4>Glossary</h4><h4>Branch</h4><p>When you are working on a git project your changes live inside a <em>timeline</em> which is composed of a group of commits, this timeline is called a branch.</p><p>The same way when you have series that develops along multiple characters and each character has their own story line, think of <a href="https://en.wikipedia.org/wiki/Money_Heist">Money Heist</a> or <a href="https://en.wikipedia.org/wiki/The_Playlist_(TV_series)">The Playlist</a>, the same thing happens while developing software, you create different timelines for different sections of the code, this could be arbitrary like creating different branches for different feature or different branches for each developer.</p><p>The same way that happens with the tv series, even tough the different branches are created from a particular point in time and keep going on their own, those timelines eventually converge into the main story line, and the same happens with the software where eventually they converged into a branch and bring with them all the changes that happens to them while their were independent which is called a <a href="https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging">Merge branch</a>.</p><h4>Forking</h4><p>This is not a command in git, but more like a concept, if we think of branches like independent stories that eventually converge into the main story line, a fork is a like that story line didn’t converge and went rogue to create it’s own spin-off. <em>Like </em><a href="https://en.wikipedia.org/wiki/Pearson_(TV_series)"><em>Pearson</em></a><em> with </em><a href="https://en.wikipedia.org/wiki/Suits_(American_TV_series)"><em>Suits</em></a></p><p>In a fork you start a new project from a specific point in time from the codebase and then run it independently from that project, one example of this would be <a href="https://mariadb.org/">MariaDB</a> is a fork of <a href="https://mariadb.org/">MySQL</a>.</p><h4>HEAD</h4><p>This refers to the latest commit in a particular branch, and when you add a new commit the different are performed against this commit, and once a commit is perform the latest commit will become the new HEAD.</p><p>Following the series analogy, the latest episode of a series would be the HEAD in a branch.</p><h4>Hook</h4><p>This are scripts that run automatically every time a particular event occurs in a git repository.<a href="#fn3-25906">3</a></p><p>This allows you to customized git internal behavior and trigger customizable actions in different key points in the development lifecycle.</p><p>Use case for git hooks could be preventing unwanted behavior or enforce quality control before committing, like <a href="https://en.wikipedia.org/wiki/Lint_%28software%29">lint</a>, testing or enforce code conventions.</p><h4>Main</h4><p>This refers to the default branch that is used to keep track of the software, you could think of it like the base story line in a series.</p><p>This branch doesn’t have to be called main, it could use any name but is usually the convention to call the default branch either main or master (not used as frequently because <a href="https://www.theserverside.com/feature/Why-GitHub-renamed-its-master-branch-to-main">Cultural sensitivity</a>).</p><h4>Pull Request</h4><p>When you are working with a remote directory, you usually want to develop changes in your local repo and then push those changes to a remote branch.</p><p>When you are working with a distributed system that uses a centralized point, and you would like to add those changes to this centralized point you make a Pull Request</p><p>Which basically means that you ask the maintainer/s of the project to merge the changes that you have into the project branch.</p><h4>Repository</h4><p>Collection of commits, branches and tags to identify commits.</p><h4>Tag</h4><p>When you are working on a git project you have a series of commits, commits are a changes that were applied to files inside the source code.</p><p>Tags are a way to choose a particular commit and mark a particular reference about them, for example you want to use to tag different release versions of the source code so it’s easier to navigate in the future, instead of going throw all the commits and guess which one has the change that you are looking for.</p><h4>Version Control</h4><p>This is a system that records changes to a file or set of files over time, and can recall specific versions of that system later in time.</p><h4>Working Tree</h4><p>This is the directory, and the files and directory inside, that are associated with a <a href="#repository">Repository</a>.</p><p>This basically described all the files in the project that can be handled by git.</p><ol><li>‘Version Control Systems’, <em>Geeks For Geeks</em>, June 29, 2022, <a href="https://www.geeksforgeeks.org/version-control-systems/">https://www.geeksforgeeks.org/version-control-systems/</a> <a href="#fnr1-25906">↩︎</a></li><li>‘Git commit’, <em>Bitbucket</em>, 2022, <a href="https://www.atlassian.com/git/tutorials/saving-changes/git-commit">https://www.atlassian.com/git/tutorials/saving-changes/git-commit</a> <a href="#fnr2-25906">↩︎</a></li><li>‘Git Hooks’, <em>Bitbucket</em>, 2022, <a href="https://www.atlassian.com/git/tutorials/git-hooks?section=conceptual-overview">https://www.atlassian.com/git/tutorials/git-hooks?section=conceptual-overview</a> <a href="#fnr3-25906">↩︎</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b82cc4af5c32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Design Patterns]]></title>
            <link>https://medium.com/@jjzcru/design-patterns-7923c9e46198?source=rss-144c52945621------2</link>
            <guid isPermaLink="false">https://medium.com/p/7923c9e46198</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Jose J. Cruz]]></dc:creator>
            <pubDate>Sat, 03 Dec 2022 20:19:48 GMT</pubDate>
            <atom:updated>2022-12-03T20:55:16.193Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*PMW0_YOuCnmo11RsXwFCTg.jpeg" /></figure><p>When we are developing software architecture we sometimes face software decisions that end-up making our code fragile, couple and difficult to change over time, design patterns allows us a way to structure our code in a way that makes it easy to change in the future.</p><p>This kinds of patters have different types depending on their use case:</p><ul><li>Creational Patterns</li><li>Structural Patterns</li><li>Behavioral Patterns</li></ul><h4>Creational Design Patterns</h4><p>Creational Design Patterns are patterns that provide multiple object creation mechanisms, they achieve this by abstracting the instantiation process.</p><p>This enables systems to be flexible and independent on how the objects are created, composed, or represented, they become important in a system evolution where the systems rely more on object composition than inheritance, because the approach stops relying on a hard-code fix behavior, instead it focuses on the fundamental behavior that can be composed to create more complex one. <a href="#fn1-27455">1</a></p><h4>Factory Method</h4><p>This is a design pattern that provides an interface to create an object in a superclass, but enable subclasses to modify the type of objects that will be created.</p><p>It separates the process of creating an object from the code that depends on the interface of the object. <a href="#fn2-27455">2</a></p><p><strong>Explanation</strong></p><p>When an application requires that you behave in a particular way to perform a task, the concrete implementation is identified by some parameter.</p><p>Instead of using conditionals to determine the specific concrete type, you delegate that decision to a separate component that creates said object (Factory).</p><p>Using the pattern adds flexibility and scalability to the code because it easily enables to add of more concrete behaviors over time without the need to change the code, conforming with OCP.</p><p><strong>Structure</strong></p><figure><img alt="Factory Method UML Diagram" src="https://cdn-images-1.medium.com/proxy/1*ML17Neafv4ru5y2xfDAOig.png" /><figcaption>Factory Method UML Diagram</figcaption></figure><ul><li><strong>Truck</strong>: Is the interface that is common by all the objects that are generated by the Creator and its subclasses</li><li><strong>Concrete truck</strong>: Is the specific implementation of the interface</li><li><strong>Creator</strong>: Is the entry point for the factory method, and returns a Truck object, this is only an abstraction the actual creation doesn’t happens in this class, this could be treated as a base class for a default behavior or an abstract class to force the Concrete Creators to implement the logic.</li><li><strong>Concrete Creators</strong>: Override the factory method to return a different type of Truck.</li></ul><p><strong>When to use</strong></p><ul><li>When you don’t know beforehand how many types or dependencies your code rely on.</li><li>When you want to provide users of your library or framework a way to extend it’s internal components.</li><li>When you need to save system resources by reusing objects instead of rebuilding them each time.</li></ul><h4>Builder</h4><p>Is a design pattern that lets you construct complex objects step by step, it allows you to create different types and representations of an object using the same construction code.</p><p><strong>Explanation</strong></p><p>When you are building an object that could have different parameters and permutations you could potentially create subclasses to specify the behavior and structure of an object, but this would be harder the maintain.</p><p>Another approach would be to use a giant constructor in the base class with all the possible parameters to control the object, the issue with this, is that you end up doing a lot of refactoring once a new requirement gets introduced, and also makes the constructor call pretty ugly since in most cases most of the parameters are not used.</p><blockquote>A simple constructor has a very small number of parameters, and all parameters are primitives or enums. Such simple constructors increase usability. <a href="#fn3-27455">3</a></blockquote><p>The Builder patterns suggest that we need to extract the object construction of the code out of its own class and move it into separate objects called builders.</p><p>This builder provides a set of functions that enables you to specify the values that are required by the final object and has a function called build that starts the building process and returns the required object.</p><p>You can find an example of the Builder pattern in Java Calendar Object.</p><pre>Calendar cal = new Calendar.Builder()<br>                     .setCalendarType(&quot;japanese&quot;)<br>                     .setFields(YEAR, 1, DAY_OF_YEAR, 1)<br>                     .build();</pre><p><strong>Structure</strong></p><figure><img alt="Builder UML Diagram" src="https://cdn-images-1.medium.com/proxy/1*GLdyuwYh6mvmorVNOSyUWg.png" /><figcaption>Builder UML Diagram</figcaption></figure><ul><li><strong>Builder</strong>: It’s an interface that declares all the available steps that are common across all the different types of builders.</li><li><strong>Concrete Builders</strong>: Provides an implementation of different construction steps.</li><li><strong>Products</strong>: These are the end result objects which are produced by different builders.</li><li><strong>Director</strong>: It’s the coordinator of the builders, it provides the order of the construction steps and can create and reuse specific configurations of products.</li><li><strong>Client</strong>: It must associate a builder object with a director, usually done once via the director constructor but depending on the use case it could have multiple builders for different steps or complex data structures.</li></ul><p><strong>When to use</strong></p><ul><li>You require a lot of parameters or steps to create an object</li><li>You want to create a different representation of some object</li><li>When you need to construct a <a href="https://refactoring.guru/design-patterns/composite">Composite Tree</a> or other complex data structures</li></ul><h4>Structural Design Patterns</h4><p>These kinds of patterns explain how we can assemble objects and classes into larger structures, while still keeping these structures flexible and efficient.</p><h4>Adapter</h4><p>It’s a structural design pattern that allows objects with incompatible interfaces to collaborate.</p><p><strong>Explanation</strong></p><p>Sometimes we have data types that are incompatible with one another, for example, we could have users purchase activity as XML files, we found a third-party service that is able to give us a recommendation model for the users but this service uses JSON format as the input data.</p><p>We use the adapter pattern to create an interface that translates the content from XML to JSON objects that can then be used by the recommendation engine.</p><p>Besides transforming from different data formats we can also use it to create objects with different interfaces to collaborate.</p><p><strong>Structure</strong></p><figure><img alt="Adapter UML Diagram" src="https://cdn-images-1.medium.com/proxy/1*MCvxLJJuq0-n_l76wJKFhQ.png" /><figcaption>Adapter UML Diagram</figcaption></figure><ul><li><strong>Client</strong>: This is a class that contains the business logic of the program.</li><li><strong>Client Interface</strong>: Describes the protocol that the other classes need to follow to interact with the client code.</li><li><strong>Service</strong>: This is the class that requires the data to be transformed, the Client can use the service directly because of the compatibility.</li><li><strong>Adapter</strong>: Is the class that can work with both the client and the service, and implements the Client Interface while wrapping the service object. The adapter receives calls from the client via the adapter interface and translates those requests to the service in a format that it can understand.</li></ul><p><strong>When to use</strong></p><ul><li>When you have an existing class but this class isn’t compatible with the rest of the codebase.</li><li>When you want to reuse existing subclasses that lack common functionality that can be abstracted into a superclass.</li></ul><h4>Façade</h4><p>Is a structural design pattern that simplifies the interface to a library, a framework, or any complex set of classes.</p><p><strong>Explanation</strong></p><p>When we need to rely on frameworks or specific libraries, we need to initialize, configure and keep track of dependencies and execute the method in the correct order.</p><p>In the end, the logic of the application gets tightly coupled with the implementation of this third-party library, which makes it hard to maintain and comprehend, to avoid this we create a simple interface that provides the functionality that we really cared about instead of worrying about the underlying implementation.</p><p>This limits the functionalities provided by the library but enhances the functionality that our business really required and also decouples the program from that library.</p><p><strong>Structure</strong></p><figure><img alt="Façade UML Diagram" src="https://cdn-images-1.medium.com/proxy/1*uYYrapuq-5WO2H9wNAdHCQ.png" /><figcaption>Façade UML Diagram</figcaption></figure><ul><li><strong>Client</strong>: Uses the Façades instead of calling the subsystems objects directly</li><li><strong>Façade</strong>: It provides convenient access to a particular part of the subsystem functionality</li><li><strong>Additional Façade</strong>: These façades can also be created to prevent polluting a single façade with an unrelated feature that would make it another complex structure, this façade can be used by the client or another façade.</li><li><strong>Complex Subsystem</strong>: It could be various objects that interact in complex ways, third-party libraries, frameworks, ORM. These subsystems are unaware of the existence of the Façades.</li></ul><p><strong>When to use</strong></p><ul><li>When you need a simple interface to interact with a complex subsystem</li><li>When you want to structure the subsystem into layers</li><li>When you want to decouple a library or framework from the business logic</li></ul><h4>Behavioral Design Patterns</h4><p>Behavioral patterns are concerned with algorithms and the assignment of responsibilities between objects.</p><h4>Iterator</h4><p>It’s a behavioral pattern that lets you traverse elements of a collection without exposing the underlying representation.</p><p><strong>Explanation</strong></p><p>When we are working with objects that are related on another this are express in terms of a <a href="https://en.wikipedia.org/wiki/Collection_(abstract_data_type)">Collection</a>, but this are generic by default, iterate over a collection is quite easy if it’s in the form of a list, but how about more complex structure like a tree, we need to define a way on how to navigate or traverse this structure.</p><p>We would need to couple the traversal within the data structure and create different implementation for each one, but the main reason for collection is a storage of the data, to fix this we decouple the traversal of the data structure into an iterator.</p><p>We could have a <a href="https://www.geeksforgeeks.org/depth-first-search-or-dfs-for-a-graph/">Depth-first Iterator</a> or a <a href="https://www.geeksforgeeks.org/breadth-first-search-or-bfs-for-a-graph/">Breadth-first Iterator</a> that handles different types of traversal but the underlying data structure (the <a href="https://www.javatpoint.com/tree">Tree</a> ) is still the same.</p><p><strong>Structure</strong></p><figure><img alt="Iterator UML Diagram" src="https://cdn-images-1.medium.com/proxy/1*gcDvmw_SgfSUnPEp03KuCQ.png" /><figcaption>Iterator UML Diagram</figcaption></figure><ul><li><strong>Iterator</strong>: This interface declares the operations (fetch next element, get current position, restart iteration, etc) that are required to traverse a collection.</li><li><strong>Concrete Iterators</strong>: Implements the specific algorithm for traversing the collection.</li><li><strong>Collection</strong>: This interface declares one or multiple methods for getting iterators compatible with the collection.</li><li><strong>Concrete Collections</strong>: Return new instances of a particular iterator class each time the client requests one.</li><li><strong>Client</strong>: Work with the collections and the iterators via their interfaces.</li></ul><p><strong>When to use</strong></p><ul><li>When you have a complex data structure but want to hide the complexity from clients</li><li>Reduce the duplication of traversal code across the app</li><li>When you need your code to traverse different data structures or if you don’t know the structure beforehand</li></ul><h4>Observer</h4><p>This behavioral design pattern defines a subscription mechanism to notify multiple objects that events are happening to the object that they are observing.</p><p><strong>Explanation</strong></p><p>This pattern is an implementation of the <a href="https://ably.com/topic/pub-sub">Publish-Subscribe Pattern</a> at the code level, when you have an object that wants to be notified (subscriber) when another object changes its state (publisher), the first object creates a subscription that the second object is going to notify when a particular change happens.</p><p>The reason for this is to avoid asking the target object all the time if its state has changed, we can invert the logic and let the target object notify all the objects that are interested in its state, when these changes happened, and what is the new state.</p><p>The <em>target object</em> is called a Publisher and the interesting object is the Subscriber, you can have multiple Subscribers follow a single Publisher. The publisher keeps track of all the Subscribers and lets them know when a state changes, Subscribers can also request to be removed from the Subscriber list.</p><p>One real-life implementation for this would be an <a href="https://www.campaignmonitor.com/resources/knowledge-base/what-is-an-email-newsletter/">Email Newsletter</a>, in this analogy we the users are the Subscribers and the Newsletter would be the Publisher, as users we request to be added to the Newsletter and at the same time, we can request to be unsubscribed from that Newsletter when we no longer have any interested in them.</p><p><strong>Structure</strong></p><figure><img alt="Observer UML Diagram" src="https://cdn-images-1.medium.com/proxy/1*TLcZrZaztXAEFn0ekIUdwA.png" /><figcaption>Observer UML Diagram</figcaption></figure><ul><li><strong>Publisher</strong>: It creates events that are interesting to the other objects, this happens when an event happens or when the object performs some behavior. They contain a subscription infrastructure that let new subscribers join and current subscribers leave the list</li><li><strong>Subscriber</strong>: Interface that declares the notification interface. Usually consists of a method that has several parameters that let the publisher pass some events along with the update.</li></ul><blockquote>When a new event happens the Publisher goes through the list of Subscribers and calls the notification method in the subscriber interface to let them know that a change happened</blockquote><p><strong>When to use</strong></p><ul><li>When you need an object to change when the state of another object changes</li><li>When you need to observe some objects for a limited time or specific cases</li></ul><ol><li>‘Creational Patterns’, <em>The University of North Carolina at Chapel Hill</em>, <a href="https://www.cs.unc.edu/~stotts/GOF/hires/chap3fso.htm">https://www.cs.unc.edu/~stotts/GOF/hires/chap3fso.htm</a> <a href="#fnr1-27455">↩︎</a></li><li>Isaac Rodriguez, ‘The Factory Method Pattern and Its Implementation in Python’, <em>Real Python</em>, <a href="https://realpython.com/factory-method-python/">https://realpython.com/factory-method-python/</a> <a href="#fnr2-27455">↩︎</a></li><li>‘Constructor Design’, <em>Microsoft</em>, September 9, 2021, <a href="https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/constructor">https://learn.microsoft.com/en-us/dotnet/standard/design-guidelines/constructor</a> <a href="#fnr3-27455">↩︎</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7923c9e46198" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Twelve-Factor App]]></title>
            <link>https://medium.com/@jjzcru/the-twelve-factor-app-3ff3a736147d?source=rss-144c52945621------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ff3a736147d</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[Jose J. Cruz]]></dc:creator>
            <pubDate>Sat, 26 Nov 2022 17:02:00 GMT</pubDate>
            <atom:updated>2022-11-26T17:02:00.927Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*HD7MHPRhRJP2A7zXoKfTmw.jpeg" /></figure><p>This is a methodology on how to build SaaS applications, this best practices enable applications to be built with portability and resilience in mind, specially when deployed to the web.<a href="#fn1-8418">1</a></p><p>This methodology was drafted by developers at <a href="https://www.heroku.com/">Heroku</a>.</p><p>The twelve principles are:</p><ol><li>Codebase</li><li>Dependencies</li><li>Configuration</li><li>Backing Services</li><li>Build, Release, Run</li><li>Processes</li><li>Port Binding</li><li>Concurrency</li><li>Disposability</li><li>Development/production parity</li><li>Logs</li><li>Admin Processes</li></ol><h4>Codebase</h4><blockquote>One codebase tracked in revision control, many deploys</blockquote><p>It states that everything that is related to a particular application, source code, provisioning scripts, configuration settings, and all of those artifacts are available for everyone that wishes to use the application inside the source code repository.</p><p>All of these artifacts are also accessible by the automation scripts that exist in the CI/CD system.</p><p>This system could be a revision control system like <a href="https://subversion.apache.org/">Subversion </a>or a decentralized revision control system like <a href="https://git-scm.com/">Git</a>.</p><p>If you have multiple codebases, that’s not an app, that’s a distributed system, and each component of the distributed system is an app.</p><blockquote>1 codebase = 1 app</blockquote><p>Multiple apps sharing the same code is a violation of this principle, if you want to share code across apps the best approach is to create libraries and share them across a <a href="https://devopedia.org/dependency-manager#:~:text=A%20dependency%20manager%20operates%20at,dependency%20manager%20is%20project%20specific.">Dependency Manager</a>.</p><h4>Dependencies</h4><blockquote>Explicitly declare and isolate dependencies</blockquote><p>This factor describes that only the code that is relevant to the purpose of the application is stored in source control. Other external artifacts like packages, libraries, .jar files, or .NET DLLs should be referenced as dependencies.<a href="#fn2-8418">2</a></p><p>And those should be loaded into memory at development, testing, and production runtimes. You should avoid storing the source code with the artifacts in the source code repository.</p><p>Examples of package managers can be found in different programming languages:</p><ul><li><a href="https://www.npmjs.com/">npm</a> and <a href="https://yarnpkg.com/">yarn</a> for <a href="https://nodejs.org/en/">Node.js</a></li><li><a href="https://pypi.org/project/pip/">pip</a> for <a href="https://www.python.org/">Python</a></li><li><a href="https://maven.apache.org/">Maven</a> and <a href="https://gradle.org/">Gradle</a> for <a href="https://www.java.com/en/">Java</a>.</li></ul><h4>Configuration</h4><blockquote>Store config in the environment</blockquote><p>This principle states that the configuration of an application should be injected at runtime or settings defined in an independent configuration file.</p><p>You can have good defaults in the application that can be overridden but in the general configuration details should be stored outside of the application and be loaded at runtime, this provides flexibility for QA, Operations, CI, and developers to run and test the application if different environment without the need of recompile the application or change the source code.</p><p>Examples of this are docker-compose.yml files or <a href="https://kubernetes.io/">Kubernetes</a> manifest files.</p><h4>Backing Services</h4><blockquote>Treat backing services as attached resources</blockquote><p>This principle establishes that architects/developers should treat external components, databases, email servers, message workers, file systems, and API services, as attached resources.</p><p>Meaning that it shouldn’t be a strict dependency on those services, if for some reason you need to migrate from an Oracle database to a MongoDB the application should not require a big refactor.</p><p>This behavior promotes flexibility, robustness, and efficiency in the SDLC.</p><h4>Build, Release, Run</h4><blockquote>Strictly separate build and run stages</blockquote><p>When you are working on an application it needs to break down into three processes:</p><h4>Build</h4><p>The build stage is usually performed by the <a href="https://aws.amazon.com/devops/continuous-integration/">CI</a> system, it will retrieve the changes that come from the source code repository and built/compiled artifacts, which could be <a href="https://docs.docker.com/engine/reference/commandline/images/">docker images</a>, .jar or .war files, packages or plain binaries, then is going to store those artifacts in an artifact repository like <a href="https://hub.docker.com/">Docker Hub</a>, <a href="https://www.npmjs.com/">npm</a> or <a href="https://search.maven.org/">Maven Registry</a>.</p><h4>Release</h4><p>Once the artifact is uploaded by the <strong>Build</strong> stage, in the release stage the configurations settings are applied to the artifact that is uploaded.</p><p>The <a href="#configuration">Configuration</a> is loaded from the environment.</p><h4>Run</h4><p>At this stage, the runtime is provisioned with the configuration from the release stage and then is run. This could be in the form of a <a href="https://www.docker.com/resources/what-container/#:~:text=A%20Docker%20container%20image%20is,tools%2C%20system%20libraries%20and%20settings">Docker Container</a> or stand-alone processes.</p><h4>Processes</h4><blockquote>Execute the app as one or more stateless processes</blockquote><p>When developing an application we need to think about building it as a stateless process, meaning that we should not rely on the state of the application to be stored in memory.</p><p>The application should not keep track the state of another application, and also should not keep track of information like session or workflow status, this should be outsource to a <a href="#backing-services">Backing Services</a>.</p><p>If we make application stateless are easier to reason about, are easier to scale and also makes them easier to operate independently of one another since we do not need to worry about unintended side effects.</p><h4>Port Binding</h4><blockquote>Export services via port binding</blockquote><p>Applications should be identifiable by their port number and not a domain name, the main reason for this is that domain names and IP addresses can be performed on the fly, either by manual manipulation or <a href="https://www.nginx.com/blog/service-discovery-in-a-microservices-architecture/">Service Discovery</a> systems like <a href="https://istio.io/">Istio</a> or <a href="https://www.consul.io/">Consul</a>.</p><p>Potential issues like port collision are easier to detect and handle by using <a href="https://portforward.com/">Port Forwarding</a>.</p><h4>Concurrency</h4><blockquote>Scale out via the process model]</blockquote><p>This principle recommends organizing processes (Apps) according to their purpose and splitting them into multiple processes so they can be scaled up and down accordingly.</p><p>One of the downsides of Monolithic applications besides organizational issues is that to be able to scale them horizontally you need to scale the entire system, even if it’s not required because only one of the modules is the one that is receiving more of the traffic.</p><p>If a microservice architecture is used, and each microservice handles a single functionality is easier just to scale that service instead of the entire system, while the rest of the system remains the same.</p><h4>Disposability</h4><blockquote>Maximize robustness with fast startup and graceful shutdown</blockquote><p>This principle states that applications should startup quickly and shut down gracefully, this means that the application handles everything that it needs before it starts serving users and it also takes care of removing all the existing connections and resources that are allocated to it before it shut down.</p><h4>Development/production parity</h4><blockquote>Keep development, staging, and production as similar as possible</blockquote><p>This principle states that as a company the development, staging and production should be as closed as possible meaning that there isn’t a big difference in version between each other.</p><p>Meaning that versions/features from development should not be drastically different from what exists in production.</p><p>Once a version of development is ready to be put in production CI will follow the process of <a href="#build-release-run">Build, Release, Run</a> by running the settings that are set for production.</p><h4>Logs</h4><blockquote>Treat logs as event streams</blockquote><p>In general, logs should be viewed as a stream of information that should be stored, parse and process so interested parties can consume it.</p><p>The routing process of capturing the logs should be different from the process of processing the log data.</p><h4>Admin Processes</h4><blockquote>Run admin/management tasks as one-off processes</blockquote><p>When developing an application usually there are some admin task that needs to be performed like database migration, console logs or running one-time scripts.</p><p>This programs should run in an identical environment like the long-running process, they are run against a release using the same codebase and configuration, this admin code should ship the application code as well to avoid synchronization issues.</p><ol><li>Adam Wiggins. ‘The Twelve-Factor App’, 2017, <a href="https://12factor.net/">https://12factor.net/</a>. <a href="#fnr1-8418">↩︎</a></li><li>Bob Reselman. ‘An illustrated guide to 12 Factor Apps’, 2021, <a href="https://www.redhat.com/architect/12-factor-app">https://www.redhat.com/architect/12-factor-app</a>. <a href="#fnr2-8418">↩︎</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ff3a736147d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOLID]]></title>
            <link>https://medium.com/@jjzcru/solid-c0553347fb2b?source=rss-144c52945621------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0553347fb2b</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[solid-principles]]></category>
            <category><![CDATA[clean-architecture]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Jose J. Cruz]]></dc:creator>
            <pubDate>Fri, 25 Nov 2022 18:25:55 GMT</pubDate>
            <atom:updated>2022-11-25T18:25:55.186Z</atom:updated>
            <content:encoded><![CDATA[<h3>S.O.L.I.D Principles</h3><p>SOLID is a set of principles that were design by Robert Martin in the essay <a href="https://web.archive.org/web/20150906155800/http:/www.objectmentor.com/resources/articles/Principles_and_Patterns.pdf">Design Principles and Design Patterns</a>. In this essay he describes that a successful software is going to require change and is going to have a need to be develop further, without any sort of guidelines or principles the software is going to become rigid, fragile, time-consuming and unable to change.<a href="#fn1-31764">1</a></p><p>So SOLID provide a set of mental guidelines that help developers on how they should <strong>think</strong> about their code while they are developing software thinking in the long-term gains rather than the short term benefits of <em>hacky</em> code.</p><p>This principles focus on reducing the dependencies of the developer on tool and frameworks making it easier to collaborate without impacting other developers, it also increases reliability in the software since this principles promotes code that is easily testable while still making it much more easier to maintain and extend</p><h4>Single Responsibility Principle</h4><blockquote>A software module has one, and only one, reason to change</blockquote><blockquote>Robert C. Martin</blockquote><p>This principle states that a module, which could be a class, a function, a package or even a variable, has only one reason to change. <a href="#fn2-31764">2</a></p><p>When you are working in a class or a function you need to think about what is that function is trying to achieve, is a function is working on calculating the total amount of an order, it should not worry about opening or closing databases, or network requests, those should be handle by another “module”.</p><p>SRP helps us to avoid <em>coupling</em> meaning that a particular piece of code is bound to another piece, by working with SRP in mind it will create modules that are decoupled by design.</p><h4>Open-closed Principle</h4><blockquote>A software artifact should be open for extension but close for modification.<a href="#fn3-31764">3</a></blockquote><blockquote>Bertrand Meyer</blockquote><p>Whenever you are building software you are creating a type of <em>artifact</em>, the behavior of this artifact should be extensible without the need to modify this artifact.</p><p>Let say for example you have a car, this is going to be the artifact, the basis of the car are closed for modification but you could add attachments like new tires, an accessory to mount bikes, an spoiler, in this case the car is open for extension.</p><p>The same way you should treat your classes, if you have a class that initially fetch users, and in the future it comes a new requirement that it needs to add users, your class is open to extension but that new requirement should not affect the way that the initial requirement of <em>fetch users</em> works.</p><p>Taking OCP as guideline will help you on how you should architecture your classes, interfaces and functions in a way that you achieve <a href="https://deviq.com/principles/separation-of-concerns">Separation of Concerns</a> within your code.</p><h4>Liskov Substitute Principle</h4><blockquote>What is wanted here is something like the following substitution property: If for each object o1 of type S is an object o2 of type T such that for all programs P defined in terms of T, the behavior of P is unchanged when o1 is substituted for o2 then S is a subtype of T.<a href="#fn4-31764">4</a></blockquote><blockquote>Barbara Liskov</blockquote><p>In layman’s terms if you have a program that depends on a class A and without modification of that program you send a class B, by definition B is a subclass of A.</p><p>When developing application you need to make sure you understand what is the <strong>behavior</strong> that you rely upon and make sure that the subclasses that are inheriting from the superclass are keeping the same behavior so they comply with LSP.</p><p>One example of the violation of this principle is <a href="https://aip.vse.cz/pdfs/aip/2016/01/03.pdf">The Square-Rectangle Problem</a>.</p><h4>Interface Segregation Principle</h4><blockquote>No code should be forced to depend on methods it does not use. <a href="#fn5-31764">5</a></blockquote><blockquote>Robert C. Martin</blockquote><p>This principle discusses that when you have an static language like Java or C#, each of the application that needs to implement an interface it needs to implement all the methods, even the ones that they don’t use.</p><p>This principles proposes that instead of having a large interface that implements all the methods, it creates sub interfaces that each implement the methods that are required by the class.</p><p>This is not a problem on dynamic languages like python or ruby because this checks happens at runtime instead of compile time.</p><blockquote>ISP is a language issue, rather than an architecture issue</blockquote><p>There is an exception, <a href="https://go.dev/">Go</a> is a compiled language that support this interface behavior like dynamic languages because go doesn’t <strong>implement</strong> the interfaces but rather if uses <a href="https://devopedia.org/duck-typing">Duck Typing</a> at compile time to check if the methods that are required are implement without the need to <strong>import</strong> them.</p><h4>Dependency Inversion Principle</h4><blockquote>The most flexible systems are those in which source code dependencies refer only to abstractions, not to concretions</blockquote><blockquote>Robert C. Martin</blockquote><p>This principle states that our code should rely on the behavior of our code instead of the implementation details.</p><p>An example of this is fetching data from a database, as a developer, as a customer or as a user we really don’t care “where” im getting the information, the <strong>behaviour</strong> is “As a user I want to see a list of all my orders”, the application could store them in a single .json file, in a Document Database like MongoDB or in a SQL database like SQLite or Postgres.</p><p>All this stores mechanism are implementation details and our code should not rely on them, it should rely on the abstraction that “I need to get the orders”.</p><p>Now totally depending on abstract components is impossible since we have primitives data types like string, int or float, but the difference is that this components are <strong>stable</strong>, they do not change, so we can rely on <strong>stable</strong> components like primitives, interfaces, abstract classes and <a href="https://www.okta.com/identity-101/dto/">DTO</a>.</p><p><em>How can we use things like databases if those are volatile components?</em></p><p>You create abstractions that describe the behavior and make your program rely on those behavior, this abstraction could be <a href="https://www.tutorialspoint.com/design_pattern/factory_pattern.htm">Factories</a>, <a href="https://deviq.com/design-patterns/repository-pattern">Repositories</a> or <a href="https://www.geeksforgeeks.org/facade-design-pattern-introduction/">Façades</a>.</p><ol><li>Stephen Watts. ‘The Importance of SOLID Design Principles’, <em>BMC</em>, June 15, 2020, <a href="https://www.bmc.com/blogs/solid-design-principles/">https://www.bmc.com/blogs/solid-design-principles/</a>. <a href="#fnr1-31764">↩︎</a></li><li>Robert C. Martin. <em>Clean Architecture</em>, First Edition, Prentice Hall, 2017, p. 58–59 <a href="#fnr2-31764">↩︎</a></li><li>Bertrand Meyer. <em>Object Oriented Software Construction</em>, Prentice Hall, 1988, p. 23. <a href="#fnr3-31764">↩︎</a></li><li>Barbara Liskov. <em>Data Abstraction and Hierarchy</em>, SIGPLAN Notices 23, 1988. <a href="#fnr4-31764">↩︎</a></li><li>Robert C. Martin. <em>Agile Software Development: Principles, Patterns, and Practices</em>, Pearson Education, 2002. <a href="#fnr5-31764">↩︎</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0553347fb2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Book — Atomic Habits]]></title>
            <link>https://medium.com/@jjzcru/book-atomic-habits-118d4d71c680?source=rss-144c52945621------2</link>
            <guid isPermaLink="false">https://medium.com/p/118d4d71c680</guid>
            <category><![CDATA[habits]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[notes]]></category>
            <category><![CDATA[book-review]]></category>
            <dc:creator><![CDATA[Jose J. Cruz]]></dc:creator>
            <pubDate>Sun, 06 Nov 2022 19:51:41 GMT</pubDate>
            <atom:updated>2022-11-06T20:03:12.154Z</atom:updated>
            <content:encoded><![CDATA[<h3>📝 Notes On — Atomic Habits</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*CNlEReoOsnlEzqwvvG-8Zw.png" /></figure><p>This are my personal notes on the book Atomic Habits by James Clear, you can purchase the book on <a href="https://a.co/d/8D6BiGK">Amazon</a>.</p><h3>Key Lessons</h3><ol><li>🔑 <strong>Become 1% better everyday.</strong> Every day try to improve one or multiple aspects of your life at least by 1%, the cumulation of this will end up compounding multiple times the original baseline.</li><li>🔑 <strong>Make good habits desirable and bad habits painful.</strong> To stick to new habits you need to notice them by making it obvious, you need to want to do it, make it easy to perform and make sure to reward yourself by performing it, by the same token make sure to make bad habit invisible to see the triggers, make it undesirable, make them hard to do and do something that make it regrettable if you perform them.</li><li>🔑 <strong>Habits are the key to mastery.</strong> Habits are what difference elite from regular people, by sticking and improving them you are guaranteed to achieve mastery.</li></ol><h3>Actionable items</h3><ol><li><strong>✅ List your habits and review them.</strong> Make a list of the habits that you are performing, good, neutral and bad, add to that list the habits that you want to perform and try to add them to your existing good habits while trying to make the bad ones as undesirable as possible.</li><li><strong>✅ Identify who you want to be and build your habits around it.</strong> <em>If one does not know to which port one is sailing, no wind is favorable</em>, you need to know where you want to go so you can make a plan on how to achieve it and which habits that person follows.</li><li><strong>✅ List what you are good at and exploit those skills.</strong> Try to make a list of the things you like to do and are good at, and see which of this areas can be improve by adding good habits and which bad habits are a detriment to those skills and try to remove them.</li></ol><h3>Power of the atomic habits</h3><blockquote>Be 1% better every day</blockquote><p><em>Habits are the compound interest of self-improvements. Getting 1 percent better every day counts for a lot in the long-run</em></p><h4>Habits compound</h4><p>Is easy to underestimate the value of small improvements in the daily basis, is a misunderstanding that to get a massive success it requires a massive action, when it only requires small improvements for a long time, a overnight success doesn’t exist.</p><p><strong>Positive Compounding</strong></p><p><em>Productivity Compounds</em></p><ul><li>Complete one extra task</li><li>Automate old task</li><li>Master a new skill</li></ul><p><em>Stress compounds</em></p><ul><li>When stress persists for years it compounds in health issues</li></ul><p><em>Knowledge Compounds</em></p><ul><li>Commit to a lifelong learner</li><li>Each knowledge you get open different ways to think about old ideas</li></ul><p><strong>Negative Compounding</strong></p><p><em>Negative thoughts compound</em></p><ul><li>Constants negative thoughts lead to a negative feedback loop</li><li>Negative feelings towards yourself get reflected to everyone else</li></ul><p><em>Relationships compound</em></p><ul><li>People reflect your behavior back to you</li><li>Try being nice in each interaction</li></ul><p><em>Outrage compounds</em></p><ul><li>Microaggressions stacks and eventually reach a breaking point</li></ul><h4>Forget about goals, focus on systems instead</h4><p>Goals are the result of work, the these results are outside of our control, instead focus on systems that allow you to achieve your goal, and you have control on those systems.</p><blockquote>Goal = Result (You don’t control)</blockquote><p>If your goal is to be a best selling author, that’s outside of your control, but you can create a system that says One page a day, you have control over this and you can be proud of the effort you have made instead of the result.</p><blockquote>Systems = Process that lead to those results (You control)</blockquote><p>A goal is finite once you achieve it there isn’t something after that, systems are undefined, if your goal is to win a high school championship once you achieve it there isn’t something after that, if you focus on your systems once you achieve the goal you can keep the system to achieve the next goal. <em>Perhaps win a professional championship</em></p><blockquote>Goals restrict your happiness</blockquote><p>If you enjoy the process and focus on improve the end result of the goal is not going to affect the level of happiness you have, since that’s not something you can control.</p><blockquote>You don’t rise to the levels of your goals, you fall to the level of your systems</blockquote><h3>Identify with your habits</h3><p>People try to change their habits to change their identity, is a better strategy to change your identity and do habits that confirms that identity</p><p><em>Instead of </em><em>I will eat healthy to become a healthy person try </em><em>I don&#39;t eat junk food because I&#39;m a healthy person</em></p><h3>Build better habits</h3><blockquote>The ultimate purpose of habits is to solve the problems of life with as little energy and effort as possible</blockquote><p>The process of building habit can be divided into four steps:</p><ol><li><strong>Cue</strong>: Triggers the brain to initiate a behavior, a bit of information predicts a reward</li><li><strong>Craving</strong>: Motivational force behind every habit. Without a motivation or desire we do not have a reason to act</li><li><strong>Response: </strong>Habit you perform, it depends on the motivation and friction associated with the behavior.</li><li><strong>Reward</strong>: End goal of every habit, the result of the response</li></ol><p>Motivations and Desires are the main building blocks for the habits, the other block is the friction of the action, if the motivation is high and the friction is low is the optimal condition to build a habit.</p><h3>Four laws of behavior change</h3><p>Is a framework that work as a set of rules for creating good habits and breaking bad ones</p><h4>The 1st Law (Cue) — Make it obvious</h4><ul><li>The process of behavior change always start with awareness. You need to be aware of the habits to be able to change them</li><li>Make the trigger for good habits as obvious as possible</li><li>Call the actions you are performing to identify the habit</li></ul><p>The formula for implementing your habits is</p><blockquote>I will {BEHAVIOR} at {TIME} in {LOCATION}</blockquote><p><em>Example: I will meditate for one minute at 7:00 am in my room</em></p><p>The most common cues are:</p><ul><li>Time</li><li>Location</li></ul><h4>Habit Stacking</h4><p>Habit stacking is a way to use the action of one habit to be the trigger of another habit, this is good when your brain already has an existing habit and you want to add a new one using the existing one as a cue.</p><p><em>Example: I will brush my teeth when I wake up, when I finish brushing my teeth I will rinse my face, when I finish rinsing my face I will do my bed</em></p><blockquote>Fogg’s habit stacking formula</blockquote><blockquote>After I {CURRENT HABIT}. I will {NEW HABIT}.</blockquote><h4>Design your environment</h4><blockquote>Environment Matters More Than Motivation</blockquote><p>Use your environment to your advantage use it to create cues to trigger the habits you want to adhere to, make sure to make them stand out.</p><p>Is easier to create new habits in a new environment where we don’t need to fight against old cues.</p><h4>Inversion — Make it invisible</h4><p>When trying to break a bad habit one of the best way to go about it is to make the cue invisible, without the cue we don’t get the crave.</p><p>Instead of relying on self-control, try living with less temptations, so is better to reduce the exposure to those temptations.</p><h4>The 2nd Law (Craving) — Make it Attractive</h4><ul><li>The brain of each animal is preloaded with certain rules for behavior, this are refer to as <em>supernormal stimuli</em>.</li><li>The expectation of a reward triggers the craving, the <em>desire</em> to fulfill the crave is what make habits possible.</li></ul><h4>Dopamine-driven feedback loop</h4><blockquote>The anticipation of a reward — not the fulfillment of it — gets us to take action</blockquote><p>As humans we find more fulfillment on the expectation of the reward than the reward itself, because of <em>dopamine</em>.</p><p>Without it human wouldn’t have the will to perform any action, being able to control our dopamine system will allow you to increase the speed on which habits get adopted.</p><p>The crave of the reward give us a dopamine spike,</p><h4>Temptation Bundling</h4><p>Temptation bundling is the process of linking an action you want to do with an action you need to do, is also a way to apply a psychology theory known as <a href="https://www.simplypsychology.org/premack-principle.html">Premack’s Principle</a>.</p><blockquote>More probable behaviors will reinforce less probable behaviors</blockquote><p>You can combine this strategy with BJ Frog’s habit stacking strategy</p><blockquote>Habit Stacking + Temptation bundling formula</blockquote><ol><li>After I {CURRENT HABIT}, I will {HABIT I NEED}</li><li>After {HABIT I NEED}, I will {HABIT I WANT}</li></ol><h4>Use social norms to your advantage</h4><p>Humans are social creature, we can use this to our advantage by joining a group that can help us achieve our goal.</p><h4>Imitating the close</h4><p>Proximity to people that already have the habits that we strive for help us by making use of our need to fit in.</p><p>To make the habit more attractive try to join a culture that:</p><ol><li>The behavior that you want is the normal behavior</li><li>You already have something in common with the group</li></ol><h4>Imitation the many</h4><p>Whenever you are unsure on how to act you can take a look a the group to guide your behavior, if changing to fit with the group it make the habit much more attractive.</p><h4>Imitating the powerful</h4><blockquote>If a behavior can get us approval, respect, and praise, we find it attractive.</blockquote><p>Humans pursue:</p><ul><li>Power</li><li>Prestige</li><li>Status</li></ul><p>Pursuing habits that helps us get those things makes it much more attractive.</p><h4>Inversion — Make it unattractive</h4><p>Reframe the bad habit you want to break and reframe it as useless, expensive, ugly and unhealthy as possible.</p><blockquote>Reframe your mind-set. Highlight the benefits of avoiding your bad habits.</blockquote><p>When you rationalize the habit then you understand that it doesn’t make any sense to keep pursuing that habit because it doesn’t provide you any benefit while making harm to you, which is a net loss.</p><h4>The 3rd Law (Response) — Make it easy</h4><blockquote>If you want to master a habit, the key is to start with repetition</blockquote><p>To form a habit you need to be performing it multiple times, and progressively it will become automatic.</p><p>The more you do it the more efficient your brain becomes on performing it, which is called <a href="https://www.sciencedirect.com/topics/neuroscience/long-term-potentiation">long-term potentiation</a></p><blockquote>Neurons that fire together wire together</blockquote><blockquote>Hebb’s Law</blockquote><p>Every time you repeat an action, you activate a specific section of a neural circuit that is associated with that habit, and across time is becomes more strong.</p><blockquote>Focus on taking actions, not being in motion</blockquote><p>The end goal of a habit it is to achieve automatic behavior, which is known as <a href="https://www.verywellmind.com/what-is-automaticity-2795018">automaticity</a>, which is doing an action without an conscious effort that we are performing it, like driving a car or a bicycle.</p><h4>The Law of Least Effort</h4><p>As humans we move towards things that are easy to do, because we want to save energy and try to do the least amount of work, that’s why we need to prepare for success by priming our environment.</p><blockquote>Standardize before you optimize. You can’t improve a habit that doesn’t exist</blockquote><p>We need to arrange our environment in a way that’s easy to do the habit, like reducing friction and improving the environment to make future actions easier.</p><blockquote>Using technology to automate your habits is the most reliable and effective way to guarantee the right behavior</blockquote><p>Another strategy is to automate the habit you want to perform, you want to save money, enroll in an automatic saving plan, forget to do han habit add it to a reminders app.</p><h4>Inversion — Make it difficult</h4><p>To break bad habits try making them as difficult to perform as possible by adding friction, add extra steps to perform that habit so you don’t feel enticed to perform them.</p><p>You want to reduce the time you watch TV, hide the remote control, want to eat healthier, hide the junk food or better yet don’t buy them at all.</p><p>Also use the strategy to automate to make it harder to perform the bad habit, you want to remove your phone addiction use <a href="https://support.apple.com/en-us/HT208982">Screen Time</a> and <a href="https://support.apple.com/en-us/HT208982#downtime">Downtime</a></p><h4>The 4th Law (Reward) — Make it Satisfying</h4><blockquote>We are more likely to repeat a behavior when the experience is satisfying</blockquote><p>The reward is the reason why do a habit, we need to make the reward as satisfying as possible so we want to do the behavior multiple times, otherwise we have little reason to repeat it.</p><blockquote>What is rewarded is repeated. What is punished is avoided</blockquote><blockquote>Cardinal rule of Behavior Change</blockquote><p>We need to focus on immediate satisfaction, at the grand schemes of things we need think in delaying gratification but for a habit to stick we need to make our reps we need to put in the work and to achieve that we need immediate satisfying rewards to feed the <a href="https://www.techtarget.com/whatis/definition/dopamine-driven-feedback-loop">Dopamine-Driven Feedback Loop</a>.</p><h4>Inversion — Make it Unsatisfying</h4><p>If we want to break bad habits we need to make sure that doing them will bring pain to our life, humans are moved by two forces:</p><ol><li>Get pleasure</li><li>Avoid Pain</li></ol><p>If we associate a bad habit with a painful experience we are more likely to drop it two strategies for this are:</p><h4>Accountability Partner</h4><p>Use someone to keep you accountable for your habits, if two people want to perform a habit, like going to the gym, the fact that you have another person relying on you is going to increase the changes that you go.</p><p>Because we care about what other people think and do not want to have a bad image of us.</p><h4>Habit Contract</h4><p>Is something that you agree to do or not do, and if you break you have to perform a painful consequence, another person is going to make you accountable for that contract.</p><p>The painful consequence could be something like:</p><ol><li>Giving out money to another person</li><li>Doing something embarasing</li></ol><h3>Advanced Tactics</h3><h4>The Truth About Talent</h4><p>Gene’s are a factor in talent and such you need to let the odds work in your favor, use your natural inclinations and exploit them, we know that we want what takes the least amount of effort, so take advantage of that, ask yourself.</p><ul><li>What feels like fun to me, but works to others?</li><li>What makes me lose track of time?</li><li>Where do I get greater returns than the average person?</li><li>What comes naturally to me?</li></ul><blockquote>Genes do not eliminate the need for hard work. They clarify it</blockquote><p>You don’t have to be the best to excel, you are a unique person, if you can be the best in the game …. create a new one were you can win.</p><h4><a href="https://jamesclear.com/goldilocks-rule">The Goldilocks Rule</a></h4><blockquote>The greatest threat to success is not failure but boredom</blockquote><p>As humans we get bored when we perform task over and over again, if we task is to easy we get bore and if it gets really hard we become anxious, neither of those is good.</p><p>But if we find a way to perform that task a little bit over capabilities and challenge ourself we improve, and we get immerse in what is called “The zone” or <a href="https://www.frontiersin.org/articles/10.3389/fpsyg.2021.645498/full">Flow State</a>.</p><p>To improve we need to put in the ours, regardless of our mood and motivation, that’s how we build habits and make progress in life.</p><h4>The Downside of Creating Good Habits</h4><blockquote>Habits create the foundation for mastery</blockquote><p>At the beginning your conscious mind is giving you feedback on how to improve, but the more you get used to the habit your brain becomes desensitized to the feedback because your habit created a shortcut in your nervous circuit system.</p><p>In part is good because you are doing activities in autopilot but at the same time you don’t noticed the little mistakes that you are doing along the way, because of that complacency you end up in mindless repetition which makes your performance decline, slightly, over time.</p><p>If you want to maximize your potential and achieve elite levels of performance you need a different approach that is describe as</p><blockquote>Habits + Deliberate Practice = Mastery</blockquote><p>You need to achieve the autopilot stage but once you achieve it you need start working towards the new version of that habit.</p><blockquote>Mastery is the process of narrowing your focus to a tiny element of success</blockquote><p>When you feel like you mastered a skill is when you need to take a look on yourself to make sure you are not becoming complacent and take that habit up a notch.</p><blockquote>Life is constantly changing, so you need to periodically check in to see if your old habits and beliefs are still serving you</blockquote><p>Even if habits helps us to perform and activity or help us to create the persona you want to be, we can’t cling to a single aspect, as a human you are a complex creature an as such you are multidimensional, try to based your persona in your values, that are within your control, and not to an outcome.</p><blockquote>The tighter we cling to an identity, the harder it becomes to grow beyond it</blockquote><h3>Little lessons from the four laws</h3><ul><li>Being curious is better than being smart</li><li>Peace occurs when you don’t turn your observation into problems</li><li>With a big enough <em>why</em> you can overcome any <em>how</em>.</li><li>We can only be rational and logical <em>after</em> we have been emotional</li><li>Suffering drives progress</li><li>Rewards is on the other side of sacrifice</li><li>Desire initiates. Pleasure Sustains.</li><li>Our expectations determine our satisfaction</li></ul><blockquote>Satisfaction = Liking — Wanting</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=118d4d71c680" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install Pi-hole from scratch]]></title>
            <link>https://medium.com/@jjzcru/install-pi-hole-from-scratch-2befffbe3c73?source=rss-144c52945621------2</link>
            <guid isPermaLink="false">https://medium.com/p/2befffbe3c73</guid>
            <category><![CDATA[network]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[pihole]]></category>
            <category><![CDATA[ad-blocking]]></category>
            <dc:creator><![CDATA[Jose J. Cruz]]></dc:creator>
            <pubDate>Sun, 30 Oct 2022 03:01:47 GMT</pubDate>
            <atom:updated>2022-10-30T03:01:47.904Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://pi-hole.net/">Pi-hole</a> is a network-wide ad blocker, it protects your devices from unwanted content, without installing any client-side software.</p><h3>Pre-requisites</h3><ul><li>Min. 2GB free space, 4GB recommended</li><li>512MB RAM</li></ul><h3>Install Raspberry Pi OS</h3><p>The first thing we are going to do is install Raspberry Pi OS into an SD Card, we are going to install it using <a href="https://www.raspberrypi.com/software/">Raspberry Pi Imager</a>.</p><blockquote>We are going to use Raspberry Pi 3 Model B.</blockquote><p>In the installer we are going to click CHOOSE OS, since we are not going to use the graphical interface, we are going to install the lite version of Raspberry Pi OS. In the menu click click Raspberry Pi OS (other), then select Raspberry Pi OS Lite (32-bit).</p><p>Now click CHOOSE STORAGE in here select the SD Card where you wish to install the OS.</p><blockquote>Since we are going to install a OS without a GUI we are going to setup all the network configuration at installation so we can ssh into the machine</blockquote><p>Click in the cog icon ⚙️ to access Advanced options, we are going to set a hostname, since i already got a machine with that name in the network i want to customize it, i’m going to call it pi-hole.</p><p>We do not have an user interface and we want to be able to control the Pi-hole remotely, for this we are going to enable ssh and set a username and a password and click save.</p><p>We also need to setup the wireless connection, click the Configure wireless LAN checkbox, then set the SSID<em>(Network name)</em> and the password</p><p>In the main menu click WRITE.</p><blockquote>This process takes a while so you can let it run in the background</blockquote><h3>Connect to the server</h3><p>First we need to access the server, make sure that the your machine and the pi-hole server are in the same network. Type the following command to ssh into the pi-hole.</p><pre>ssh user@pihole.local</pre><p>Replace the user and pihole (Hostname) that was set in the previous step, then write the password.</p><blockquote><em>We can use the </em><em>hostname.local because internally Raspberry Pi OS uses an implementation of </em><em>mDNS called </em><em>Avahi that enables DNS multicast.</em></blockquote><h3>Update the server</h3><p>We now have access to the server and we have a fresh install, let’s make sure that we are up to date, type the following command to open the configuration menu</p><pre>sudo raspi-config</pre><p>Then select Update, once the update finished, click on the option &lt;Finish&gt;.</p><h3>Install Pi-hole</h3><p>We are inside the server and up to date, type the following command to install pi-hole. For reference you can check <a href="https://docs.pi-hole.net/main/basic-install/">Pi-hole Installation</a> for the official documentation.</p><pre>curl -sSL https://install.pi-hole.net | bash</pre><blockquote><em>Navigate through the wizard, is going to ask you to make sure that the server has an static-ip, this depend on the network and is outside of the scope of this article.</em></blockquote><p>Since we are running pi-hole wirelessly when the wizard ask for the interface select the wlan0.</p><p>Keep filling the wizard, in my case I select Google as the DNS provider and requested to install the admin panel (which requires to install php and other dependencies).</p><p>Once the installation is complete is going to display a message with the url for the admin panel and the login password which would be something like <a href="http://pihole.local/admin.">http://pihole.local/admin.</a></p><p>If you wish to update the password run:</p><pre>pihole -a -p</pre><h3>Network Configuration</h3><p>The last step is configuring the network to use Pi-hole as the DNS server, this step depends on each network but the main point is you go to your router admin panel and point the DNS server to the pi-hole address.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2befffbe3c73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a CI-CD Pipeline with Vercel and GitHub Actions]]></title>
            <link>https://medium.com/@jjzcru/building-a-ci-cd-pipeline-with-vercel-and-github-actions-f80d3a4a7de3?source=rss-144c52945621------2</link>
            <guid isPermaLink="false">https://medium.com/p/f80d3a4a7de3</guid>
            <dc:creator><![CDATA[Jose J. Cruz]]></dc:creator>
            <pubDate>Mon, 11 Apr 2022 04:41:39 GMT</pubDate>
            <atom:updated>2022-04-11T04:41:39.734Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a CI/CD Pipeline with Vercel and GitHub Actions</h3><p>Right now development is easier to get started than ever before, creating a prototype and testing it to see if there is any market fit is easy to do, especially with tools like Vercel that give you free hosting, SSL Certificates, and CD out of the box.</p><h4>Once upon a time</h4><p>Once upon a time developers used to create projects and start creating their snapshots of the code in zip files and then pushing it to the production environment using something called FTP.</p><p><em>That’s right before object storage, people use to manually upload files to a server and manually deploy</em></p><p>This way of versioning code is manual and error-prone so developers migrated to <a href="https://deepsource.io/glossary/version-control-system/">VCS</a>, three main systems handle this:</p><ul><li><a href="https://git-scm.com/">git</a></li><li><a href="https://www.mercurial-scm.org/">mercurial</a></li><li><a href="https://subversion.apache.org/">subversion</a></li></ul><p>Out of the three, git is the most used, it became popular because of GitHub, it also provides a standard way to control versioning of our software with the concept of branches and permission it makes it easier to collaborate and integrate new code into an existing source code, especially with testing on which we got CI, <em>continuous integration</em>.</p><p>But git didn’t solve the deployment issue, now developers were ssh-ing to the deployment server and pulling the new code, but this still was manual work, so developers started using programs that listen to changes in a particular branch, pull the code, and deploy the program by following a list of steps, this is called CD, <em>continuous deployment</em></p><h4>Setup</h4><p>For this tutorial, we are going to use <a href="https://vercel.com/">Vercel</a> as an hour hosting platform, Github for storing our code, and GitHub Actions as our CI.</p><p><em>Vercel support multiple languages and frameworks, the supported list can be found </em><a href="https://vercel.com/docs/concepts/deployments/build-step"><em>here</em></a></p><p>The first step is to create a project on GitHub, for this tutorial we are going to use <a href="https://create-react-app.dev/">CRA</a>.</p><h4>Installation</h4><p>Before we start you need to make sure that you have node installed, we are going to use <a href="https://nodejs.dev/">Node.js</a> 14, because it’s the latest Node.js version supported by Vercel.</p><p>Run the following command and fill the installer.</p><pre>npx create-react-app my-app</pre><p>You can replace my-app with the name of your application, once it’s done link your project with your GitHub repo, create a commit and push it.</p><h4>GitHub Actions</h4><p>Once you have done that you should be able to see your code on GitHub in the main branch, you are going to create a directory called .github in the root of your project, inside this directory create another directory called workflows and inside this directory create a file called deployment.yml.</p><p>In UNIX based system you run the following command at the root of your project mkdir -p .github/workflows &amp;&amp; touch .github/workflows/deployment.yml</p><p>Now you are going to copy the following content inside deployment.yml</p><pre>name: Node.js CI<br><br>on:<br>    push:<br>        branches: [main, develop]<br>    pull_request:<br>        branches: [main, develop]<br><br>jobs:<br>    build:<br>        runs-on: ubuntu-latest<br><br>        strategy:<br>            matrix:<br>                node-version: [14.15.x]<br><br>        steps:<br>            - uses: actions/checkout@v2<br>            - name: Use Node.js ${{ matrix.node-version }}<br>              uses: actions/setup-node@v2<br>              with:<br>                  node-version: ${{ matrix.node-version }}<br>                  cache: &#39;npm&#39;<br><br>            - name: Run CI command<br>              run: npm ci<br><br>            - name: Check linting<br>              run: npm run lint<br>            <br>            - name: Run the tests<br>              run: npm run test<br><br>            - name: Build<br>              run: npm run build</pre><p>Now let’s explain each section of this file, first the on the section we are setting up “when” are we running this workflow, in this example, we are doing it in the main and the develop branch when we are doing a push and a pull request.</p><p>In the following section in the jobs we are describing what we need to perform for this tutorial we are only focusing in the build portion.</p><p>We declare that we are building this in ubuntu, and the strategy we are defining that we are going to use the version 14.15 of Node.js.</p><p>Below we are describing all the steps that need to pass so we can consider integrating a particular change, the steps are the following:</p><ol><li>We are checking out the source code</li><li>We are calling another GitHub Action workflow that is provided by Github that installs Node.js 14.15 in our CI environment</li><li>Then we are running a npm ci which install the dependencies in the package.json</li><li>Then we are running our listing, which makes sure that the code style guides are being used.</li><li>Then we run the tests that we have</li><li>And the last step we make sure that our code can build</li></ol><p>If one of these steps fails the entire integration fails and the code is not integrated.</p><p>For now, remove the lint command because we haven’t set that command yet, now commit changes, and push it to master.</p><h4>Gitflow</h4><p>Now when you are working on a project you need to select a particular branching model since you can’t, <strong>YOU SHOULD NOT</strong>, work in the main branch, the branching model that we are going to use is called <a href="https://nvie.com/posts/a-successful-git-branching-model/">Gitflow</a> and is used widely in multiple projects.</p><p>Instead of learning all the commands of this flow, you can install git hooks to automate this job, you only need to install the <a href="https://markshust.com/2012/05/02/easiest-way-install-git-flow-mac-os-x/">git-flow installer</a>.</p><p>Once installed in the project run the following command and answer the questions: git flow init</p><p>Now you are going to be in the develop branch, make any change make the commit, and run the following command.</p><pre>git push --set-upstream origin develop</pre><p>This will create the develop branch remotely in Github, you should not deploy directly to develop and only do pull requests against main and develop.</p><h4>Vercel</h4><p>With all the previous steps everything is set up with the CI section of the pipeline, now we are going to link it with Vercel, follow the following steps.</p><ol><li>start by creating an account</li><li>Click on New Project</li><li>Select the git repository that you just created</li></ol><p>Vercel is going to try to guess what framework you are using and is going to try to build it, once it’s finished it’s going to deploy it to a subdomain of *.vercel.app which you can change to your domain or another *.vercel.app (As long as it is available).</p><p>With this you are all set up in the CD Pipeline, Vercel is going to automatically detect commits against the main branch and is going to deploy it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f80d3a4a7de3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>