Files
monotab/_site/feed.xml
2025-07-26 15:12:02 -04:00

55 lines
7.2 KiB
XML

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<atom:link href="https://example.com/feed.xml" rel="self" type="application/rss+xml" />
<title>monotab</title>
<link>https://example.com</link>
<description>My beautiful website</description>
<language>en-us</language>
<generator>Tableau v0.26.0</generator>
<item>
<title>Test Post: Getting Started with Elixir</title>
<link>https://example.com/2024-01-15-test-post</link>
<pubDate>Mon, 15 Jan 2024 00:00:00 UTC</pubDate>
<guid>https://example.com/2024-01-15-test-post</guid>
<description><![CDATA[ <h1><a inert href="#getting-started-with-elixir" aria-hidden="true" class="anchor" id="getting-started-with-elixir"></a>Getting Started with Elixir</h1>
<p>Elixir is a dynamic, functional language designed for building scalable and maintainable applications. It leverages the Erlang VM, known for running low-latency, distributed, and fault-tolerant systems.</p>
<h2><a inert href="#key-features" aria-hidden="true" class="anchor" id="key-features"></a>Key Features</h2>
<ul>
<li><strong>Functional Programming</strong>: Immutable data and pattern matching</li>
<li><strong>Scalability</strong>: Built on the Erlang VM for concurrent processing</li>
<li><strong>Fault Tolerance</strong>: Supervisor trees and the "let it crash" philosophy</li>
<li><strong>Developer Productivity</strong>: Powerful metaprogramming and a helpful compiler</li>
</ul>
<h2><a inert href="#basic-syntax" aria-hidden="true" class="anchor" id="basic-syntax"></a>Basic Syntax</h2>
<pre class="athl" style="color: #e0e2ea; background-color: #14161b;"><code class="language-elixir" translate="no" tabindex="0"><span class="line" data-line="1"><span style="color: #e0e2ea; font-weight: bold;">defmodule</span> <span style="color: #e0e2ea;">Greeting</span> <span style="color: #e0e2ea; font-weight: bold;">do</span>
</span><span class="line" data-line="2"> <span style="color: #e0e2ea; font-weight: bold;">def</span> <span style="color: #8cf8f7;">hello</span><span style="color: #e0e2ea;">(</span><span style="color: #e0e2ea;">name</span><span style="color: #e0e2ea;">)</span> <span style="color: #e0e2ea; font-weight: bold;">do</span>
</span><span class="line" data-line="3"> <span style="color: #b3f6c0;">&quot;Hello, <span style="color: #8cf8f7;">#&lbrace;</span><span style="color: #e0e2ea;">name</span><span style="color: #8cf8f7;">&rbrace;</span>!&quot;</span>
</span><span class="line" data-line="4"> <span style="color: #e0e2ea; font-weight: bold;">end</span>
</span><span class="line" data-line="5"><span style="color: #e0e2ea; font-weight: bold;">end</span>
</span><span class="line" data-line="6">
</span><span class="line" data-line="7"><span style="color: #e0e2ea;">IO</span><span style="color: #e0e2ea;">.</span><span style="color: #8cf8f7;">puts</span> <span style="color: #e0e2ea;">Greeting</span><span style="color: #e0e2ea;">.</span><span style="color: #8cf8f7;">hello</span><span style="color: #e0e2ea;">(</span><span style="color: #b3f6c0;">&quot;World&quot;</span><span style="color: #e0e2ea;">)</span>
</span></code></pre>
<h2><a inert href="#pattern-matching" aria-hidden="true" class="anchor" id="pattern-matching"></a>Pattern Matching</h2>
<p>One of Elixir's most powerful features is pattern matching:</p>
<pre class="athl" style="color: #e0e2ea; background-color: #14161b;"><code class="language-elixir" translate="no" tabindex="0"><span class="line" data-line="1"><span style="color: #9b9ea4;"># Assign value</span>
</span><span class="line" data-line="2"><span style="color: #e0e2ea;">x</span> <span style="color: #e0e2ea;">=</span> <span style="color: #e0e2ea;">1</span>
</span><span class="line" data-line="3">
</span><span class="line" data-line="4"><span style="color: #9b9ea4;"># Pattern matching</span>
</span><span class="line" data-line="5"><span style="color: #e0e2ea;">&lbrace;</span><span style="color: #e0e2ea;">a</span><span style="color: #e0e2ea;">,</span> <span style="color: #e0e2ea;">b</span><span style="color: #e0e2ea;">,</span> <span style="color: #e0e2ea;">c</span><span style="color: #e0e2ea;">&rbrace;</span> <span style="color: #e0e2ea;">=</span> <span style="color: #e0e2ea;">&lbrace;</span><span style="color: #8cf8f7;">:hello</span><span style="color: #e0e2ea;">,</span> <span style="color: #b3f6c0;">&quot;world&quot;</span><span style="color: #e0e2ea;">,</span> <span style="color: #e0e2ea;">42</span><span style="color: #e0e2ea;">&rbrace;</span>
</span><span class="line" data-line="6">
</span><span class="line" data-line="7"><span style="color: #9b9ea4;"># Pattern matching in function definitions</span>
</span><span class="line" data-line="8"><span style="color: #e0e2ea; font-weight: bold;">def</span> <span style="color: #8cf8f7;">process</span><span style="color: #e0e2ea;">(</span><span style="color: #e0e2ea;">&lbrace;</span><span style="color: #8cf8f7;">:ok</span><span style="color: #e0e2ea;">,</span> <span style="color: #e0e2ea;">result</span><span style="color: #e0e2ea;">&rbrace;</span><span style="color: #e0e2ea;">)</span><span style="color: #e0e2ea;">,</span> <span style="color: #8cf8f7;">do: </span><span style="color: #e0e2ea;">result</span>
</span><span class="line" data-line="9"><span style="color: #e0e2ea; font-weight: bold;">def</span> <span style="color: #8cf8f7;">process</span><span style="color: #e0e2ea;">(</span><span style="color: #e0e2ea;">&lbrace;</span><span style="color: #8cf8f7;">:error</span><span style="color: #e0e2ea;">,</span> <span style="color: #e0e2ea;">reason</span><span style="color: #e0e2ea;">&rbrace;</span><span style="color: #e0e2ea;">)</span><span style="color: #e0e2ea;">,</span> <span style="color: #8cf8f7;">do: </span><span style="color: #e0e2ea; font-weight: bold;">raise</span><span style="color: #e0e2ea;">(</span><span style="color: #e0e2ea;">reason</span><span style="color: #e0e2ea;">)</span>
</span></code></pre>
<h2><a inert href="#the-pipe-operator" aria-hidden="true" class="anchor" id="the-pipe-operator"></a>The Pipe Operator</h2>
<p>Elixir's pipe operator (<code>|&gt;</code>) allows for clean, readable code:</p>
<pre class="athl" style="color: #e0e2ea; background-color: #14161b;"><code class="language-elixir" translate="no" tabindex="0"><span class="line" data-line="1"><span style="color: #b3f6c0;">&quot;Elixir rocks!&quot;</span>
</span><span class="line" data-line="2"><span style="color: #e0e2ea;">|&gt;</span> <span style="color: #e0e2ea;">String</span><span style="color: #e0e2ea;">.</span><span style="color: #8cf8f7;">upcase</span><span style="color: #e0e2ea;">(</span><span style="color: #e0e2ea;">)</span>
</span><span class="line" data-line="3"><span style="color: #e0e2ea;">|&gt;</span> <span style="color: #e0e2ea;">String</span><span style="color: #e0e2ea;">.</span><span style="color: #8cf8f7;">split</span><span style="color: #e0e2ea;">(</span><span style="color: #e0e2ea;">)</span>
</span><span class="line" data-line="4"><span style="color: #e0e2ea;">|&gt;</span> <span style="color: #e0e2ea;">Enum</span><span style="color: #e0e2ea;">.</span><span style="color: #8cf8f7;">count</span><span style="color: #e0e2ea;">(</span><span style="color: #e0e2ea;">)</span>
</span></code></pre>
<p>This blog post is just a simple introduction to Elixir. Stay tuned for more in-depth tutorials and examples!</p> ]]></description>
</item>
</channel>
</rss>