<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Bryan Madrid</title>
    <link>https://braynm.com/</link>
    <description>Bryan Madrid writes Elixir and TypeScript, builds with AI, and keeps notes here so he remembers what he learned.</description>
    <language>en</language>
    <lastBuildDate>Sat, 24 Oct 2026 09:00:00 &#43;0800</lastBuildDate>
    <atom:link href="https://braynm.com/index.xml" rel="self" type="application/rss+xml"/>
    <item>
      <title>How I Ended Up Building My Own Investing App</title>
      <link>https://braynm.com/post/how-i-ended-up-building-my-own-investing-app/</link>
      <guid>https://braynm.com/post/how-i-ended-up-building-my-own-investing-app/</guid>
      <pubDate>Sat, 24 Oct 2026 09:00:00 &#43;0800</pubDate>
      <description>&lt;p&gt;I only started taking personal finance seriously in my 30s. I was starting a family, and having a child made me think more about what I should be doing with my money. I wanted to save for our future. The problem was, I didn’t know much beyond keeping money in a savings account.&lt;/p&gt;
&lt;p&gt;So I watched videos on YouTube and Facebook. That’s where I learned about Pag-IBIG MP2 and eventually tried it. Then I got interested in Philippine REITs, particularly RCR and AREIT. Now I had more things to learn: dividends, share prices, company disclosures. There was a lot to catch up on.&lt;/p&gt;
&lt;p&gt;At some point I started wondering if I could buy US stocks from the Philippines. I looked into brokers, how to fund an account, and the fees involved. That led me to Interactive Brokers.&lt;/p&gt;
&lt;p&gt;My first time opening IBKR was confusing. So many panels and settings, and I was still learning what the different order types meant. Getting an account was one thing. Figuring out what to do inside it took more work.&lt;/p&gt;
&lt;p&gt;While learning all this, I wanted to put the information I was looking at in one place, arranged in a way I could follow. And since I’m a developer, I ended up building an app for it. Another personal project 😅&lt;/p&gt;
&lt;p&gt;I call it IBKR Screener. It’s private, just something I’m building for my own use, connected to my Interactive Brokers account.&lt;/p&gt;
&lt;p&gt;I can look through companies in the S&amp;amp;P 500 and Nasdaq-100, compare sectors, and check revenue, profitability, and valuation. There’s also a place to read SEC filings, including financial results, offerings, and ownership changes. I’m learning what to look for in those documents as I go.&lt;/p&gt;
&lt;p&gt;For charts, I can switch timeframes, look at price and volume, mark levels, and put views side by side. The app also lets me send orders to IBKR and check their status alongside my positions.&lt;/p&gt;
&lt;p&gt;I’ve added news and a journal too. I want to be able to go back to a decision later and see what I was thinking when I made it.&lt;/p&gt;
&lt;p&gt;The stack is Elixir, Phoenix LiveView, and PostgreSQL. LiveView handles updating the screens when market data comes in, with the IBKR integration connecting the app to my broker.&lt;/p&gt;
&lt;p&gt;Claude Code has been a big help with the development. I’ve been using this project to explore what I can build with it, and covering this much on my own would have taken much longer. I still have to understand the code and check that it does what I expect.&lt;/p&gt;
&lt;p&gt;One thing I like about building this for myself: when something takes too many steps, I can change it. If I keep looking for the same information, I can move it somewhere easier to find.&lt;/p&gt;
&lt;p&gt;I’m still learning about investing. For now, I have an app to work on alongside that. I didn’t expect learning about MP2 to lead to writing an IBKR integration, but here we are.&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Using Vim Substitute</title>
      <link>https://braynm.com/post/search-and-replace-in-vim/</link>
      <guid>https://braynm.com/post/search-and-replace-in-vim/</guid>
      <pubDate>Sat, 22 Jul 2023 14:46:55 &#43;0800</pubDate>
      <description>&lt;h1 id=&#34;search-and-replace-in-vim&#34;&gt;&lt;span class=&#34;hash&#34; aria-hidden=&#34;true&#34;&gt;# &lt;/span&gt;Search and Replace in Vim&lt;/h1&gt;
&lt;p&gt;In this article, we will explore how to use Vim&amp;rsquo;s &lt;strong&gt;search&lt;/strong&gt; and &lt;strong&gt;replace&lt;/strong&gt; that &lt;em&gt;may&lt;/em&gt; help us to edit efficiently.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; This article required a basic understanding of regular expression.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s begin!&lt;/p&gt;
&lt;h2 id=&#34;basic&#34;&gt;&lt;span class=&#34;hash&#34; aria-hidden=&#34;true&#34;&gt;## &lt;/span&gt;Basic&lt;/h2&gt;
&lt;p&gt;See &lt;code&gt;:help substitute&lt;/code&gt; to read documentation. The basic syntax for replacing text is:&lt;/p&gt;
&lt;div class=&#34;code&#34; data-lang=&#34;vim&#34;&gt;
  &lt;div class=&#34;code-bar&#34;&gt;&lt;span&gt;[vim]&lt;/span&gt;&lt;button class=&#34;yank&#34; type=&#34;button&#34; aria-label=&#34;Copy code&#34;&gt;yy&lt;/button&gt;&lt;/div&gt;
  &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-vim&#34; data-lang=&#34;vim&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;# &lt;span class=&#34;nx&#34;&gt;Replaces&lt;/span&gt; `&lt;span class=&#34;nx&#34;&gt;hello&lt;/span&gt;` &lt;span class=&#34;nx&#34;&gt;with&lt;/span&gt; `&lt;span class=&#34;nx&#34;&gt;world&lt;/span&gt;`&lt;span class=&#34;err&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/hello/&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;world&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;&lt;/span&gt;# &lt;span class=&#34;nx&#34;&gt;hello&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;-&amp;gt;&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;world&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Here is another example of changing delimiter of &lt;code&gt;csv&lt;/code&gt; file from &lt;strong&gt;&lt;code&gt;,&lt;/code&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;code&gt;t&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;change delimiter:&lt;/p&gt;
&lt;figure class=&#34;vid&#34;&gt;
  &lt;video controls playsinline preload=&#34;metadata&#34;&gt;
    &lt;source src=&#34;https://braynm.com/videos/blog-video-1.mp4&#34; type=&#34;video/mp4&#34;&gt;
  &lt;/video&gt;
  &lt;figcaption&gt;blog-video-1.mp4&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2 id=&#34;capitalizing-words&#34;&gt;&lt;span class=&#34;hash&#34; aria-hidden=&#34;true&#34;&gt;## &lt;/span&gt;Capitalizing Words&lt;/h2&gt;
&lt;p&gt;You might think, I can just type it manually since there are only 4 words. What
if there are &lt;strong&gt;thousands&lt;/strong&gt; of rows. We will &lt;strong&gt;not&lt;/strong&gt; &lt;em&gt;edit&lt;/em&gt; manually. It will be time consuming.&lt;/p&gt;
&lt;p&gt;So here comes the &lt;code&gt;substite&lt;/code&gt; comes handy. It support patterns to make things &lt;em&gt;easier&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Capitalize words on every row:&lt;/p&gt;
&lt;figure class=&#34;vid&#34;&gt;
  &lt;video controls playsinline preload=&#34;metadata&#34;&gt;
    &lt;source src=&#34;https://braynm.com/videos/blog-video-2.mp4&#34; type=&#34;video/mp4&#34;&gt;
  &lt;/video&gt;
  &lt;figcaption&gt;blog-video-2.mp4&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Pretty neat!&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s break down the command:&lt;/p&gt;
&lt;div class=&#34;code&#34; data-lang=&#34;vim&#34;&gt;
  &lt;div class=&#34;code-bar&#34;&gt;&lt;span&gt;[vim]&lt;/span&gt;&lt;button class=&#34;yank&#34; type=&#34;button&#34; aria-label=&#34;Copy code&#34;&gt;yy&lt;/button&gt;&lt;/div&gt;
  &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-vim&#34; data-lang=&#34;vim&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;%&lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/\a\+/&lt;/span&gt;\&lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;&amp;amp;/&lt;span class=&#34;nx&#34;&gt;g&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;%s&lt;/code&gt; - Targets all the lines in the file to perform substitution.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\a&lt;/code&gt; - Matches alphabetic character.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\+&lt;/code&gt; - Matches 1 or more of the preceding atom, as many as possible.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;\u&lt;/code&gt; - Uppercase the match.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;&amp;amp;&lt;/code&gt; - Reuse the flags from the previous substitute command.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;g&lt;/code&gt; - Replace all matches in the line.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This can be more clear by using &lt;code&gt;magic&lt;/code&gt; mode, by adding &lt;code&gt;\v&lt;/code&gt; in front of &lt;code&gt;{pattern}&lt;/code&gt;&lt;/p&gt;
&lt;div class=&#34;code&#34; data-lang=&#34;vim&#34;&gt;
  &lt;div class=&#34;code-bar&#34;&gt;&lt;span&gt;[vim]&lt;/span&gt;&lt;button class=&#34;yank&#34; type=&#34;button&#34; aria-label=&#34;Copy code&#34;&gt;yy&lt;/button&gt;&lt;/div&gt;
  &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-vim&#34; data-lang=&#34;vim&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;%&lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/\v\a+/&lt;/span&gt;\&lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;&amp;amp;/&lt;span class=&#34;nx&#34;&gt;g&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This is helpful when your pattern is long, it makes the pattern more &lt;strong&gt;readable&lt;/strong&gt;. To learn more about &lt;code&gt;magic&lt;/code&gt; you can use &lt;code&gt;:help magic&lt;/code&gt; in Vim.&lt;/p&gt;
&lt;h1 id=&#34;name-initials&#34;&gt;&lt;span class=&#34;hash&#34; aria-hidden=&#34;true&#34;&gt;# &lt;/span&gt;Name Initials&lt;/h1&gt;
&lt;p&gt;We can also make name initials: &lt;code&gt;Michael Scott -&amp;gt; M. Scott or M.S.&lt;/code&gt;&lt;/p&gt;
&lt;div class=&#34;code&#34; data-lang=&#34;vim&#34;&gt;
  &lt;div class=&#34;code-bar&#34;&gt;&lt;span&gt;[vim]&lt;/span&gt;&lt;button class=&#34;yank&#34; type=&#34;button&#34; aria-label=&#34;Copy code&#34;&gt;yy&lt;/button&gt;&lt;/div&gt;
  &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-vim&#34; data-lang=&#34;vim&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;%&lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/\v(&amp;lt;.)(\a+)/&lt;/span&gt;\&lt;span class=&#34;nx&#34;&gt;u&lt;/span&gt;\&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;figure class=&#34;vid&#34;&gt;
  &lt;video controls playsinline preload=&#34;metadata&#34;&gt;
    &lt;source src=&#34;https://braynm.com/videos/blog-video-2.1.mp4&#34; type=&#34;video/mp4&#34;&gt;
  &lt;/video&gt;
  &lt;figcaption&gt;blog-video-2.1.mp4&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2 id=&#34;swapping-words&#34;&gt;&lt;span class=&#34;hash&#34; aria-hidden=&#34;true&#34;&gt;## &lt;/span&gt;Swapping Words&lt;/h2&gt;
&lt;p&gt;Let&amp;rsquo;s say we need to change the formatting of name, we need to follow this format: &lt;code&gt;Last Name, First Name&lt;/code&gt;. We can use captures to do this.&lt;/p&gt;
&lt;figure class=&#34;vid&#34;&gt;
  &lt;video controls playsinline preload=&#34;metadata&#34;&gt;
    &lt;source src=&#34;https://braynm.com/videos/blog-video-3.mp4&#34; type=&#34;video/mp4&#34;&gt;
  &lt;/video&gt;
  &lt;figcaption&gt;blog-video-3.mp4&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;h2 id=&#34;using-registers&#34;&gt;&lt;span class=&#34;hash&#34; aria-hidden=&#34;true&#34;&gt;## &lt;/span&gt;Using Registers&lt;/h2&gt;
&lt;p&gt;So first, what is &lt;code&gt;&amp;quot;register&amp;quot;&lt;/code&gt; in Vim?&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Is a storage space where text can be yanked (copied) or put (pasted). It&amp;rsquo;s like a clipboard or buffer where you can temporarily store pieces of text. Registers allow you to manipulate and transfer text in various ways within Vim.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can open your register by running  &lt;code&gt;:registers&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So we have list of places:&lt;/p&gt;
&lt;div class=&#34;code&#34; data-lang=&#34;csv&#34;&gt;
  &lt;div class=&#34;code-bar&#34;&gt;&lt;span&gt;[csv]&lt;/span&gt;&lt;button class=&#34;yank&#34; type=&#34;button&#34; aria-label=&#34;Copy code&#34;&gt;yy&lt;/button&gt;&lt;/div&gt;
  &lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-csv&#34; data-lang=&#34;csv&#34;&gt;Yamagawaokachiyogamizu
Eexterveenschekanaal
Jászfelsőszentgyörgy&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We need to replace &lt;strong&gt;Yamagawaokachiyogamizu&lt;/strong&gt; with &lt;strong&gt;Jászfelsőszentgyörgy&lt;/strong&gt;:&lt;/p&gt;
&lt;figure class=&#34;vid&#34;&gt;
  &lt;video controls playsinline preload=&#34;metadata&#34;&gt;
    &lt;source src=&#34;https://braynm.com/videos/blog-video-4.mp4&#34; type=&#34;video/mp4&#34;&gt;
  &lt;/video&gt;
  &lt;figcaption&gt;blog-video-4.mp4&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Let&amp;rsquo;s see what&amp;rsquo;s happening step-by-step:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Select Yamagawaokachiyogamizu&lt;/li&gt;
&lt;li&gt;Save &lt;code&gt;Yamagawaokachiyogamizu&lt;/code&gt; to &lt;strong&gt;&lt;code&gt;&amp;quot;a&lt;/code&gt;&lt;/strong&gt; register&lt;/li&gt;
&lt;li&gt;Save &lt;code&gt;Jászfelsőszentgyörgy&lt;/code&gt; to &lt;strong&gt;&lt;code&gt;&amp;quot;b&lt;/code&gt;&lt;/strong&gt; register&lt;/li&gt;
&lt;li&gt;Run substitute command: &lt;code&gt;%:s/&amp;lt;C-r&amp;gt;a/&amp;lt;C-r&amp;gt;b&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;C-r&amp;gt; {register} (e.g. &amp;lt;C-r&amp;gt;b)&lt;/code&gt; — Insert the contents of a numbered or named register.&lt;/p&gt;
&lt;p&gt;This will translates to:&lt;/p&gt;
&lt;div class=&#34;code&#34; data-lang=&#34;vim&#34;&gt;
  &lt;div class=&#34;code-bar&#34;&gt;&lt;span&gt;[vim]&lt;/span&gt;&lt;button class=&#34;yank&#34; type=&#34;button&#34; aria-label=&#34;Copy code&#34;&gt;yy&lt;/button&gt;&lt;/div&gt;
  &lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-vim&#34; data-lang=&#34;vim&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;%&lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;sr&#34;&gt;/Eexterveenschekanaal/&lt;/span&gt;Jászfelsőszentgyörgy&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This is nice! Fewer keystroke! We don&amp;rsquo;t have to type these long words manually! It might save you lot of time for some typographical errors.&lt;/p&gt;
&lt;h2 id=&#34;summary&#34;&gt;&lt;span class=&#34;hash&#34; aria-hidden=&#34;true&#34;&gt;## &lt;/span&gt;Summary&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Efficient Text Editing: Vim&amp;rsquo;s substitute command (:s) allows you to replace specific occurrences of text throughout your document fast and accurately.&lt;/li&gt;
&lt;li&gt;Targeted replacements: With various search patterns and flags, you can perform precise and targeted replacements, avoiding unintended changes.&lt;/li&gt;
&lt;li&gt;Backreferences: Leveraging backreferences (\1, \2, etc.), you can refer to captured groups in your search pattern and use them in the replacement, facilitating dynamic and personalized substitutions.&lt;/li&gt;
&lt;li&gt;Time-saving Editing Workflow: With the flexibility and power of Vim&amp;rsquo;s substitute command, you can optimize your editing workflow, saving time and increasing productivity in your daily text-editing tasks.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We learned that &lt;code&gt;substite&lt;/code&gt; is a powerful tool. Mastering regex can be hard, I personally use &lt;a href=&#34;https://regexr.com/&#34;&gt;regexr&lt;/a&gt; when dealing with regex patterns. It break down patterns with each explanation on what it does.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s all for now.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description>
    </item>
    <item>
      <title>Welcome!</title>
      <link>https://braynm.com/post/my-first-post/</link>
      <guid>https://braynm.com/post/my-first-post/</guid>
      <pubDate>Sun, 16 Jul 2023 00:00:00 &#43;0000</pubDate>
      <description>https://braynm.com/%3Ch3%20id=%22hi%22%3E%3Cspan%20class=%22hash%22%20aria-hidden=%22true%22%3E</description>
    </item>
  </channel>
</rss>
