<?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"><channel><title><![CDATA[Gatsby Starter Blog RSS Feed]]></title><description><![CDATA[A starter blog demonstrating what Gatsby can do.]]></description><link>https://blog.mateuseap.com</link><generator>GatsbyJS</generator><lastBuildDate>Thu, 23 Jul 2026 20:25:57 GMT</lastBuildDate><item><title><![CDATA[The pursuit of knowledge]]></title><description><![CDATA[I have reached a point in my life where I can clearly understand that famous saying attributed to Socrates: "I know that I know nothing…]]></description><link>https://blog.mateuseap.com/knowledge/</link><guid isPermaLink="false">https://blog.mateuseap.com/knowledge/</guid><pubDate>Wed, 12 Nov 2025 19:00:00 GMT</pubDate><content:encoded>&lt;p&gt;I have reached a point in my life where I can clearly understand that famous saying attributed to Socrates: &quot;I know that I know nothing&quot;.&lt;/p&gt;
&lt;p&gt;The more I learn and study about technology, which is both my work and my passion, and the more I discover about the world we live in, the more I realize how much there still is to learn.&lt;/p&gt;
&lt;p&gt;What I have come to understand over the years is that knowledge is something I will always seek, until my very last moment, because no one can take it away from me. To seek knowledge is to try to understand the world around us, to comprehend society as a whole, and to explore the essence of what it means to be human.&lt;/p&gt;
&lt;p&gt;There is nothing more valuable that I have learned than to appreciate the pursuit of knowledge and to recognize that intelligence is relative. For example, think about the philosopher Diogenes the Cynic. In his time, many people in high society did not see him as a real scholar or thinker, yet even Alexander the Great went to meet him. Not everyone recognized him as a wise man, and that divide over what counts as intelligence and what does not is still very present in today’s society.&lt;/p&gt;
&lt;p&gt;In our modern world, I like to think that intelligence is not limited to the academic pursuing a doctorate. A humble worker living a simple life can be just as wise, because knowledge is free. It exists in books, in daily experiences, and in the world around us. Human beings are complex and capable of learning and growing through countless sources. All it takes is to keep alive the desire to seek knowledge.&lt;/p&gt;
&lt;p&gt;That is my reflection for today. No tech stuff, just toughts :)!&lt;/p&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;166&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot; allow=&quot;autoplay&quot; src=&quot;https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/soundcloud%253Atracks%253A220422667&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;font-size: 10px; color: #cccccc;line-break: anywhere;word-break: normal;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; font-family: Interstate,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Garuda,Verdana,Tahoma,sans-serif;font-weight: 100;&quot;&gt;&lt;a href=&quot;https://soundcloud.com/whereisalex&quot; title=&quot;whereisalex&quot; target=&quot;_blank&quot; style=&quot;color: #cccccc; text-decoration: none;&quot;&gt;whereisalex&lt;/a&gt; · &lt;a href=&quot;https://soundcloud.com/whereisalex/love&quot; title=&quot;i wish you loved me.&quot; target=&quot;_blank&quot; style=&quot;color: #cccccc; text-decoration: none;&quot;&gt;i wish you loved me.&lt;/a&gt;&lt;/div&gt;</content:encoded></item><item><title><![CDATA[Speed up your Python workflow with uv and ruff]]></title><description><![CDATA[Recently, I've been exploring ways to make my Python development workflow faster and cleaner and I discovered an incredible duo:  and . Both…]]></description><link>https://blog.mateuseap.com/uv-ruff/</link><guid isPermaLink="false">https://blog.mateuseap.com/uv-ruff/</guid><pubDate>Fri, 06 Jun 2025 04:05:24 GMT</pubDate><content:encoded>&lt;p&gt;Recently, I&apos;ve been exploring ways to make my Python development workflow faster and cleaner and I discovered an incredible duo: &lt;strong&gt;&lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt;&lt;/strong&gt;. Both are written in Rust and have completely transformed how I work with Python projects. In this blog post, I&apos;ll share why I made the switch and how you can easily integrate these tools into your workflow!&lt;/p&gt;
&lt;h2&gt;Why I started using &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Let&apos;s be honest — Python tools can be kind of a mess. Between &lt;code class=&quot;language-text&quot;&gt;pip&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;virtualenv&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;pip-tools&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;flake8&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;isort&lt;/code&gt;... there&apos;s just too much to deal with, and it was honestly getting annoying. Installing packages was slow, and the whole setup started to feel more like a hassle than something helpful.&lt;/p&gt;
&lt;p&gt;Then I discovered this Rust-powered combo, and everything changed. Here&apos;s what got me hooked:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt;&lt;/strong&gt; is a super-fast Python package manager that replaces &lt;code class=&quot;language-text&quot;&gt;pip&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;virtualenv&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;pip-tools&lt;/code&gt; - all in one tool. It&apos;s modern, reliable, and blazingly fast.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt;&lt;/strong&gt; is a lightning-fast linter and formatter that can replace &lt;code class=&quot;language-text&quot;&gt;black&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;flake8&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;isort&lt;/code&gt; and more. One tool to rule them all, basically.&lt;/p&gt;
&lt;p&gt;The performance difference is mind-blowing. We&apos;re talking about significant speed improvements in package installations and code formatting. Once you experience this speed, there&apos;s no going back.&lt;/p&gt;
&lt;h2&gt;Performance benchmarks&lt;/h2&gt;
&lt;p&gt;So how fast are we talking, really? Let’s break it down with real benchmarks. From package installs to linting massive codebases, the results are jaw-dropping — and they’re what convinced me to switch for good.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt; delivers remarkable speed gains&lt;/strong&gt;: According to Astral&apos;s official benchmarks, &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt; is 8-10x faster than &lt;code class=&quot;language-text&quot;&gt;pip&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;pip-tools&lt;/code&gt; without caching, but here&apos;s where it gets really interesting - with a warm cache (like when you&apos;re recreating a virtual environment or updating dependencies), it becomes 80-115x faster. That&apos;s not a typo! The speed difference comes from &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt;&apos;s global module cache that avoids re-downloading packages and its use of Copy-on-Write and hardlinks to minimize disk usage.&lt;/p&gt;
&lt;p&gt;Even for virtual environment creation, &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt; is about 80x faster than &lt;code class=&quot;language-text&quot;&gt;python -m venv&lt;/code&gt; and 7x faster than &lt;code class=&quot;language-text&quot;&gt;virtualenv&lt;/code&gt;, with no dependency on Python itself.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt; is equally impressive&lt;/strong&gt;: The official documentation states that Ruff is 10-100x faster than existing linters like Flake8 and formatters like Black. But what really drives this home are the real-world testimonials from developers who&apos;ve made the switch.&lt;/p&gt;
&lt;p&gt;Bryan Van de Ven — co-creator of Bokeh and original author of Conda — shared a great comparison:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Ruff is ~150–200x faster than flake8 on my machine. Scanning the whole repo takes ~0.2s instead of ~20s.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Nick Schrock, founder of Elementl and co-creator of GraphQL, also reported impressive results:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“On our largest module (Dagster itself, 250k LOC), pylint takes about 2.5 minutes, parallelized across 4 cores on my M1. Running Ruff against our entire codebase takes 0.4 seconds.”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;References:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://astral.sh/blog/uv&quot;&gt;uv: Python packaging in Rust - Astral Official Blog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.astral.sh/ruff/&quot;&gt;Ruff Official Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.astral.sh/uv/reference/benchmarks/&quot;&gt;uv Benchmarks Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://trunk.io/learn/comparing-ruff-flake8-and-pylint-linting-speed&quot;&gt;Trunk Performance Comparison&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;How easy these tools are to use&lt;/h2&gt;
&lt;p&gt;Here&apos;s the best part - these tools are designed to be drop-in replacements. You don&apos;t need to rewrite your entire workflow or learn completely new concepts. Just swap out the tools and enjoy the speed boost!&lt;/p&gt;
&lt;p&gt;Both &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt; work with your existing Python projects and configurations. They respect your current setup while making everything faster and more reliable.&lt;/p&gt;
&lt;h2&gt;Quick tutorial and example&lt;/h2&gt;
&lt;p&gt;Let me show you how simple it is to get started with both tools.&lt;/p&gt;
&lt;h3&gt;Installing &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt; and &lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt;&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Install uv&lt;/span&gt;
&lt;span class=&quot;token function&quot;&gt;curl&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;-LsSf&lt;/span&gt; https://astral.sh/uv/install.sh &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;sh&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# On Windows: powershell -ExecutionPolicy ByPass -c &quot;irm https://astral.sh/uv/install.ps1 | iex&quot;&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Install ruff&lt;/span&gt;
pip &lt;span class=&quot;token function&quot;&gt;install&lt;/span&gt; ruff&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;Creating a new project with &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;Starting a new project is incredibly straightforward:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Create and activate virtual environment&lt;/span&gt;
uv venv
&lt;span class=&quot;token builtin class-name&quot;&gt;source&lt;/span&gt; .venv/bin/activate  &lt;span class=&quot;token comment&quot;&gt;# On Windows: .venv\Scripts\activate&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Initialize project (creates pyproject.toml)&lt;/span&gt;
uv init

&lt;span class=&quot;token comment&quot;&gt;# Install packages (lightning fast!)&lt;/span&gt;
uv pip &lt;span class=&quot;token function&quot;&gt;add&lt;/span&gt; requests pandas fastapi&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That&apos;s it! You now have a &lt;code class=&quot;language-text&quot;&gt;.venv&lt;/code&gt; managed by &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt;, packages install incredibly fast, and you get a &lt;code class=&quot;language-text&quot;&gt;uv.lock&lt;/code&gt; file for perfect reproducibility.&lt;/p&gt;
&lt;h3&gt;Setting up &lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;The beauty of &lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt; is that it works great out of the box with zero configuration. You can start using it immediately:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;bash&quot;&gt;&lt;pre class=&quot;language-bash&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;# Check for issues in your codebase&lt;/span&gt;
ruff check &lt;span class=&quot;token builtin class-name&quot;&gt;.&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Auto-fix what can be fixed automatically&lt;/span&gt;
ruff check &lt;span class=&quot;token builtin class-name&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;token parameter variable&quot;&gt;--fix&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Format your code&lt;/span&gt;
ruff &lt;span class=&quot;token function&quot;&gt;format&lt;/span&gt; &lt;span class=&quot;token builtin class-name&quot;&gt;.&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you&apos;d like to customize &lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt;&apos;s behavior, you can configure it via a &lt;code class=&quot;language-text&quot;&gt;pyproject.toml&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;ruff.toml&lt;/code&gt; or &lt;code class=&quot;language-text&quot;&gt;.ruff.toml&lt;/code&gt; file. It looks for the closest configuration file in the directory hierarchy and applies its settings.&lt;/p&gt;
&lt;p&gt;Here’s a simple configuration example using &lt;code class=&quot;language-text&quot;&gt;pyproject.toml&lt;/code&gt;:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;toml&quot;&gt;&lt;pre class=&quot;language-toml&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token table class-name&quot;&gt;tool.ruff&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# Set the maximum line length&lt;/span&gt;
&lt;span class=&quot;token key property&quot;&gt;line-length&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;88&lt;/span&gt;

&lt;span class=&quot;token comment&quot;&gt;# Assume Python 3.12&lt;/span&gt;
&lt;span class=&quot;token key property&quot;&gt;target-version&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&quot;py312&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;You can explore all available settings in the &lt;a href=&quot;https://docs.astral.sh/ruff/settings/&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt; settings&lt;/a&gt; documentation. For a deeper look at how to configure &lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt;, check out the &lt;a href=&quot;https://docs.astral.sh/ruff/configuration/&quot;&gt;configuration guide&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This setup gives you a powerful and streamlined workflow by combining the functionality of tools like &lt;code class=&quot;language-text&quot;&gt;black&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;isort&lt;/code&gt;, &lt;code class=&quot;language-text&quot;&gt;flake8&lt;/code&gt;, and several plugins — all in a single, blazing-fast tool.&lt;/p&gt;
&lt;h2&gt;My production setup with pre-commits and github workflows&lt;/h2&gt;
&lt;p&gt;In my workflow, I use &lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt; with &lt;a href=&quot;https://pre-commit.com/&quot;&gt;pre-commit hooks&lt;/a&gt; to automatically check for linting and formatting errors before each commit. I also have GitHub workflows set up to ensure code quality in my repositories. Additionally, I use &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt; to improve build times across my CI/CD pipelines. I might dive deeper into pre-commit setup and &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt; use cases in a future post, but here&apos;s the GitHub workflow I use:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;yaml&quot;&gt;&lt;pre class=&quot;language-yaml&quot;&gt;&lt;code class=&quot;language-yaml&quot;&gt;&lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Ruff

&lt;span class=&quot;token key atrule&quot;&gt;on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;pull_request&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;

&lt;span class=&quot;token key atrule&quot;&gt;jobs&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
  &lt;span class=&quot;token key atrule&quot;&gt;ruff-lint&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Ruff Linter
    &lt;span class=&quot;token key atrule&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; ubuntu&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;latest
    &lt;span class=&quot;token key atrule&quot;&gt;steps&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; actions/checkout@v4
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Run Ruff linter
        &lt;span class=&quot;token key atrule&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; astral&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;sh/ruff&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;action@v3
        &lt;span class=&quot;token key atrule&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token key atrule&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; check .

  &lt;span class=&quot;token key atrule&quot;&gt;ruff-format&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Ruff Formatter
    &lt;span class=&quot;token key atrule&quot;&gt;runs-on&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; ubuntu&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;latest
    &lt;span class=&quot;token key atrule&quot;&gt;steps&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; actions/checkout@v4
      &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;token key atrule&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; Run Ruff formatter check
        &lt;span class=&quot;token key atrule&quot;&gt;uses&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; astral&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;sh/ruff&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;action@v3
        &lt;span class=&quot;token key atrule&quot;&gt;with&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt;
          &lt;span class=&quot;token key atrule&quot;&gt;args&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; format &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;check &lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;-&lt;/span&gt;diff&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This workflow runs on every pull request and checks both linting and formatting. It&apos;s simple, fast and catches issues before they make it into the main branch.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;This combo has made my Python workflow smoother and way faster. The best part is that you don&apos;t need to change everything at once. You can start by replacing your current linter/formatter with &lt;code class=&quot;language-text&quot;&gt;ruff&lt;/code&gt;, then try &lt;code class=&quot;language-text&quot;&gt;uv&lt;/code&gt; for new projects to see the speed difference.&lt;/p&gt;
&lt;p&gt;Let me know if you try this out or have other tools that are game-changers for your setup!&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;python&quot;&gt;&lt;pre class=&quot;language-python&quot;&gt;&lt;code class=&quot;language-python&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;See ya 😎&quot;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;166&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot; allow=&quot;autoplay&quot; src=&quot;https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/112307869&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;font-size: 10px; color: #cccccc;line-break: anywhere;word-break: normal;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; font-family: Interstate,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Garuda,Verdana,Tahoma,sans-serif;font-weight: 100;&quot;&gt;&lt;a href=&quot;https://soundcloud.com/njs10&quot; title=&quot;Njs10&quot; target=&quot;_blank&quot; style=&quot;color: #cccccc; text-decoration: none;&quot;&gt;Njs10&lt;/a&gt; · &lt;a href=&quot;https://soundcloud.com/njs10/no-more-heroes-2its-kill-or-be&quot; title=&quot;No More Heroes 2~It&amp;#x27;s Kill Or Be Killed(Destroy Resort)&quot; target=&quot;_blank&quot; style=&quot;color: #cccccc; text-decoration: none;&quot;&gt;No More Heroes 2~It&amp;#x27;s Kill Or Be Killed(Destroy Resort)&lt;/a&gt;&lt;/div&gt;</content:encoded></item><item><title><![CDATA[Anonymous block parameter in Ruby]]></title><description><![CDATA[Recently, I learned about numbered parameters in Ruby, which simplify block parameters by eliminating the need to explicitly name each one…]]></description><link>https://blog.mateuseap.com/ruby-block-params/</link><guid isPermaLink="false">https://blog.mateuseap.com/ruby-block-params/</guid><pubDate>Sat, 31 Aug 2024 04:30:53 GMT</pubDate><content:encoded>&lt;p&gt;Recently, I learned about &lt;strong&gt;numbered parameters&lt;/strong&gt; in Ruby, which simplify block parameters by eliminating the need to explicitly name each one. I then explored this further and discovered an even more flexible approach: using &lt;code class=&quot;language-text&quot;&gt;it&lt;/code&gt; keyword as an &lt;strong&gt;anonymous block parameter&lt;/strong&gt;. In this blog post, we&apos;ll briefly discuss about these Ruby features!&lt;/p&gt;
&lt;h2&gt;A brief history&lt;/h2&gt;
&lt;p&gt;Before &lt;strong&gt;Ruby 2.7&lt;/strong&gt;, working with blocks in Ruby required explicitly naming each parameter, which could make the code more verbose and harder to read. For example:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;ruby&quot;&gt;&lt;pre class=&quot;language-ruby&quot;&gt;&lt;code class=&quot;language-ruby&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;map &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt;element&lt;span class=&quot;token operator&quot;&gt;|&lt;/span&gt; element &lt;span class=&quot;token operator&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# =&gt; [2, 4, 6]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To simplify this, &lt;strong&gt;Ruby 2.7&lt;/strong&gt; introduced &lt;strong&gt;numbered parameters&lt;/strong&gt; (you can see the proposal &lt;a href=&quot;https://bugs.ruby-lang.org/issues/4475&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;):&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;ruby&quot;&gt;&lt;pre class=&quot;language-ruby&quot;&gt;&lt;code class=&quot;language-ruby&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;1000&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;each_with_index &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; p &lt;span class=&quot;token string-literal&quot;&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token delimiter punctuation&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;token content&quot;&gt;_1&lt;/span&gt;&lt;span class=&quot;token delimiter punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;token interpolation&quot;&gt;&lt;span class=&quot;token delimiter punctuation&quot;&gt;#{&lt;/span&gt;&lt;span class=&quot;token content&quot;&gt;_2&lt;/span&gt;&lt;span class=&quot;token delimiter punctuation&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# =&gt; &quot;10, 0&quot;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# =&gt; &quot;100, 1&quot;&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# =&gt; &quot;1000, 2&quot;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Here, &lt;code class=&quot;language-text&quot;&gt;_1&lt;/code&gt; refers to the first element, while &lt;code class=&quot;language-text&quot;&gt;_2&lt;/code&gt; refers to the index. This approach makes the code cleaner and more focused on the block’s logic. However, it can still be somewhat confusing and may not always be as readable as desired.&lt;/p&gt;
&lt;h2&gt;The proposal: introducing &lt;code class=&quot;language-text&quot;&gt;it&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Recognizing the limitations of &lt;strong&gt;numbered parameters&lt;/strong&gt;, a proposal for &lt;strong&gt;Ruby 3.4&lt;/strong&gt; (you can see it &lt;a href=&quot;https://bugs.ruby-lang.org/issues/18980&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;) suggested introducing &lt;code class=&quot;language-text&quot;&gt;it&lt;/code&gt; as an &lt;strong&gt;anonymous block parameter&lt;/strong&gt;. The aim was to simplify block syntax even further by replacing numbered placeholders with the more intuitive &lt;code class=&quot;language-text&quot;&gt;it&lt;/code&gt; keyword:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;ruby&quot;&gt;&lt;pre class=&quot;language-ruby&quot;&gt;&lt;code class=&quot;language-ruby&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;30&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;select &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt; it &lt;span class=&quot;token operator&quot;&gt;&gt;&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;15&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;token comment&quot;&gt;# =&gt; [20, 30]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;In this example, &lt;code class=&quot;language-text&quot;&gt;it&lt;/code&gt; represents the current element being processed, serving as an &lt;strong&gt;anonymous parameter&lt;/strong&gt;. This enhancement aims to simplify code, making it more readable and expressive by eliminating the need to remember parameter numbers.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In summary, both &lt;strong&gt;numbered parameters&lt;/strong&gt; and the &lt;strong&gt;anonymous parameter&lt;/strong&gt; enhance how we handle block parameters in Ruby. &lt;strong&gt;Numbered parameters&lt;/strong&gt; offer a concise way to reference multiple parameters, but they can sometimes be confusing, especially with several parameters. On the other hand, the &lt;code class=&quot;language-text&quot;&gt;it&lt;/code&gt; keyword acts as an &lt;strong&gt;anonymous parameter&lt;/strong&gt;, simplifying code when you only need to work with a single parameter.&lt;/p&gt;
&lt;p&gt;The key takeaway is to use these approaches to simplify your code blocks, but only if they don&apos;t reduce readability. Shorter code isn&apos;t always easier to read; it&apos;s important to balance between being concise and being clear. Always consider how these features affect the overall readability of your code to make the best decision.&lt;/p&gt;
&lt;p&gt;I hope you found this blog post useful. Thanks for reading!&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;ruby&quot;&gt;&lt;pre class=&quot;language-ruby&quot;&gt;&lt;code class=&quot;language-ruby&quot;&gt;puts &lt;span class=&quot;token string-literal&quot;&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Ah shit, here we go again.&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;166&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot; allow=&quot;autoplay&quot; src=&quot;https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/152433867&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;font-size: 10px; color: #cccccc;line-break: anywhere;word-break: normal;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; font-family: Interstate,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Garuda,Verdana,Tahoma,sans-serif;font-weight: 100;&quot;&gt;&lt;a href=&quot;https://soundcloud.com/2pac-radio-2&quot; title=&quot;2Pac.radio 2&quot; target=&quot;_blank&quot; style=&quot;color: #cccccc; text-decoration: none;&quot;&gt;2Pac.radio 2&lt;/a&gt; · &lt;a href=&quot;https://soundcloud.com/2pac-radio-2/2pac-shorty-wanna-be-a-thug-original-version&quot; title=&quot;2Pac - Shorty Wanna Be A Thug (Original Version)&quot; target=&quot;_blank&quot; style=&quot;color: #cccccc; text-decoration: none;&quot;&gt;2Pac - Shorty Wanna Be A Thug (Original Version)&lt;/a&gt;&lt;/div&gt;</content:encoded></item><item><title><![CDATA[Memoization in Ruby on Rails]]></title><description><![CDATA[Hi, welcome! This is the second post on my blog (finally :P), and here I'll talk a little bit about memoization in RoR. The first time I…]]></description><link>https://blog.mateuseap.com/ror-memoization/</link><guid isPermaLink="false">https://blog.mateuseap.com/ror-memoization/</guid><pubDate>Tue, 06 Aug 2024 02:56:20 GMT</pubDate><content:encoded>&lt;p&gt;Hi, welcome! This is the second post on my blog (finally :P), and here I&apos;ll talk a little bit about memoization in RoR.&lt;/p&gt;
&lt;p&gt;The first time I encountered memoization in Rails was at work a few months ago when I saw a method using something like &lt;code class=&quot;language-text&quot;&gt;@here ||= some_query&lt;/code&gt;. I was intrigued, started researching, and now I&apos;m sharing what I&apos;ve learned in this post!&lt;/p&gt;
&lt;h2&gt;What is memoization?&lt;/h2&gt;
&lt;p&gt;In simple terms, memoization is a way to store the result of a method call and return the cached result when the same inputs occur again.&lt;/p&gt;
&lt;p&gt;It works by caching a method&apos;s results the first time it&apos;s called. After that, any subsequent calls will return the cached value instead of recalculating it.&lt;/p&gt;
&lt;h2&gt;Example of memoization in Rails&lt;/h2&gt;
&lt;p&gt;Memoization is commonly used in Rails applications to optimize methods that perform costly operations, like database queries or external API calls. Let&apos;s look at an example of a method before and after applying memoization:&lt;/p&gt;
&lt;h3&gt;Before memoization&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;ruby&quot;&gt;&lt;pre class=&quot;language-ruby&quot;&gt;&lt;code class=&quot;language-ruby&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;User&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; ApplicationRecord
  &lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token method-definition&quot;&gt;&lt;span class=&quot;token function&quot;&gt;expensive_method&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token comment&quot;&gt;# Perform some costly operations here&lt;/span&gt;
    sleep&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# Simulate a time-consuming task&lt;/span&gt;
    &lt;span class=&quot;token string-literal&quot;&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Expensive result&quot;&lt;/span&gt;&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;end&lt;/span&gt;

user &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; User&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find_by&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
puts user&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;expensive_method &lt;span class=&quot;token comment&quot;&gt;# This will take 2 seconds&lt;/span&gt;
puts user&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;expensive_method &lt;span class=&quot;token comment&quot;&gt;# This will take another 2 seconds&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h3&gt;After memoization&lt;/h3&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;ruby&quot;&gt;&lt;pre class=&quot;language-ruby&quot;&gt;&lt;code class=&quot;language-ruby&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;class&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;User&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;&amp;lt;&lt;/span&gt; ApplicationRecord
  &lt;span class=&quot;token keyword&quot;&gt;def&lt;/span&gt; &lt;span class=&quot;token method-definition&quot;&gt;&lt;span class=&quot;token function&quot;&gt;expensive_method&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token variable&quot;&gt;@expensive_method&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;||=&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;begin&lt;/span&gt;
      &lt;span class=&quot;token comment&quot;&gt;# Perform some costly operations here&lt;/span&gt;
      sleep&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token number&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;# Simulate a time-consuming task&lt;/span&gt;
      &lt;span class=&quot;token string-literal&quot;&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Expensive result&quot;&lt;/span&gt;&lt;/span&gt;
    &lt;span class=&quot;token keyword&quot;&gt;end&lt;/span&gt;
  &lt;span class=&quot;token keyword&quot;&gt;end&lt;/span&gt;
&lt;span class=&quot;token keyword&quot;&gt;end&lt;/span&gt;

user &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; User&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;find_by&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token symbol&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token number&quot;&gt;13&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;
puts user&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;expensive_method &lt;span class=&quot;token comment&quot;&gt;# This will take 2 seconds&lt;/span&gt;
puts user&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;expensive_method &lt;span class=&quot;token comment&quot;&gt;# This will be instant&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The memoized version of the &lt;code class=&quot;language-text&quot;&gt;expensive_method&lt;/code&gt; uses the &lt;code class=&quot;language-text&quot;&gt;||=&lt;/code&gt; operator to determine if the result has already been computed. The expensive operations are executed only during the first call, while subsequent calls return the cached result, which enhances performance.&lt;/p&gt;
&lt;p&gt;Of course, this is a simplified example, but it shows how memoization can enhance your methods.&lt;/p&gt;
&lt;h2&gt;Benefits of memoization&lt;/h2&gt;
&lt;p&gt;There are several benefits to using memoization in Rails applications, but the ones I particularly noticed at work were:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Increased performance&lt;/strong&gt;: It makes things faster by reducing redundant operations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simplified code&lt;/strong&gt;: Makes your code cleaner by eliminating redundant calculations.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Use cases for memoization in Rails&lt;/h2&gt;
&lt;p&gt;Besides the benefits I experienced with memoization in the projects I’ve been working on, I also observed and want to highlight two scenarios where you definitely should consider applying memoization:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Database queries&lt;/strong&gt;: Avoid running the same query multiple times within the same request.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Complex calculations&lt;/strong&gt;: Store the results of complex calculations to improve performance.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;However, it&apos;s important to remember that not all methods are good candidates for memoization. Generally, I recommend memoizing methods that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The calculation is costly or takes a long time.&lt;/li&gt;
&lt;li&gt;The input data doesn&apos;t change.&lt;/li&gt;
&lt;li&gt;The method is used often.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In conclusion, memoization is beneficial when the method is called multiple times within the same context, reducing the overhead of redundant database queries and improving overall performance.&lt;/p&gt;
&lt;p&gt;For now, that&apos;s all. I really hope you&apos;ve learned something useful from this post!&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;ruby&quot;&gt;&lt;pre class=&quot;language-ruby&quot;&gt;&lt;code class=&quot;language-ruby&quot;&gt;puts &lt;span class=&quot;token string-literal&quot;&gt;&lt;span class=&quot;token string&quot;&gt;&quot;See ya :P&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;166&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot; allow=&quot;autoplay&quot; src=&quot;https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/32646707&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;font-size: 10px; color: #cccccc;line-break: anywhere;word-break: normal;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; font-family: Interstate,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Garuda,Verdana,Tahoma,sans-serif;font-weight: 100;&quot;&gt;&lt;a href=&quot;https://soundcloud.com/dorego&quot; title=&quot;bangs.&quot; target=&quot;_blank&quot; style=&quot;color: #cccccc; text-decoration: none;&quot;&gt;bangs.&lt;/a&gt; · &lt;a href=&quot;https://soundcloud.com/dorego/mf-doom-doomsday&quot; title=&quot;MF DOOM - Doomsday&quot; target=&quot;_blank&quot; style=&quot;color: #cccccc; text-decoration: none;&quot;&gt;MF DOOM - Doomsday&lt;/a&gt;&lt;/div&gt;</content:encoded></item><item><title><![CDATA[Hello World]]></title><description><![CDATA[Hi, as you've probably noticed, my name is Mateus Elias! Firstly, let me introduce myself. I'm 22 years old and currently work as a Full…]]></description><link>https://blog.mateuseap.com/hello-world/</link><guid isPermaLink="false">https://blog.mateuseap.com/hello-world/</guid><pubDate>Thu, 09 May 2024 08:28:01 GMT</pubDate><content:encoded>&lt;p&gt;Hi, as you&apos;ve probably noticed, my name is &lt;strong&gt;Mateus Elias&lt;/strong&gt;!&lt;/p&gt;
&lt;p&gt;Firstly, let me introduce myself. I&apos;m 22 years old and currently work as a Full Stack Software Engineer while pursuing my bachelor&apos;s in Computer Science.&lt;/p&gt;
&lt;p&gt;I&apos;ve created this blog to share some interesting tech stuff (hopefully :P) and also to share personal experiences.&lt;/p&gt;
&lt;p&gt;But how did I come up with this idea of creating a blog in plenty 2024? Well, I was using &lt;strong&gt;&lt;a href=&quot;https://obsidian.md&quot;&gt;Obsidian&lt;/a&gt;&lt;/strong&gt; a lot (a very good note-taking software), and I thought some of my notes were worth sharing and could help others, or at least teach something new! Also, some of my notes I simply wanted to share, to show a bit of myself to those who want to know me. And because of that, this blog was created!&lt;/p&gt;
&lt;p&gt;I already have a page on &lt;strong&gt;&lt;a href=&quot;https://medium.com/@mateuselias&quot;&gt;Medium&lt;/a&gt;&lt;/strong&gt;. I thought of starting to use it to share the posts I wanted, but it didn&apos;t fulfill what I was looking for. I didn&apos;t want to share only elaborated tech posts, but also simple posts sharing some of my weekly experiences, for example. I felt that Medium was way &quot;too formal&quot; for that, so I&apos;ve created my own blog, a space where I&apos;m free to do what I want with it and make it really how I want! I know the reasons to create this blog and also to not use Medium were not that deep and complex, but I think they are fair enough motivations.&lt;/p&gt;
&lt;p&gt;Hope you can get something good from here. I&apos;ll put effort into this blog and try to make new posts whenever possible! Writing is a very good way to externalize what you&apos;ve learned, what you&apos;re feeling, basically everything. Try it out yourself too, maybe you&apos;ll like it as much as I do.&lt;/p&gt;
&lt;p&gt;For now, that&apos;s all. I just wanted to start things right with this simple introductory post, basically to say:&lt;/p&gt;
&lt;div class=&quot;gatsby-highlight&quot; data-language=&quot;ruby&quot;&gt;&lt;pre class=&quot;language-ruby&quot;&gt;&lt;code class=&quot;language-ruby&quot;&gt;puts &lt;span class=&quot;token string-literal&quot;&gt;&lt;span class=&quot;token string&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;166&quot; scrolling=&quot;no&quot; frameborder=&quot;no&quot; allow=&quot;autoplay&quot; src=&quot;https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/209288154&amp;color=%23ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false&amp;show_teaser=true&quot;&gt;&lt;/iframe&gt;&lt;div style=&quot;font-size: 10px; color: #cccccc;line-break: anywhere;word-break: normal;overflow: hidden;white-space: nowrap;text-overflow: ellipsis; font-family: Interstate,Lucida Grande,Lucida Sans Unicode,Lucida Sans,Garuda,Verdana,Tahoma,sans-serif;font-weight: 100;&quot;&gt;&lt;a href=&quot;https://soundcloud.com/imgoldwater&quot; title=&quot;GOLDWATER&quot; target=&quot;_blank&quot; style=&quot;color: #cccccc; text-decoration: none;&quot;&gt;</content:encoded></item></channel></rss>