<?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 Milhomem on Medium]]></title>
        <description><![CDATA[Stories by Milhomem on Medium]]></description>
        <link>https://medium.com/@milmeninos?source=rss-4574c5345819------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*cCguBEzk-_MNWAFB.jpg</url>
            <title>Stories by Milhomem on Medium</title>
            <link>https://medium.com/@milmeninos?source=rss-4574c5345819------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 19:10:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@milmeninos/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[What Separates Mid-Level from Senior Engineers?]]></title>
            <link>https://milmeninos.medium.com/what-separates-mid-level-from-senior-engineers-bb60d4501b86?source=rss-4574c5345819------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb60d4501b86</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[design-patterns]]></category>
            <dc:creator><![CDATA[Milhomem]]></dc:creator>
            <pubDate>Sat, 26 Jul 2025 04:50:53 GMT</pubDate>
            <atom:updated>2025-07-30T07:13:49.928Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Knowing how to name the code patterns you already use</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dZHjGDk_aJWswlj8naulOQ.jpeg" /><figcaption>AI Generated with Imagen — Whisk</figcaption></figure><p>When we talk about design patterns in engineering circles, we often think of them as abstract tools — something senior architects pull from an old textbook to bring order to complex systems. But the truth is, most of us are already using patterns without even realising it.</p><p>And that’s where it gets tricky.</p><p>If we can’t name what we’re building, we can’t talk about it properly, document it clearly, or figure out if it actually makes sense. Worse, we might be misusing patterns without knowing, solving problems in ways that just end up confusing other engineers.</p><p>In fast-moving teams, that kind of thing costs time, clarity, and trust in the codebase.</p><h3>It’s about Engineering Fluency</h3><p>Design patterns are not APIs. They don’t have official interfaces or packages you can import. You can’t lint for them, and no static analyser is going to flag you for using the wrong one.</p><p>What they give you is a <strong>semantic structure</strong>.</p><p>They let you look at a piece of code and say: <em>this is a Factory</em>. <em>That’s a Strategy</em>. <em>This bit over here — that’s a Decorator on top of a Composite.</em></p><p>This kind of vocabulary doesn’t come from theory. It comes from practice; from writing code, reading frameworks, debugging edge cases, and eventually realising, <em>Oh. I’ve done this before.</em></p><h3>You already wrote these patterns. Why not call them what they are?</h3><p>Let’s walk through three of the most widely used patterns in modern systems: <strong>Factory</strong>, <strong>Strategy</strong>, and <strong>Decorator</strong>.</p><p>For each, I’ll show what it looks like in Python, Typescript, and Java.</p><h3>Object Instantiation without tight coupling</h3><blockquote>The Factory pattern abstracts object creation logic, allowing you to instantiate the right implementation based on runtime parameters or configuration — <strong>without exposing concrete classes to the client (Other Developers)</strong>.</blockquote><pre># Python<br>class DatabaseConnection:<br>    def __init__(self, engine):<br>        self.engine = engine<br><br>class DBFactory:<br>    @staticmethod<br>    def create(db_type):<br>        if db_type == &#39;postgres&#39;:<br>            return DatabaseConnection(&#39;PostgreSQL&#39;)<br>        elif db_type == &#39;mysql&#39;:<br>            return DatabaseConnection(&#39;MySQL&#39;)<br>        raise ValueError(&#39;Unknown database type&#39;)<br><br># Usage<br>conn = DBFactory.create(&#39;postgres&#39;)</pre><pre>// JAVA<br>class DatabaseConnection {<br>    private String engine;<br>    public DatabaseConnection(String engine) {<br>        this.engine = engine;<br>    }<br>}<br><br>class DBFactory {<br>    public static DatabaseConnection create(String type) {<br>        switch (type) {<br>            case &quot;postgres&quot;: return new DatabaseConnection(&quot;PostgreSQL&quot;);<br>            case &quot;mysql&quot;: return new DatabaseConnection(&quot;MySQL&quot;);<br>            default: throw new IllegalArgumentException(&quot;Unknown database&quot;);<br>        }<br>    }<br>}<br><br>// Usage<br>DatabaseConnection conn = DBFactory.create(&quot;mysql&quot;);</pre><pre>//TypeScript<br>import { Client as PgClient } from &#39;pg&#39;;<br>import { MongoClient } from &#39;mongodb&#39;;<br><br>type SupportedDatabases = &#39;postgres&#39; | &#39;mongodb&#39;;<br><br>type AnyDatabaseClient = PgClient | MongoClient;<br><br>class DatabaseFactory {<br>  static create(type: SupportedDatabases, connectionString: string): AnyDatabaseClient {<br>    switch (type) {<br>      case &#39;postgres&#39;:<br>        return new PgClient({ connectionString });<br>      case &#39;mongodb&#39;:<br>        return new MongoClient(connectionString);<br>      default:<br>        throw new Error(`Unsupported database type: ${type}`);<br>    }<br>  }<br>}<br><br>// --- Usage ---<br>const dbType: SupportedDatabases = &#39;mongodb&#39;;<br>const dbClient = DatabaseFactory.create(dbType, process.env.DB_URL!);</pre><p>These are <strong>Factories — </strong>a centralised way to handle instantiation logic, allowing the calling code to remain agnostic of the concrete types it’s using. You’re not just “switching on a config”, you’re implementing a Factory, even if you didn’t know to call it that.</p><p>Frameworks like Spring, Django, and even Flask do this behind the scenes constantly: via factories, providers, and dependency injection containers.</p><h3>Dynamic behaviour without Inheritance</h3><blockquote>The Strategy pattern allows <strong>runtime selection of behavior</strong> — injecting interchangeable algorithms into a context without modifying its structure.</blockquote><pre># Python<br>import stripe<br>import paypalrestsdk<br><br>class PaymentStrategy:<br>    def pay(self, amount: float):<br>        raise NotImplementedError<br><br>class Stripe(PaymentStrategy):<br>    def pay(self, amount: float):<br>        return stripe.Charge.create(<br>            amount=int(amount * 100),<br>            currency=&quot;usd&quot;,<br>            source=&quot;tok_visa&quot;,<br>            description=f&quot;Charge for ${amount}&quot;<br>        )<br><br>class PayPal(PaymentStrategy):<br>    def pay(self, amount: float):<br>        payment = paypalrestsdk.Payment({<br>            &quot;intent&quot;: &quot;sale&quot;,<br>            &quot;payer&quot;: { &quot;payment_method&quot;: &quot;paypal&quot; },<br>            &quot;transactions&quot;: [{<br>                &quot;amount&quot;: { &quot;total&quot;: f&quot;{amount:.2f}&quot;, &quot;currency&quot;: &quot;USD&quot; },<br>                &quot;description&quot;: &quot;Payment via PayPal&quot;<br>            }],<br>            &quot;redirect_urls&quot;: {<br>                &quot;return_url&quot;: &quot;http://example.com/return&quot;,<br>                &quot;cancel_url&quot;: &quot;http://example.com/cancel&quot;<br>            }<br>        })<br>        payment.create()<br>        return payment<br><br>class PaymentProcessor:<br>    def __init__(self, strategy: PaymentStrategy):<br>        self.strategy = strategy<br><br>    def execute(self, amount: float):<br>        return self.strategy.pay(amount)<br><br># --- Usage ---<br>processor = PaymentProcessor(Stripe())<br>result = processor.execute(100)</pre><pre>// JAVA<br>import com.stripe.Stripe;<br>import com.stripe.model.Charge;<br>import com.stripe.param.ChargeCreateParams;<br>import com.paypal.base.rest.APIContext;<br>import com.paypal.base.rest.PayPalRESTException;<br>import com.paypal.api.payments.*;<br><br>interface PaymentStrategy {<br>    String pay(int amount);<br>}<br><br>class Stripe implements PaymentStrategy {<br>    @Override<br>    public String pay(int amount) {<br>        try {<br>            ChargeCreateParams params = ChargeCreateParams.builder()<br>                .setAmount((long) amount * 100) // in cents<br>                .setCurrency(&quot;usd&quot;)<br>                .setSource(&quot;tok_visa&quot;) // test token<br>                .setDescription(&quot;Payment via Stripe&quot;)<br>                .build();<br><br>            Charge charge = Charge.create(params);<br>            return &quot;Stripe charge ID: &quot; + charge.getId();<br>        } catch (Exception e) {<br>            return &quot;Stripe payment failed: &quot; + e.getMessage();<br>        }<br>    }<br>}<br><br>class PayPal implements PaymentStrategy {<br>    private final APIContext apiContext;<br><br>    public PayPalPayment() {<br>        this.apiContext = new APIContext(&quot;client_id&quot;, &quot;client_secret&quot;, &quot;sandbox&quot;);<br>    }<br><br>    @Override<br>    public String pay(int amount) {<br>        Amount amt = new Amount(&quot;USD&quot;, String.format(&quot;%.2f&quot;, (double) amount));<br>        Transaction txn = new Transaction();<br>        txn.setAmount(amt);<br><br>        Payment payment = new Payment();<br>        payment.setTransactions(java.util.Collections.singletonList(txn));<br>        <br>        try {<br>            Payment created = payment.create(apiContext);<br>            return &quot;PayPal payment ID: &quot; + created.getId();<br>        } catch (PayPalRESTException e) {<br>            return &quot;PayPal payment failed: &quot; + e.getMessage();<br>        }<br>    }<br>}<br><br>class PaymentProcessor {<br>    private final PaymentStrategy strategy;<br><br>    public PaymentProcessor(PaymentStrategy strategy) {<br>        this.strategy = strategy;<br>    }<br><br>    public String execute(int amount) {<br>        return strategy.pay(amount);<br>    }<br>}<br><br>// Usage<br>PaymentProcessor processor = new PaymentProcessor(new PayPal());<br>System.out.println(processor.execute(200));</pre><pre>// TypeScript<br>type PaymentStrategy = (amount: number) =&gt; Promise&lt;void&gt;;<br><br>const payWithStripe: PaymentStrategy = {<br>  pay: (amount) =&gt; stripe.charge({ amount, currency: &#39;USD&#39; }),<br>};<br><br>const payWithPayPal: PaymentStrategy = {<br>  pay: (amount) =&gt; paypal.executePayment({ total: amount }),<br>};<br><br>type PaymentMethod = &#39;stripe&#39; | &#39;paypal&#39;;<br><br>interface UserContext {<br>  userId: string;<br>  preferredPaymentMethod: PaymentMethod;<br>}<br><br>const getStrategyForUser = (user: UserContext): PaymentStrategy =&gt; {<br>  switch (user.preferredPaymentMethod) {<br>    case &#39;stripe&#39;:<br>      return payWithStripe;<br>    case &#39;paypal&#39;:<br>      return payWithPayPal;<br>    default:<br>      throw new Error(`Unsupported payment method: ${user.preferredPaymentMethod}`);<br>  }<br>};<br><br>const processPayment = async (<br>  user: UserContext,<br>  amount: number<br>): Promise&lt;void&gt; =&gt; {<br>  const paymentStrategy = getStrategyForUser(user);<br>  await paymentStrategy.pay(amount);<br>};<br><br>// --- Usage Example ---<br>const user: UserContext = {<br>  userId: &#39;uuid-987&#39;,<br>  preferredPaymentMethod: &#39;paypal&#39;,<br>};<br><br>await processPayment(user, 129.99);</pre><p>This isn’t “just polymorphism” or “just a callback.” This is enabling runtime selection of interchangeable behaviour. If you’re building plugins, payment processors, or serialisation formats, you’ve almost certainly reached for Strategy without knowing it.</p><p>Recognising this allows you to avoid subclass sprawl, keep behaviours isolated and test components independently.</p><h3>Layering behaviour with clean extension</h3><blockquote>Decorator allows behaviour to be added to individual objects, dynamically, without modifying the original code — unlike subclassing.</blockquote><pre># Python<br>from datetime import datetime<br><br>class Logger:<br>    def log(self, message: str):<br>        raise NotImplementedError<br><br>class ConsoleLogger(Logger):<br>    def log(self, message: str):<br>        print(message)<br><br>class TimestampLogger(Logger):<br>    def __init__(self, wrappee: Logger):<br>        self.wrappee = wrappee<br><br>    def log(self, message: str):<br>        timestamp = datetime.now().isoformat()<br>        self.wrappee.log(f&quot;{timestamp} - {message}&quot;)<br><br># --- Usage ---<br>logger = TimestampLogger(ConsoleLogger())<br>logger.log(&quot;Service started&quot;)</pre><pre>// JAVA<br>interface Logger {<br>    void log(String message);<br>}<br><br>class ConsoleLogger implements Logger {<br>    public void log(String message) {<br>        System.out.println(message);<br>    }<br>}<br><br>class TimestampLogger implements Logger {<br>    private Logger wrappee;<br><br>    public TimestampLogger(Logger wrappee) {<br>        this.wrappee = wrappee;<br>    }<br><br>    public void log(String message) {<br>        long ts = System.currentTimeMillis();<br>        wrappee.log(ts + &quot; - &quot; + message);<br>    }<br>}<br><br>// Usage<br>Logger logger = new TimestampLogger(new ConsoleLogger());<br>logger.log(&quot;Hello&quot;);</pre><pre>// TypeScript<br>type Logger = (msg: string) =&gt; void;<br><br>const baseLogger: Logger = (msg) =&gt; console.log(msg);<br><br>const withTimestamp = (logger: Logger): Logger =&gt; (msg) =&gt; {<br>  const ts = Date.now();<br>  logger(`${ts} - ${msg}`);<br>};<br><br>// Usage<br>const logger = withTimestamp(baseLogger);<br>logger(&quot;System started&quot;);</pre><p>If you’ve ever wrapped a function or middleware, added tracing to an API, or extended logging in a clean way, then you’ve used <strong>Decorator</strong>.</p><p>The pattern helps layer responsibilities while keeping each component’s logic orthogonal. Unlike inheritance, which bakes extension into the hierarchy, Decorator makes composition explicit.</p><h3>Why patterns matter as a tool for Team Communication</h3><p>You don’t need to label every class SomethingFactory or slap Strategy into your filenames. That’s not the point.</p><p>Patterns matter because they give us a shared way to talk about code. That’s it.</p><p>When you can identify a familiar pattern in a code review or design session, you shortcut entire explanations. Instead of walking through abstract concepts or vague architecture diagrams, you can simply say:</p><blockquote>Let’s use a decorator here<br>Feels like we’re reinventing a visitor<br>This is acting like a repository, right?</blockquote><p>That kind of language <strong>aligns everyone quickly</strong>. It cuts through the noise and saves time. You don’t need to be pedantic or drop GoF names — you just need to <strong>know the shapes</strong>, recognise them, and call them when it counts.</p><p>That’s how teams move faster — not by over-engineering, but by speaking the same design language without needing to explain it from scratch every time.</p><h3>Write with intent, not just instinct</h3><p>Every design pattern was created because developers kept solving the same problem in slightly different ways until a <a href="https://www.digitalocean.com/community/tutorials/gangs-of-four-gof-design-patterns">group</a> decided to define the shape of the solution and give it a name.</p><p>So the next time you’re writing code and you are solving a problem that feels general — object creation, behaviour injection, layering logic — <strong>don’t reinvent it</strong>.</p><p><a href="https://sourcemaking.com/"><strong>Look it up</strong></a>. There’s probably a <a href="https://saurabh-s-sawant.github.io/2024-04-21-GoFDesignPatterns/?utm_source=chatgpt.com">pattern</a> for it.</p><p><strong>Knowing when a pattern applies is a mark of engineering maturity.</strong></p><p>If you found this content valuable, give it a clap (or 50!) and follow me for more deep dives like this.</p><p>m∫m</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb60d4501b86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I don't know Docker, where to start?]]></title>
            <link>https://milmeninos.medium.com/i-dont-know-docker-where-to-start-9f629e76de1d?source=rss-4574c5345819------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f629e76de1d</guid>
            <category><![CDATA[beginner]]></category>
            <category><![CDATA[how-to]]></category>
            <category><![CDATA[composition]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Milhomem]]></dc:creator>
            <pubDate>Sat, 11 Sep 2021 08:58:59 GMT</pubDate>
            <atom:updated>2021-09-11T08:58:59.357Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1jSulKH60RCw1E9xIfSyGg.jpeg" /><figcaption>Photo By Isa Zapata, Food Styling By Pearl Jones</figcaption></figure><h3>Run one thing per container</h3><p>Don&#39;t use <a href="http://supervisord.org/"><strong>Supervisor</strong></a> inside a container! Docker principle is to have one single process per container and adopt composition. Think of a container as a single binary that will always do the same thing. The intent is to make things modular and we should try our best do to that, but that is still super hard.</p><p>You don&#39;t need <strong>Supervisor </strong>anymore if you have proper containers. Docker will take the responsibility of monitor and restart all containers when needed.</p><h3>Don&#39;t create your first Dockerfile</h3><p>Yes, don&#39;t start there. Things can get very complex when you start writing your own Dockerfile. Opt-in for using a <a href="https://hub.docker.com/">Docker hub</a> image or <a href="https://docs.docker.com/docker-hub/official_images/">an official image</a> instead.</p><p>Creating your own image is an advanced feature of Docker and hard to use properly, let it be for when you are more familiar with how Docker works.</p><p><a href="https://hub.docker.com/">Hub</a> is where you are going to get base images from the most famous open-source projects, all ready-ish for you to use.</p><p>Later, when you have to create your own images, you can also push and host them on the Docker hub for free.</p><h3>Start with Docker Compose</h3><p>It&#39;s easier to understand a simple compose Yaml file rather than trying to understand the underlying Docker CLI syntax. Start with <a href="https://docs.docker.com/compose/install/">docker composer</a> and a few docker command line commands to get used to things.</p><p>See this simple <a href="https://pt.wikipedia.org/wiki/LAMP">LAMP</a> example. Download the following files in a folder:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a337731388c2387f7ae80610e50faf51/href">https://medium.com/media/a337731388c2387f7ae80610e50faf51/href</a></iframe><p>Now run, from inside the folder:</p><pre>MYSQL_ROOT_PASSWORD=test \<br>docker compose up</pre><p>Open your browser on <a href="http://localhost:8080/">http://localhost:8080</a> and you will have your 3 containers connected and talking to each other.</p><p>Once you are done, hit ctrl + c to stop all containers. If you want to keep it running for longer, in the background, append --detach to the docker command.</p><h3>Always use the same image for dev and prod</h3><p>Making sure <strong>dependencies </strong>are met across all environments is what Docker is trying to solve. If you manage to use the same image in dev and prod, you will not only make it easier to deploy but it will be consistent after testing and QA.</p><p>Avoid installing dependencies on your local computer. Execute things on containers instead.</p><p>But how to create containers that can handle the differences from environments? That is the composition challenge!</p><h3>What to do next?</h3><ul><li>Create your own Dockerfile</li><li>Publish your first image to Docker Hub or to a private repository</li><li>Learn how to use Environment variables to deploy the same image in different environments</li></ul><ul><li><a href="https://medium.com/@shakyShane/laravel-docker-part-1-setup-for-development-e3daaefaf3c">Laravel + Docker Part 1 — setup for Development</a></li><li><a href="https://dev.zavrel.net/docker-and-docker-compose-for-php-development-with-github-and-digital-ocean-deployment-98df55002f3c">Docker and Docker Compose for PHP development with GitHub and Digital Ocean deployment</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f629e76de1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use Nginx Docker with Environment Variables]]></title>
            <link>https://milmeninos.medium.com/how-to-use-nginx-docker-with-environment-variables-1de1e210e0?source=rss-4574c5345819------2</link>
            <guid isPermaLink="false">https://medium.com/p/1de1e210e0</guid>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[proxy]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[php-fpm]]></category>
            <category><![CDATA[environment-variables]]></category>
            <dc:creator><![CDATA[Milhomem]]></dc:creator>
            <pubDate>Wed, 16 Jun 2021 12:37:26 GMT</pubDate>
            <atom:updated>2021-07-18T11:28:57.107Z</atom:updated>
            <content:encoded><![CDATA[<p>Two years ago I was automating a lot of things with Docker. I&#39;ve always enjoyed using Nginx as a proxy for any FCGI server I was managing as it provides robust and complex processing of HTTP requests and can easily proxy it to FCGI. But one thing was always bothering me: having to create a new image for every small variance required for Nginx.</p><p>No more! I&#39;ve then decided to create my own image that supported environment variables out-of-the-box. Why not?! Inspired by <strong>The Twelve Factors </strong>and everything I do related to DevOps I rely on environment variables. This makes life easier and deployment seamless forcing the application to forget about what environment it is and being portable.</p><p>The result is this image <a href="https://hub.docker.com/r/milhomem/nginx">milhomem/nginx</a>, and I love to demonstrate its power using simple docker-compose files. I will use real-life examples that I did recently.</p><p>To start with, a simple static content server. All I have to do is open port 80 and map my public folder to the traditional /html one:</p><pre>static-web:<br>     image: milhomem/nginx<br>     ports:<br>       - &quot;80:80&quot;<br>     volumes:<br>       - ${PWD}/public:/usr/share/nginx/html</pre><p>Nothing special on the above, but any &quot;complex&quot; configuration requires a change of default.conf, or add a different CMD, or even having to copy files to docker while building a new image.</p><p>Well, that was before. Now if I want to change the matching hostname I can simply pass the NGINX_HOST environment variable and done:</p><pre>static-web:<br>     image: milhomem/nginx<br>     ports:<br>       - &quot;80:80&quot;<br>     environment:<br>       NGINX_HOST: &#39;192.168.99.100.xip.io&#39;<br>     volumes:<br>       - ${PWD}/public:/usr/share/nginx/html</pre><p>Another case where my Fonts were not served through the normal setup because while consuming the static files from another domain I had it blocked by CORS. Instead of hard-coding it or creating a new image, I&#39;ve replaced the template file in the image and add a new variable ALLOW_ORIGIN that I can change per container configuration.</p><pre>static-web:<br>     image: milhomem/nginx<br>     environment:<br>       ALLOW_ORIGIN: &#39;*&#39;<br>     volumes:<br>       - ${PWD}/docker/nginx/assets.tpl:/etc/nginx/conf.d/assets.rules.template<br>       - ${PWD}/public:/usr/share/nginx/html</pre><p>If you are curious about the <strong>assets.tpl</strong> file is just a location configuration:</p><pre># Cache static assets<br>location ~ \.(ico|png|gif|jpg|jpeg|css|js|eot|ttf|woff|woff2|svg|pdf) {<br>    expires modified 10d;<br>    log_not_found off;<br>    try_files $uri =404;<br><br>    if ($uri ~* \.(eot|ttf|woff|woff2|svg)$) {<br>        add_header Access-Control-Allow-Origin ${ALLOW_ORIGIN};<br>    }<br>}</pre><p>Moving further, my favourite is to enable me to route my HTTP requests to my FCGIs, in this case, a PHP-FPM server. How painful would be to have to write the rewrite and to &quot;align&quot; the path names between the containers? Not with env vars.</p><pre>static-web:<br>  image: milhomem/nginx:php<br>  environment:<br>    FASTCGI_HOST: &quot;php-fpm-server&quot;<br>    FASTCGI_FILES_ROOT: &quot;/var/www/html/public&quot;<br>    STATIC_FILES_ROOT: &quot;/var/www/html/public&quot;<br>  volumes:<br>    - ${PWD}/public/:/var/www/html/public/</pre><pre>php-fpm-server:<br>   image: php:7.4-fpm<br>   volumes:<br>     - ${PWD}/:/var/www/html/</pre><p>I recently noticed that the new Nginx 1.19 adopted the exact same approach, but still, mine has some nice common setup for PHP and my intent is that the community could add or request a flavour for any language.</p><p>It is much easier when you can compose the containers images without having to keep rebuilding and customising everything.</p><p>I hope this image helps you to get quick setups for your web app containers too! Please star, file an issue, or contribute to this open-source project at <a href="https://github.com/milhomem/nginx">https://github.com/milhomem/nginx</a>.</p><p>m∫m</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1de1e210e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tackling DNS issues on Android]]></title>
            <link>https://milmeninos.medium.com/tackling-dns-issues-on-android-494cca1f6d7?source=rss-4574c5345819------2</link>
            <guid isPermaLink="false">https://medium.com/p/494cca1f6d7</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Milhomem]]></dc:creator>
            <pubDate>Mon, 14 Jun 2021 08:58:16 GMT</pubDate>
            <atom:updated>2021-06-14T08:58:16.695Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey there! In my first post here I’ll go through a DNS issue that haunted us for some years and explain how we dealt with it. I’m Gustavo by the way, the Android team’s tech lead.</p><p>A <strong>Domain Name System (DNS)</strong> is a hierarchical distributed database that primarily translates hostnames like “easytaxi.com” into IP addresses like “104.20.3.124” (IPv4) or “3ffe:1900:4545:3:200:f8ff:fe21:67cf” (IPv6), so we don’t have to remember all of these characters. DNS also works great as a scalability tool providing the first level of load balancing, retrieving different server IP addresses possibly based on the user’s current geolocation in order to reduce latency. Besides that, it can also be a major source of headache that can cost your business a lot of money by driving users away due to a poor experience.</p><p>In Easy Taxi it was very common from time to time to notice huge drops of active users (drivers and passengers) of a given country due to DNS-related issues. Our API couldn’t be reached because the apps simply couldn’t find its IP address, that is, they faced a lookup or name resolution problem.</p><p>Every solution to a problem sooner or later creates new problems to solve. While solving many issues of the Internet, there is a hidden cost when relying on DNS that many of us ignore: although it’s transparent, it’s not magical. Besides consuming valuable time to execute, DNS queries can and will fail from time to time either because of human mistakes or availability issues somewhere. Since this kind of problem happens on the client-side, you may be wondering how we can defend ourselves from it. First of all, there are smart DNS services clients can use, like <a href="https://aws.amazon.com/route53/">Amazon’s Route 53</a> that provides a health-check feature. If your server goes down, its host’s IP address won’t be returned to the users until it gets online again. This is particularly useful if you have multiple server nodes.</p><p>The thing is, it isn’t enough to have a super-smart DNS service because your end-users will probably use something else, to begin with. Internet Service Providers (ISP) and cellphone network operators define the DNS services that are going to be used when your computer or mobile device first connects to them — normally they provide two options to favor redundancy. Our experiences show that they have high failure rates. There are faster, safer and more reliable third party options though. Want to see for yourself? There is a neat tool called <a href="http://www.howtogeek.com/howto/16372/find-a-faster-dns-server-with-namebench"><strong>namebench</strong></a> (Linux version) that allows one to do some DNS benchmarking. After you come up with an alternative service, all you need to do is configuring your internet connection to use it or even better, configure your router/switch to use it. But how to control the DNS services your users will use? Most of them will have a really hard time tweaking this, so asking them to do so is simply not acceptable.</p><p>On Android, we’re in control of the client side. We could even change the user’s connection settings but that’s way too intrusive, hence, not acceptable as well. The best approach we have found was to use a library called <a href="http://www.dnsjava.org/"><strong>dnsjava</strong></a> to perform the name resolution using the specific DNS services we wanted. In case one service fails, the next will be used. As a last resort, we retrieve a static IP in case we’re trying to lookup our API’s address. Since we use <a href="http://square.github.io/okhttp/"><strong>OkHttp</strong></a> to perform HTTP connections, the integration with this lib was very simple to do, as I will demonstrate in the following code snippet.</p><pre>import com.squareup.okhttp.Dns;<br> <br>import org.xbill.DNS.Address;<br>import org.xbill.DNS.ExtendedResolver;<br>import org.xbill.DNS.Lookup;<br>import org.xbill.DNS.Resolver;<br>import org.xbill.DNS.SimpleResolver;<br> <br>import java.net.InetAddress;<br>import java.net.UnknownHostException;<br>import java.util.Collections;<br>import java.util.List;<br> <br>public class <strong>EasyDns</strong> implements <strong>Dns</strong> {<br> <br>    private static final String <strong>LIVE_API_HOST</strong> = &quot;easytaxi.com.br&quot;;<br>    private static final String <strong>LIVE_API_IP</strong> = &quot;1.2.3.4&quot;;<br> <br>    private boolean mInitialized;<br>    private InetAddress mLiveApiStaticIpAddress;<br> <br>    <a href="http://twitter.com/Override">@Override</a><br>    public List&lt;InetAddress&gt; lookup(String hostname) throws UnknownHostException {<br>        // I&#39;m initializing the DNS resolvers here to take advantage of this method being called in a background-thread managed by OkHttp<br>        init();<br>        try {<br>            return Collections.singletonList(Address.getByName(hostname));<br>        } catch (UnknownHostException e) {<br>            // fallback to the API&#39;s static IP<br>            if (<strong>LIVE_API_HOST</strong>.equals(hostname) &amp;&amp; mLiveApiStaticIpAddress != null) {<br>                return Collections.singletonList(mLiveApiStaticIpAddress);<br>            } else {<br>                throw e;<br>            }<br>        }<br>    }<br> <br>    private void init() {<br>        if (mInitialized) return; else mInitialized = true;<br> <br>        try {<br>            mLiveApiStaticIpAddress = InetAddress.getByName(<strong>LIVE_API_IP</strong>);<br>        } catch (UnknownHostException e) {<br>            Log.w(“DNS”, &quot;Couldn&#39;t initialize static IP address&quot;);<br>        }<br> <br>        try {<br>            // configure the resolvers, starting with the default ones (based on the current network connection)<br>            Resolver defaultResolver = Lookup.getDefaultResolver();<br>            // use Google&#39;s public DNS services<br>            Resolver googleFirstResolver = new <strong>SimpleResolver(&quot;8.8.8.8&quot;);</strong><br>            Resolver googleSecondResolver = new <strong>SimpleResolver(&quot;8.8.4.4&quot;);</strong><br>            // also try using Amazon<br>            Resolver amazonResolver = new <strong>SimpleResolver(&quot;205.251.198.30&quot;);</strong><br>            Lookup.setDefaultResolver(<br>                new ExtendedResolver(new Resolver[]{<br>                       defaultResolver,<br>                       googleFirstResolver,<br>                       googleSecondResolver,<br>                       amazonResolver<br>                })<br>           );<br>        } catch (UnknownHostException e) {<br>            Log.w(“DNS”, &quot;Couldn&#39;t initialize custom resolvers&quot;);<br>        }<br>    }<br> <br>}</pre><p>It’s very simple to activate this configuration on <strong>OkHttp 2.6+</strong>, just call <strong>OkHttpClient.setDns</strong> passing an instance of the class above.</p><p>That’s it so far. I hope I can share some statistics in a future post. Let me know if it was useful to you!</p><p>References:<br><a href="https://web.archive.org/web/20160312094914/http://highscalability.com/blog/2013/9/16/the-hidden-dns-tax-cascading-timeouts-and-errors.html">http://highscalability.com/blog/2013/9/16/the-hidden-dns-tax-cascading-timeouts-and-errors.html</a><br><a href="https://web.archive.org/web/20160312094914/http://www.howtogeek.com/167239/7-reasons-to-use-a-third-party-dns-service/">http://www.howtogeek.com/167239/7-reasons-to-use-a-third-party-dns-service/</a></p><p>December 11, 2015<br>By Gustavo Steigert, Sofware Engineer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=494cca1f6d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[May the Force Be with You!]]></title>
            <link>https://milmeninos.medium.com/may-the-force-be-with-you-21576b703e67?source=rss-4574c5345819------2</link>
            <guid isPermaLink="false">https://medium.com/p/21576b703e67</guid>
            <category><![CDATA[star-wars]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[easy-taxi]]></category>
            <dc:creator><![CDATA[Milhomem]]></dc:creator>
            <pubDate>Mon, 14 Jun 2021 08:57:57 GMT</pubDate>
            <atom:updated>2021-06-14T08:57:57.469Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A LONG TIME AGO IN A GALAXY FAR FAR AWAY</em></p><p>Star Wars movie was launched. It created a big impact by bringing a world full of wonders and expanded our imagination! A New Hope has come!</p><p>This is exactly how we feel at Easy Taxi. Partnering with Disney, we have changed driver and passenger icons in the Android application in honoring the Star Wars movie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*M0WiyKmI-4jh_vo8" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*rSRySnikKlw6dMzJ" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*xp1Na-SO1rHFxBoF" /></figure><p>We did this because we are Star Wars’ fans (and who isn’t) and that is a good enough reason, which represents exactly what we are accomplishing here.</p><p>For a long period of time, we have suffered the burdens of growth, and we deviated from our path…</p><blockquote>“Fear is the path to the dark side.” — Yoda</blockquote><p>This created twisted feelings within our company making everyone lose their faith, hope…</p><blockquote>[Luke:] I can’t believe it.<br>[Yoda:] That is why you fail.</blockquote><p>…but we are now back on track!</p><p>As mentioned in the previous posts, motivation and innovation are the keys that are essential for a software company to thrive. And we should never forget about that!</p><blockquote>“Always pass on what you have learned”- Yoda</blockquote><p>And we are still learning! There are so much to learn… This action is having a great impact! Users are talking about us on Instagram and Facebook.</p><p>With a simple idea, the right motivation and incremental code changes, we can make a big impact.</p><p><em>Simple = Doable<br>Motivation = Meaningful, people are happy to do it<br>Small Code Change = Easy, not a burden<br>Impact = Delight our users, both drivers and passengers</em></p><p>And for sure we will continue learning more!</p><p><em>A </em><strong><em>New Hope</em></strong><em> has come to </em><strong><em>Easy Taxi</em></strong><em>. Prepare for the </em><strong><em>Return of Jedi!</em></strong></p><p><strong><em>The Force Awakens!</em></strong></p><p><strong><em>May the force be with you!</em></strong></p><p>December 17, 2015<br>By Eduardo Iwai, Former CPO at Easy Taxi</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21576b703e67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Redash?]]></title>
            <link>https://milmeninos.medium.com/what-is-redash-1715e105e778?source=rss-4574c5345819------2</link>
            <guid isPermaLink="false">https://medium.com/p/1715e105e778</guid>
            <category><![CDATA[easy-taxi]]></category>
            <category><![CDATA[redash]]></category>
            <category><![CDATA[bi]]></category>
            <dc:creator><![CDATA[Milhomem]]></dc:creator>
            <pubDate>Mon, 14 Jun 2021 08:57:21 GMT</pubDate>
            <atom:updated>2021-06-14T08:57:21.484Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://github.com/getredash/redash">Redash</a> is an open-source data collaboration platform that enables you to connect to any data source, visualize data and share it.</p><p>Here at Easy Taxi, we use it mainly to enable our Regionals BIs to connect to their BigQuery projects so that they can create dashboards facilitating the decision-making process for business units.</p><p>This tutorial is to help beginners who need to create dashboards on the platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*snHePbqnBCy6tBki" /></figure><h3>How to create a dashboard</h3><p>Dashboard is composed of widgets, which can be any visualization created from the query source page. The dashboard is created by clicking on the “New Dashboard” button on the homepage, assigning it a name and then clicking on the “save” button.</p><blockquote>You can also, at any time, create a dashboard by clicking on the dropdown menu on the fixed navbar.</blockquote><p>After this, we have only an empty page with the dashboard name. The next steps will explain how to create the widgets to fill the dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*eOZYSU9OYocZURLr" /></figure><h3>Create query</h3><p>Redash comes with an interface to write and run queries on the platform. At the time of writing, the native UI is still a bit primitive. <a href="https://cloud.google.com/bigquery/bigquery-web-ui">BigQuery’s Web UI</a> is the best option to compose queries.</p><p>We recommend you compose queries in BigQuery Web UI and then save them in Redash.</p><p>Just click on the “New Query” button, type a name to your query (otherwise it will be considered a draft), copy and paste the query inside of the text area and click on the “save” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*eeO7rieWJkObE5Ni" /></figure><p>Optionally you can write a description for the query that will be shown right before the query title in the dashboards.</p><blockquote>Make sure that you chose the right datasource on the sidebar.</blockquote><blockquote>You can also, at any time, create a query by clicking on the dropdown menu on the fixed navbar.</blockquote><h3>Create visualizations for the query</h3><p>All saved queries by default have a ‘Table’ visualization created. You can create more visualizations after the query runs for the first time.</p><p>The options are:</p><ul><li>Chart</li><li>Cohort</li><li>Counter</li><li>Map</li></ul><p>And more and more visualizations are coming.</p><p>Click on the “+ New Visualization” button, select Visualization type, set a name and options for the visualization, and then click “save”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*fE33KrllVt-7rqM-" /></figure><blockquote>Certain visualizations need a specific query output structure.</blockquote><blockquote>Use the <a href="http://demo.redash.io/">Redash demo instance</a> to see what you can achieve, try out all the things, and learn how to prepare the query to bring, for example, <a href="http://demo.redash.io/queries/67#84">Cohorts visualizations</a> to dashboards. It’s very cool.</blockquote><h3>Attach visualizations to dashboard</h3><p>Finally, after creating queries and visualizations for them, we can add widgets to our dashboards. Click on the “+” button and the screen below will be showed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*zPBlqWkFLm_691J9" /></figure><p>Type the name of the query to see the visualizations available for the query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*mg3cOD7XQGrhLOr_" /></figure><p>Choose the visualization, optionally set the widget’s size (Regular or Double) and click the “Add to Dashboard” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/0*xhwT03Uqc9W5U6uJ" /></figure><p>That’s it! Now we have a dashboard with a widget. This is a very basic example.</p><p>Had we written a query that actually queries data on the data source we could click on the update button (to the right of dashboard name) and the dashboard would be auto-refreshed to bring new data in the scheduled time previously set on the query page.</p><p>December 10, 2015<br>By Wesley Batistas, BI Analyst</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1715e105e778" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy Taxi Community Giving Thanks for being with us in 2015]]></title>
            <link>https://milmeninos.medium.com/easy-taxi-community-giving-thanks-for-being-with-us-in-2015-357733441c2f?source=rss-4574c5345819------2</link>
            <guid isPermaLink="false">https://medium.com/p/357733441c2f</guid>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[easy-taxi]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[gps]]></category>
            <category><![CDATA[cities]]></category>
            <dc:creator><![CDATA[Milhomem]]></dc:creator>
            <pubDate>Sat, 12 Jun 2021 09:36:15 GMT</pubDate>
            <atom:updated>2021-06-12T09:36:15.928Z</atom:updated>
            <content:encoded><![CDATA[<p>Easy Taxi has solidified its position as the leading LATAM ride-hailing app completing <strong>over 130 million rides since inception. </strong>As a marketplace, growth was heavily driven by the development of both our driver and passenger community. Easy Taxi now serves <strong>more than 500,000 registered drivers </strong>with <strong>more than 25 million passengers who have downloaded the app</strong>!</p><p>As we enter 2016, it is inspiring to look back and measure our achievements of the past year, which has been spectacular. During 2015, we have achieved an impressive <strong>83 million rides globally. Within a single month, Easy Taxi completes more than 8 million rides and registers 16,000+ taxi drivers </strong>into its platform. The growth was mainly a result of customer satisfaction for a great service, which accounts for more than 60% of users coming from recommendations of friends and family.</p><p>Last year, <strong>Easy Taxi</strong> also joined forces with <strong>Tappsi</strong>, the 2nd largest taxi app in Colombia. Together, we have a 90% market share in Colombia. This is a strategic consolidation of the market similar to the <strong>Kuiadi+Didi</strong> merger in China. For 2016, Easy Taxi is bullish on growth by ignoring the current economic and political conditions in Brazil as a threat. The Brazilian ride-hailing app sees a lot of room to grow as only 10% of taxi rides are currently booked by applications. In addition, the majority of Easy Taxi’s business comes from other countries in Latin America.</p><p>In a sign of gratitude, our data team has ventured into the creative world to draw a series of panels using <strong>python</strong> and <strong>matplotlib</strong>. We like to say these are the first maps drawn using the pointillism technique :).</p><blockquote><strong>Each yellow dot plotted against the dark background represents a successful ride in 2015.</strong></blockquote><p>We hope to lighten up cities, even more, this year! Have a great 2016!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*dM8OS5BhBSqIYidG-pbeaw.png" /></figure><p>January 22, 2016<br>By Fernando Paiva, Big Data Engineer</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=357733441c2f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Innovation and Master Chef]]></title>
            <link>https://milmeninos.medium.com/innovation-and-master-chef-a8ebfbbfa0d5?source=rss-4574c5345819------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8ebfbbfa0d5</guid>
            <category><![CDATA[direct-connect]]></category>
            <category><![CDATA[vision]]></category>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[easy-taxi]]></category>
            <category><![CDATA[creativity]]></category>
            <dc:creator><![CDATA[Milhomem]]></dc:creator>
            <pubDate>Sat, 12 Jun 2021 09:28:00 GMT</pubDate>
            <atom:updated>2021-06-12T09:28:00.816Z</atom:updated>
            <content:encoded><![CDATA[<p>People love to watch TV shows like Master Chef. Wonderful cakes and innovative dishes and surpassing their customer expectation and audience.</p><p>And this is what this is text is about… Why can they do that? Why they are so successful?</p><p>In Easy Taxi we almost killed the creativity and innovation in the past.</p><p>When you are a new startup, you start with creativity, innovation, however when you start to grow, you start to lose it.</p><p>Why do we end up losing innovation?</p><p>We lose control because it is easier when you have more people involved. And the most obvious action would be to control it back.</p><p>However, the problem is how you do it. One way is to start detailing the tasks and delegating small parts, to each employee.</p><p>Imagine if you instead of requesting a dish to a chef, but tell him how to chop the onions (in a triangle shape), when to turn the stake so it does not get burned, set that the temperature of the oven should not be more than 203 degrees Celsius to cook the gravy, which should use only use soy sauce, from a specific brand from the monastery from Hokkaido and you should only use 2 drops only… The chef will probably reply to you with some nasty words (imagine what chef Ramsey reaction). Also, this limits totally how the chef will prepare the meal.</p><p>Now split each of the tasks each one trying to do the same plate: one person chops the onion, one turns the stake, another bakes the lasagna. If the guy that chops the onion does not chop it at the time to be grilled with the stake, it will hold the one that is doing the stake and if the gravy was not ready before the stake, it will get cold, especially if you didn’t tell them that the objective is to have a single plate (Stake with caramelized onions) with all the ingredients.</p><p>You don’t need to tell a chef how to cook… You cannot limit him to do his own cooking or his creativity. As the Master Chef show, just ask for a dish and he will delight you!</p><p>The same applies to building a product and development. You need to request what is necessity by giving the right vision and goals to the <strong>IT Team</strong>. Let them be <strong>creative</strong>!<br>Not only they will be motivated but really go deep into the cause. They will provide you with the best meal ever.</p><p>And if you want to be surprised with a dessert, <a href="https://milmeninos.medium.com/easy-innovations-9a67cb282cdc"><strong>Free Code Friday</strong></a> on top, without any restriction. You will be delighted at how innovative your team can be!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/0*1QQSEv390loqBbax" /></figure><p>Our newest feature is such a wonderful dessert. Called internally as <strong>Direct Connect</strong>, it enables you to board any <a href="https://web.archive.org/web/20160310235533/http://www.easytaxi.com/"><strong>Easy Taxi</strong></a> and connect directly to that particular driver to faster enjoy our experience! An idea that our Master Chefs developed that is delighting our clients. We can see the reaction from our clients by their comments, shares and likes!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/0*wx4cwQ8PsRrXr-cV" /><figcaption>3.6k likes and 408 shares</figcaption></figure><p>January 26, 2016<strong><br>By <em>Eduardo Iwai, Former CPO at Easy Taxi</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8ebfbbfa0d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy Innovations]]></title>
            <link>https://milmeninos.medium.com/easy-innovations-9a67cb282cdc?source=rss-4574c5345819------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a67cb282cdc</guid>
            <category><![CDATA[easy-taxi]]></category>
            <category><![CDATA[free-code-friday]]></category>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[empowerment]]></category>
            <dc:creator><![CDATA[Milhomem]]></dc:creator>
            <pubDate>Sat, 12 Jun 2021 09:23:17 GMT</pubDate>
            <atom:updated>2021-06-12T09:23:17.346Z</atom:updated>
            <content:encoded><![CDATA[<p>We have started running Free Code Fridays (FCF) at Easy Taxi for a couple of months. Innovative Companies like Google popularized this concept by encouraging developers to dedicate 20% of their working hours to create something new while improving and expanding their technical chops. When administered properly, FCF generates a win-win situation for the company and its employees.</p><h4>Benefits for employees</h4><ul><li>Encourage learning: To stay competitive in the high-tech industry, one must constantly learn new technologies including programming languages, frameworks, and better ways of automating things. Startup often comes with a high pressured environment due to an aggressive roadmap delivery schedule and leaves little breathing room to explore better solutions instead of existing ones where less learning is required. FCF provides a playing ground where curious developers can survey what is out there and bring in technology that can improve the existing stack.</li><li>Motivate people: Motivated people are more productive and can build better software than unmotivated people working long hours under stress. FCF empowers developers by becoming artisans for code and creators of the new digital trend. Engineers can gain great satisfaction from fruitful activities and stay engaged with the company.</li><li>Foster collaboration: In a large IT organization, people are siloed functionally. There is a lack of communication amongst teams. Very often, the nature of FCF projects demand close collaboration and interaction between members of different functional teams. Quite often an API developer may want to dip their feet into mobile development and vice versa. This simple process encourages a holistic understanding of the software system.</li></ul><h4>Benefits for company</h4><ul><li>Product innovation: No one tells the artists what to create, their minds lead them. There is something magically inexplicable that happens on the cognitive level of human minds. An outsider is often wow’ed at the result of FCF activities, where product innovation that doesn’t come directly from product requirements defined in the roadmap.</li><li>Motivated employees: Salaries and perks are not long-lasting motivations. People seek for meaningful work. FCF acts as a collaborative dial that balances what company perceives to be useful with that of employees’.</li></ul><h4>Structure Within Freedom</h4><p>There are some basic guidelines that are generally applicable to ensure a successful FCF.</p><ul><li>Keep the scope small and realistic: FCF is just one day. The goal is to produce sufficient result that can illustrate the core idea. We want to avoid long-running projects over 3 weeks or sometimes months. People can lose interests in the same subject and it becomes less fun and attractive. If one can demonstrate the feasibility of the product and gain approval, then the FCF project graduates and enters the roadmap.</li><li>Sense of accomplishments: Go live. Have real users using it. It sounds simple but could be hard logistically, even after product buy-in.</li><li>Sufficient Preparation: Folks should formulate ideas a few days ahead of time and forming teams when applicable. Friday is short, don’t waste precious time negotiating who’s doing what on the day of.</li><li>Optional participation: It’s impractical to expect someone to come up with innovative ideas every Friday. It’s ok to just work on regular roadmap items, fix bugs, or get that desperately needed to refactor in.</li><li>Idea isolation: Business units may think this is a good time for developers to work on that-feature-they-really-wanted. Not so much. FCF is not about telling developers what to do but asking about what they want to do.</li></ul><p>Here are some highlights of the features that have gone LIVE from the last 3 FCFs. I won’t bore you with the complete list here.</p><h4><strong>iOS 9 Spotlight Search, v314</strong></h4><p>Passengers can search ride history and destinations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*cs9ZkY_Cv2X7iblq" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*f4ilwo6xi1Bv-6Jx" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*pNsFT70FuaoNFIiU" /></figure><h4><strong>Corporate Balance, Android V8.3</strong></h4><p>Passengers see their Corporate balance</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*yEX7uNTBaAUlVDvg" /></figure><h4><strong>Driver Heat Maps (Internal)</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*SwmG4V_z3GX0Ky-J" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*b7M8ZFKNVQhsvoUu" /></figure><h4><strong>Easy Debugging (Internal)</strong></h4><p>This dev feature enables dev/QA to easily change the server environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*L1pWQHXYBI5l75Px" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*EE_W570lVAwvcwL5" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/0*57_k_eMHbtqg9YlY" /></figure><p>October 27, 2015<br><strong>By Zhao Lu, Former CIO at Easy Taxi</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a67cb282cdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make Caipirinha using git log]]></title>
            <link>https://medium.com/the-iconic-engineering/how-to-make-caipirinha-using-git-log-4dcd1fb5c53f?source=rss-4574c5345819------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dcd1fb5c53f</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[git-log]]></category>
            <category><![CDATA[commit]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[caipirinha]]></category>
            <dc:creator><![CDATA[Milhomem]]></dc:creator>
            <pubDate>Thu, 05 Apr 2018 01:54:23 GMT</pubDate>
            <atom:updated>2018-04-06T05:46:58.258Z</atom:updated>
            <content:encoded><![CDATA[<h4>Writing good commit messages</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ySh351xeoYBaJGwWeoNRZQ.jpeg" /><figcaption><strong>Brazil’s </strong>national cocktail</figcaption></figure><p>Writing good commit messages is essential and is the best way to justify changes in your code. I know you want to do it but where to start?</p><h3>Be atomic</h3><p>The first thing to do when deciding to commit a set of changes is to make it atomic i.e. make it small enough in a way that it still has logical meaning</p><p>Don’t create all the steps of your recipe in one commit, atomic doesn’t mean all in one:</p><pre><strong>d427050817</strong> Get a glass add some ice cubes and add sugar, place freshly squeezed lime juice, pour 2 shots of cachaça and stir well until combined</pre><p>Do break it into logical steps and join only what makes sense together:</p><pre><strong>d427050817</strong> Get a glass<br><strong>6a442c4d52</strong> Add some ice cubes<br>...</pre><h3>A good message</h3><p>The message is extremely important, so a message that gives the reasons and motivation for change is more useful than the ones that try to describe the change itself. Remember that <strong>Git</strong> saves the difference of your changes and give you the task of describing why it happens that way.</p><blockquote>If all your commit messages look good, things will be a lot easier for you and the developers you work with</blockquote><p>Don’t be short and presume the obvious. It may not be enough to cut the limes in half:</p><pre><strong>d427050817</strong> Get a glass<br><strong>6a442c4d52</strong> Added some ice cubes and lime<br><strong>ff174e64ab</strong> Adding cachaça and stir</pre><p>Do be talkative and as explicit as needed as this can change the taste of your Caipirinha:</p><pre><strong>d427050817</strong> Get a glass<br><strong>6a442c4d52</strong> Add some ice cubes<br><strong>b231494c6d</strong> Place freshly squeezed lime juice<br><strong>ff174e64ab</strong> Pour 2 shots of cachaça</pre><h3>Review</h3><p>Having a story in your git log will make a huge difference in how you and others perceive your project.</p><p>Don’t write a confusing recipe because you wrote the wrong quantity of sugar by mistake:</p><pre><strong>d427050817</strong> Get a glass<br><strong>6a442c4d52</strong> Add some ice cubes<br><strong>b7b9fa56aa</strong> <strong>Add sugar</strong><br><strong>b231494c6d</strong> Place freshly squeezed lime juice<br><strong>8bd07b9259 </strong>Stir well until combined<br><strong>ff174e64ab</strong> <strong><em>Pour 2 shots of cachaça</em></strong><br><strong>449af37029 <em>Reduce quantity of sugar</em></strong></pre><p>Do rewrite into well-organised steps:</p><pre><strong>fod427050817</strong> Get a glass<br><strong>6a442c4d52</strong> Add some ice cubes<br><strong>b7b9fa56aa</strong> <strong>Add sugar</strong><br><strong>449af37029</strong> <strong><em>Reduce quantity of sugar</em></strong><br><strong>b231494c6d</strong> Place freshly squeezed lime juice<br><strong>ff174e64ab</strong> <strong><em>Pour 2 shots of cachaça<br></em>8bd07b9259</strong> Stir well until combined</pre><p>And if necessary squash them together, it may be hard to remove sugar from your recipe after it has been added:</p><pre><strong>d427050817</strong> Get a glass<br><strong>6a442c4d52</strong> Add some ice cubes<br><strong>b7b9fa56aa</strong> <strong>Add sugar</strong><br><strong>b231494c6d</strong> Place freshly squeezed lime juice<br><strong>ff174e64ab</strong> Pour 2 shots of cachaça<br><strong>8bd07b9259 </strong>Stir well until combined</pre><h3>Make it useful</h3><p>Commit messages are all searchable and are always up to date with your code changes. Start using git log now:</p><pre><strong>git log --oneline --grep </strong><em>sugar</em></pre><pre><strong>b7b9fa56aa</strong> Add sugar</pre><p>Isn’t that beautiful? Other useful examples:</p><pre><strong>git log --grep=&quot;</strong><em>lime</em><strong>&quot;<br>git log --author=</strong><em>Milhomem</em><strong><br>git blame<br>git help log</strong></pre><h3>Good or bad?</h3><p>Now look at these real case scenarios and judge by yourself if they&#39;re good or bad.</p><pre>commit <strong>90eafbd</strong></pre><pre>Retry on authentication errors<br> <br>MMCourier API is very unstable. It returns authentication error randomly even when the username and password are ok. We are in contact with them to fix this on their side but in the meantime, this will minimise the impact on packing we are having</pre><pre>diff --git a/MMCourier/Request.php b/MMCourier/Request.php<br>index 8ce765fa11..5272b25bad 100644<br>--- <br>@@ -2,12 +2,14 @@</pre><pre>$client = $this-&gt;getClient($order, $originWarehouse, $carrierOption);<br>                 try {<br>-                    $response = <strong>$client-&gt;book($apiOrder)</strong>;<br>-                    if ($response-&gt;getErrors()) {<br>-                        throw new Exception(&#39;MMCourier booking response contains error&#39;);<br>-                    }<br>+                    $response = <strong>$this-&gt;book($client, $apiOrder)</strong>;<br>+                } catch (AuthenticationException $exception) {<br>+                    $response = <strong>$this-&gt;book($client, $apiOrder)</strong>;<br>                 } catch (Exception $e) {</pre><p>The above looks good as it explains the motivation for calling the same method twice when it’s not logical to do.</p><pre>commit <strong>22d6b10</strong></pre><pre>Fetch the MMCourier zone code properly when printing the label</pre><pre>diff --git a/MMCourier.php b/MMCourier.php<br>index 05e44bdf2d..13244a4d92 100755<br>@@ -54,7 +54,7 @@</pre><pre>$pricesTable = $this-&gt;getShipmentMMCourierPricesTable();<br>-        $result = $pricesTable-&gt;<strong>fetchRow</strong>([&#39;postcode&#39; =&gt; $postcode]);<br>+        $result = $pricesTable-&gt;<strong>findOneByCriteria</strong>([PricesRow::POSTCODE =&gt; $postcode]);<br>         return (int)$result[PricesRow::MMCOURIER_ZONE_CODE] ?? 0;<br>     }<br> }</pre><p>The above looks very bad as it does not explain why <strong>findOneByCriteria() </strong>is better than <strong>fetchRow() </strong>in that case 🤷‍<strong>‍</strong></p><p>Finally everyone’s favourite commit message: WIP 🤦‍</p><pre><strong>git log --oneline --grep </strong><em>WIP</em></pre><pre><strong>37f03b6500</strong> [feature/WEB-983] - WIP; fixes<br><strong>88cbdced75</strong> [feature/WEB-983] - WIP<br><strong>0257da25f2</strong> [feature/WEB-983] - WIP starting to bring everything together<br><strong>fa6e7fde76</strong> [feature/WEB-983] - WIP<br><strong>c6ef670061</strong> [feature/WEB-983] - WIP, bringing it all together<br><strong>463d4ce7af</strong> [feature/WEB-1029] - WIP<br><strong>3aa2eeebeb</strong> [feature/WEB-983] - refactor product page js; WIP<br><strong>5f25bfc921</strong> [feature/WEB-983] - WIP; adapterised oauth service<br><strong>b91658a872</strong> [feature/WEB-983] - WIP<br><strong>854329618f</strong> [feature/WEB-983] - WIP<br><strong>dfb2b1601e</strong> [feature/WEB-983] - WIP</pre><p>I’m sure you’ll never share this kind of commit message anymore 👊</p><p>If you enjoyed this article, please give us a CLAP (or 50!) below and be sure to subscribe to THE ICONIC Tech publication!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dcd1fb5c53f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-iconic-engineering/how-to-make-caipirinha-using-git-log-4dcd1fb5c53f">How to make Caipirinha using git log</a> was originally published in <a href="https://medium.com/the-iconic-engineering">THE ICONIC Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>