<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[michael le]]></title><description><![CDATA[Software Engineer. Entrepreneur. This site hosts my writing on programming, health, finance, business, and self-development.]]></description><link>https://www.michael1e.com/</link><image><url>http://www.michael1e.com/favicon.png</url><title>michael le</title><link>https://www.michael1e.com/</link></image><generator>Ghost 4.48</generator><lastBuildDate>Fri, 23 Feb 2024 08:10:04 GMT</lastBuildDate><atom:link href="https://www.michael1e.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[iOS Missed Call Notification and Badge Won't Go Away? Here's the Fix!]]></title><description><![CDATA[<h4 id="the-problem">The Problem:</h4><p>The iOS missed call badge is designed to alert you when you&apos;ve missed a call. However, sometimes, even after checking the missed calls, the badge remains. This can be due to a minor glitch in the system or sometimes because the &apos;All&apos; and &apos;</p>]]></description><link>https://www.michael1e.com/ios-missed-call-notification-and-badge-wont-go-away-heres-the-fix/</link><guid isPermaLink="false">6528298c51c19a1ea979e43d</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Thu, 12 Oct 2023 17:15:29 GMT</pubDate><content:encoded><![CDATA[<h4 id="the-problem">The Problem:</h4><p>The iOS missed call badge is designed to alert you when you&apos;ve missed a call. However, sometimes, even after checking the missed calls, the badge remains. This can be due to a minor glitch in the system or sometimes because the &apos;All&apos; and &apos;Missed&apos; tabs in the &apos;Recents&apos; section of the Phone app haven&apos;t been toggled.</p><h4 id="the-solution">The Solution:</h4><p>To get rid of that stubborn missed call badge, follow these easy steps:</p><ol><li><strong>Tap on the Phone icon</strong> on your iPhone&apos;s home screen.</li><li>Once inside the Phone app, <strong>tap on &apos;Recents&apos;</strong> at the bottom.</li><li>At the top of the &apos;Recents&apos; screen, you&apos;ll see two tabs: <strong>&apos;All&apos; and &apos;Missed&apos;</strong>. Tap on them to toggle between the two.</li><li><strong>Exit the &apos;Recents&apos; screen</strong>.</li></ol>]]></content:encoded></item><item><title><![CDATA[LearnPrompting.org Notes]]></title><description><![CDATA[<p>Some notes I took from the <a href="https://learnprompting.org/docs/intro">learnprompting.org tutorial</a> and docs.</p><!--kg-card-begin: markdown--><ul>
<li>Feedback Prompt
<ul>
<li><code>Read the following excerpt from an essay and provide feedback based on the following criteria: grammar, clarity, coherence, argument quality, and use of evidence. Provide a score from 1-10 for each attribute, along with reasoning for your</code></li></ul></li></ul>]]></description><link>https://www.michael1e.com/learnprompting-org-notes/</link><guid isPermaLink="false">64f9fcdb51c19a1ea979e426</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Thu, 07 Sep 2023 16:44:47 GMT</pubDate><content:encoded><![CDATA[<p>Some notes I took from the <a href="https://learnprompting.org/docs/intro">learnprompting.org tutorial</a> and docs.</p><!--kg-card-begin: markdown--><ul>
<li>Feedback Prompt
<ul>
<li><code>Read the following excerpt from an essay and provide feedback based on the following criteria: grammar, clarity, coherence, argument quality, and use of evidence. Provide a score from 1-10 for each attribute, along with reasoning for your score.</code></li>
</ul>
</li>
<li>Different type of prompts
<ul>
<li>Instruction prompting</li>
<li>Role prompting
<ul>
<li>Michelin critic, Indiana Jones</li>
</ul>
</li>
<li>few-shot prompting
<ul>
<li>Showing the model a few examples, &#x201C;shots&#x201D;</li>
<li>Shot is synonymous with example</li>
</ul>
</li>
<li>Combination is the best
<ul>
<li><code>Twitter is a social media platform where users can post short messages called &quot;tweets&quot;. Tweets can be positive or negative, and we would like to be able to classify tweets as positive or negative. Here are some examples of positive and negative tweets. Make sure to classify the last tweet correctly. Q: Tweet: &quot;What a beautiful day!&quot; Is this tweet positive or negative? A: positive Q: Tweet: &quot;I hate this class&quot; Is this tweet positive or negative? A: negative Q: Tweet: &quot;I love pockets on jeans&quot; A:</code></li>
</ul>
</li>
</ul>
</li>
<li>parts of a prompt
<ul>
<li>A role</li>
<li>An instruction/task</li>
<li>A question</li>
<li>Context</li>
<li>Examples (few-shot)</li>
</ul>
</li>
<li>However, it&apos;s generally preferable to place the instruction last to ensure the model focuses on executing the task rather than extending the context</li>
<li>Priming prompt
<ul>
<li>Used to structure and style a conversation with a chatbot
<ul>
<li>Talk like a pirate</li>
<li>Control the structure output of messages</li>
</ul>
</li>
</ul>
</li>
</ul>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Naming Convention for Tax Files and Documents]]></title><description><![CDATA[<p>When it comes to naming your tax document files, it&apos;s important to use a consistent naming convention that allows you to easily locate and identify the files you need. Here are some tips on how to name your tax document files:</p><ol><li>Use descriptive names: Your file names should</li></ol>]]></description><link>https://www.michael1e.com/naming-convention-for-tax-files-and-documents/</link><guid isPermaLink="false">6429f42b51c19a1ea979e417</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Sun, 02 Apr 2023 21:31:56 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1586486855514-8c633cc6fd38?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDEzfHx0YXh8ZW58MHx8fHwxNjgwNDcxMDk0&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1586486855514-8c633cc6fd38?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDEzfHx0YXh8ZW58MHx8fHwxNjgwNDcxMDk0&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="Naming Convention for Tax Files and Documents"><p>When it comes to naming your tax document files, it&apos;s important to use a consistent naming convention that allows you to easily locate and identify the files you need. Here are some tips on how to name your tax document files:</p><ol><li>Use descriptive names: Your file names should accurately describe the content of the file. For example, &quot;2019 Tax Return.pdf&quot; is more descriptive than &quot;Document 1.pdf&quot;.</li><li>Include the tax year: Make sure to include the tax year in the file name to avoid confusion later on. For example, &quot;2022 W-2 Form.pdf&quot; is more useful than just &quot;W-2 Form.pdf&quot;.</li><li>Use underscores or hyphens: Use underscores or hyphens to separate words in the file name. This makes the file name easier to read and search for.</li><li>Be consistent: Use the same naming convention for all of your tax documents to make it easier to sort and locate them.</li></ol><p>Some examples of good tax document file names might include:</p><ul><li>2021_Tax_Return.pdf</li><li>2022_W-2_Form.pdf</li><li>2021_Deductible_Expenses.xlsx</li><li>2022_1099-MISC.pdf</li></ul><p>By using a consistent and descriptive naming convention for your tax document files, you can easily find and organize your important financial documents.</p>]]></content:encoded></item><item><title><![CDATA[VSCode Set Max Amount of Opened Tabs]]></title><description><![CDATA[<h2 id="introduction">Introduction</h2><p>Visual Studio Code allows you to set a maximum limit on the number of tabs that can be open at a time in the editor. This helps you stay organized and work more efficiently while coding. Here&apos;s how to do it.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="http://www.michael1e.com/content/images/2023/02/Screen-Shot-2023-02-15-at-3.22.40-PM.png" class="kg-image" alt loading="lazy" width="486" height="400"><figcaption>Setting max opened tabs</figcaption></figure><h2 id="setting-vscode-max-opened-tabs">Setting VSCode</h2>]]></description><link>https://www.michael1e.com/vscode-set-max-amount-of-tabs/</link><guid isPermaLink="false">63ed696951c19a1ea979e3f0</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Wed, 15 Feb 2023 23:28:12 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1603468620905-8de7d86b781e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDE4fHxjb2RlfGVufDB8fHx8MTY3NjUwMzc1NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<h2 id="introduction">Introduction</h2><img src="https://images.unsplash.com/photo-1603468620905-8de7d86b781e?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDE4fHxjb2RlfGVufDB8fHx8MTY3NjUwMzc1NQ&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="VSCode Set Max Amount of Opened Tabs"><p>Visual Studio Code allows you to set a maximum limit on the number of tabs that can be open at a time in the editor. This helps you stay organized and work more efficiently while coding. Here&apos;s how to do it.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="http://www.michael1e.com/content/images/2023/02/Screen-Shot-2023-02-15-at-3.22.40-PM.png" class="kg-image" alt="VSCode Set Max Amount of Opened Tabs" loading="lazy" width="486" height="400"><figcaption>Setting max opened tabs</figcaption></figure><h2 id="setting-vscode-max-opened-tabs">Setting VSCode Max Opened Tabs</h2><p>1) Open VSCode Settings.<br>2) Filter the settings with <code>workbench.editor.limit</code> <br>3) Mark <code>workbench.editor.limit.enabled</code> to true<br>4) Mark <code>workbench.editor.limit.value</code> to the max amount of tabs you would like.</p><p>Source: <a href="https://twitter.com/code/status/1483843457730949124?lang=en"><a href="https://twitter.com/code/status/1483843457730949124?lang=en">V</a>SCode Twitter</a></p>]]></content:encoded></item><item><title><![CDATA[Getting "invalid active developer path" when using git on macOS Ventura Upgrade]]></title><description><![CDATA[<h2 id="issue">Issue</h2><p>After upgrading to macOS Ventura, I tried to run <code>git</code> from Terminal but it kept giving me the following error:</p><pre><code class="language-bash">xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun.</code></pre><h2 id="solution">Solution</h2><p>Open Terminal, and run the following:</p><pre><code>xcode-select --install
</code></pre><p>This will</p>]]></description><link>https://www.michael1e.com/getting-invalid-active-developer-path-when-using-git-on-macos-ventura-upgrade/</link><guid isPermaLink="false">63c1da0b51c19a1ea979e3d5</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Fri, 13 Jan 2023 22:27:08 GMT</pubDate><content:encoded><![CDATA[<h2 id="issue">Issue</h2><p>After upgrading to macOS Ventura, I tried to run <code>git</code> from Terminal but it kept giving me the following error:</p><pre><code class="language-bash">xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun.</code></pre><h2 id="solution">Solution</h2><p>Open Terminal, and run the following:</p><pre><code>xcode-select --install
</code></pre><p>This will pop a dialogue box, Select &quot;Install&quot;, and it will download and install the <a href="https://developer.apple.com/library/archive/technotes/tn2339/_index.html" rel="noreferrer">Command Line Tools package</a> and fix the problem. (The popped Window may be behind other windows.)</p><p>You do <em><em>not</em></em> need Xcode, you can install only the Command Line Tools here, it is about 130 MB (600 MB as of Xcode v14.1).</p><p>If the above alone doesn&apos;t do it, then also run:</p><pre><code>sudo xcode-select --reset</code></pre><p>It&apos;s possible you may need to accept Xcode license too.</p><pre><code class="language-bash">sudo xcodebuild -license accept</code></pre>]]></content:encoded></item><item><title><![CDATA[Display days to account expiration using luxon]]></title><description><![CDATA[<p>I wanted to let users know how many days left in their trial subscription they had left. Using the <code>luxon</code> package, I was able to format the date correctly by getting the difference between the user&apos;s creation date and 7 days.</p><p>After installing <code>luxon</code> with <code>npm install luxon</code></p>]]></description><link>https://www.michael1e.com/display-expiration-date-using-luxon/</link><guid isPermaLink="false">6348894851c19a1ea979e3a8</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Thu, 13 Oct 2022 21:59:11 GMT</pubDate><content:encoded><![CDATA[<p>I wanted to let users know how many days left in their trial subscription they had left. Using the <code>luxon</code> package, I was able to format the date correctly by getting the difference between the user&apos;s creation date and 7 days.</p><p>After installing <code>luxon</code> with <code>npm install luxon --save</code>, I wrote the below function.</p><pre><code class="language-javascript">import { DateTime } from &apos;luxon&apos;

daysToAccountExpiration(userCreationDate) {
    const created = DateTime.fromISO(userCreationDate)
    const expiration = created.plus({ days: 7 })
    const daysLeft = Math.floor(expiration.diff(DateTime.now(), [&apos;days&apos;]).as(&apos;days&apos;))
    return daysLeft
  }</code></pre>]]></content:encoded></item><item><title><![CDATA[Generate .nvmrc file with current node version]]></title><description><![CDATA[<pre><code>node -v &gt; .nvmrc</code></pre><p>Run the above command with nvm configuration to switch to the correct node version for a project.</p>]]></description><link>https://www.michael1e.com/generate-nvmrc-file-with-current-node-version/</link><guid isPermaLink="false">6346f8f351c19a1ea979e395</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Wed, 12 Oct 2022 17:29:09 GMT</pubDate><content:encoded><![CDATA[<pre><code>node -v &gt; .nvmrc</code></pre><p>Run the above command with nvm configuration to switch to the correct node version for a project.</p>]]></content:encoded></item><item><title><![CDATA[Remove All Lines Containing String in VSCode]]></title><description><![CDATA[<p>How do we delete entire lines containing a certain substring in VSCode with the <code>Find</code> function?</p><h2 id="example-scenerio-in-vscode">Example Scenerio in VSCode</h2><p>I had a JSON file where I wanted to delete every line containing the line <code>code</code> where every value of <code>code</code> was different. </p><figure class="kg-card kg-code-card"><pre><code class="language-javascript">// Example json
[
  {
    &quot;name&quot;: &quot;United</code></pre></figure>]]></description><link>https://www.michael1e.com/remove-all-lines-containing-substring-in-vs-code/</link><guid isPermaLink="false">62bb8083aa131a04a63ade58</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Tue, 28 Jun 2022 22:37:31 GMT</pubDate><content:encoded><![CDATA[<p>How do we delete entire lines containing a certain substring in VSCode with the <code>Find</code> function?</p><h2 id="example-scenerio-in-vscode">Example Scenerio in VSCode</h2><p>I had a JSON file where I wanted to delete every line containing the line <code>code</code> where every value of <code>code</code> was different. </p><figure class="kg-card kg-code-card"><pre><code class="language-javascript">// Example json
[
  {
    &quot;name&quot;: &quot;United Kingdom&quot;,
    &quot;dial_code&quot;: &quot;+44&quot;,
    &quot;code&quot;: &quot;GB&quot;
  },
  {
    &quot;name&quot;: &quot;United States&quot;,
    &quot;dial_code&quot;: &quot;+1&quot;,
    &quot;code&quot;: &quot;US&quot;
  },
  {
    &quot;name&quot;: &quot;Uruguay&quot;,
    &quot;dial_code&quot;: &quot;+598&quot;,
    &quot;code&quot;: &quot;UY&quot;
  },
  {
    &quot;name&quot;: &quot;Uzbekistan&quot;,
    &quot;dial_code&quot;: &quot;+998&quot;,
    &quot;code&quot;: &quot;UZ&quot;
  },
  {
    &quot;name&quot;: &quot;Vanuatu&quot;,
    &quot;dial_code&quot;: &quot;+678&quot;,
    &quot;code&quot;: &quot;VU&quot;
  },
  {
    &quot;name&quot;: &quot;Venezuela, Bolivarian Republic of Venezuela&quot;,
    &quot;dial_code&quot;: &quot;+58&quot;,
    &quot;code&quot;: &quot;VE&quot;
  },
  {
    &quot;name&quot;: &quot;Vietnam&quot;,
    &quot;dial_code&quot;: &quot;+84&quot;,
    &quot;code&quot;: &quot;VN&quot;
  }
]
</code></pre><figcaption>International phone number codes&#xA0;</figcaption></figure><h2 id="using-regex-and-vscode-find-in-file-function">Using regex and VSCode Find in File function.</h2><ol><li>Open VSCode&#x2019;s <code>Search: Find in Files</code>. (cmd+f)</li><li>Click on the regular expression button <code>[.*]</code></li><li>Write the regular expression <code>^.*[STRING].*$\n</code>, where <code>[STRING]</code> is your substring. It would be <code>^.*code.*$\n</code> in our example scenario</li><li>Replace all with an empty line. </li></ol><figure class="kg-card kg-image-card"><img src="http://www.michael1e.com/content/images/2022/06/Screen-Shot-2022-06-28-at-3.37.04-PM.png" class="kg-image" alt loading="lazy" width="417" height="65"></figure>]]></content:encoded></item><item><title><![CDATA[Set Node Runtime Version in VSCode]]></title><description><![CDATA[<h2 id="issue">Issue</h2><p>I have <a href="https://github.com/nvm-sh/nvm">nvm</a> installed on my Macbook Pro. Some deployed versions of my app run on Docker and on specific Node versions. I got different types of errors from packages and from Node when things weren&apos;t compiling. I wanted to force my Visual Studio Code editor to</p>]]></description><link>https://www.michael1e.com/set-node-runtime-version-in-vscode/</link><guid isPermaLink="false">623df8b4960f3a1a077698dc</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Fri, 25 Mar 2022 17:20:32 GMT</pubDate><content:encoded><![CDATA[<h2 id="issue">Issue</h2><p>I have <a href="https://github.com/nvm-sh/nvm">nvm</a> installed on my Macbook Pro. Some deployed versions of my app run on Docker and on specific Node versions. I got different types of errors from packages and from Node when things weren&apos;t compiling. I wanted to force my Visual Studio Code editor to run certain versions of Node. </p><h2 id="method-1">Method 1:</h2><p>Set your nvm alias in your terminal to the Node version you want.</p><pre><code class="language-bash">$nvm alias default 12</code></pre><h2 id="method-2">Method 2:</h2><p>My preferred way of running the Node version is by adding it to my <code>launch.json</code> file.</p><pre><code class="language-javascript">{
  &quot;version&quot;: &quot;&lt;some-version&gt;&quot;,
  &quot;configurations&quot;: [
  {
    &quot;type&quot;: &quot;node&quot;,
    &quot;runtimeVersion&quot;: &quot;12&quot;, // If i need to run node 12
    &quot;request&quot;: &quot;launch&quot;,
    &quot;name&quot;: &quot;Launch&quot;,
    &quot;program&quot;: &quot;${workspaceFolder}/sample.js&quot;
  }
]}</code></pre>]]></content:encoded></item><item><title><![CDATA[Running Kafka Consumer with multiple brokers]]></title><description><![CDATA[<p>Read messages and events from multiple Kafka brokers through the command line.</p><pre><code class="language-bash">bin/kafka-console-consumer.sh --bootstrap-server localhost:9092,localhost:9093,localhost:9094 --from-beginning --topic my-replicated-topic</code></pre>]]></description><link>https://www.michael1e.com/running-kafka-consumer-with-multiple-brokers/</link><guid isPermaLink="false">621fe89b960f3a1a077698cb</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Wed, 02 Mar 2022 22:00:28 GMT</pubDate><content:encoded><![CDATA[<p>Read messages and events from multiple Kafka brokers through the command line.</p><pre><code class="language-bash">bin/kafka-console-consumer.sh --bootstrap-server localhost:9092,localhost:9093,localhost:9094 --from-beginning --topic my-replicated-topic</code></pre>]]></content:encoded></item><item><title><![CDATA[Installing pgcrypto on Postgresql Docker]]></title><description><![CDATA[<p>I was getting an error from Postgresql where <code>function get_random_uuid() does not exist</code>. My Postgresql hosted on my Docker did not have the pgcrypto extension loaded. I ran the code below to enable pgcrypto.</p><p>Using PSQL or PgAdmin, connect to the DB and type</p><pre><code class="language-sql">CREATE EXTENSION IF NOT</code></pre>]]></description><link>https://www.michael1e.com/installing-pgcrypto-on-postgresql-docker/</link><guid isPermaLink="false">61c21b37960f3a1a077698b7</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Tue, 21 Dec 2021 18:22:48 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1554098415-788601c80aef?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDJ8fHNxbHxlbnwwfHx8fDE2NDAxMTA5NDc&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1554098415-788601c80aef?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDJ8fHNxbHxlbnwwfHx8fDE2NDAxMTA5NDc&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" alt="Installing pgcrypto on Postgresql Docker"><p>I was getting an error from Postgresql where <code>function get_random_uuid() does not exist</code>. My Postgresql hosted on my Docker did not have the pgcrypto extension loaded. I ran the code below to enable pgcrypto.</p><p>Using PSQL or PgAdmin, connect to the DB and type</p><pre><code class="language-sql">CREATE EXTENSION IF NOT EXISTS pgcrypto;</code></pre>]]></content:encoded></item><item><title><![CDATA[Autoscroll VSCode Debug Console]]></title><description><![CDATA[<p>I found it annoying my VS Code debug console was not auto scrolling. It turns out enabling Word Wrap turns off autoscroll. </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="http://www.michael1e.com/content/images/2021/05/Screen-Shot-2021-05-03-at-10.22.54-PM.png" class="kg-image" alt="Turn off word wrap for vscode autoscroll" loading="lazy" width="589" height="67"><figcaption>Turn off word wrap</figcaption></figure><p>In order to turn off word wrap:<br>1) Open up your settings.<br>2) Go to Debug &gt; Console &gt; Word Wrap<br>3) Uncheck the</p>]]></description><link>https://www.michael1e.com/autoscroll-vscode-debug-console/</link><guid isPermaLink="false">6090d9f034ef422dbc971539</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Tue, 04 May 2021 05:24:54 GMT</pubDate><content:encoded><![CDATA[<p>I found it annoying my VS Code debug console was not auto scrolling. It turns out enabling Word Wrap turns off autoscroll. </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="http://www.michael1e.com/content/images/2021/05/Screen-Shot-2021-05-03-at-10.22.54-PM.png" class="kg-image" alt="Turn off word wrap for vscode autoscroll" loading="lazy" width="589" height="67"><figcaption>Turn off word wrap</figcaption></figure><p>In order to turn off word wrap:<br>1) Open up your settings.<br>2) Go to Debug &gt; Console &gt; Word Wrap<br>3) Uncheck the box</p>]]></content:encoded></item><item><title><![CDATA[How To Create a Vue Country Code Dropdown]]></title><description><![CDATA[<h2 id="introduction">Introduction</h2><p>I wanted to create a Vue dropdown component that allows users to select a country. Ideally, I would prefer to use a package that provides country codes with the country selection. With over 200+ countries, I&#x2019;d rather not do it by hand.</p><h2 id="what-are-country-codes">What are country codes?</h2><p>Country</p>]]></description><link>https://www.michael1e.com/how-to-create-a-country-select-dropdown-in-vue/</link><guid isPermaLink="false">606d3bf73e2c6947b9ac8fb0</guid><category><![CDATA[programming]]></category><category><![CDATA[vue]]></category><category><![CDATA[web development]]></category><category><![CDATA[javascript]]></category><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Wed, 07 Apr 2021 04:58:31 GMT</pubDate><content:encoded><![CDATA[<h2 id="introduction">Introduction</h2><p>I wanted to create a Vue dropdown component that allows users to select a country. Ideally, I would prefer to use a package that provides country codes with the country selection. With over 200+ countries, I&#x2019;d rather not do it by hand.</p><h2 id="what-are-country-codes">What are country codes?</h2><p>Country codes are short alphabetic or numeric geographic codes, similar to state initials, except for countries.</p><h2 id="country-code-package">Country code package</h2><p>I found a npm package <code>i18n-iso-countries</code> which provides us the ISO 3166-1 code in Alpha-2, Alpha-3, and Numeric codes. We can always double-check the [official country codes] through Wikipedia.</p><h2 id="installation">Installation</h2><p>Install with npm: <code>npm install i18n-iso-countries --save</code></p><p>To use it in a browser environment, we need to register the language.</p><pre><code class="language-js">// Support English languages.
countries.registerLocale(require(&quot;i18n-iso-countries/langs/en.json&quot;));
</code></pre><h2 id="creating-the-select-input">Creating the select input</h2><p>Let&#x2019;s create the country select dropdown with selected as a data variable. Selection options are generally in an Array full of Objects in label, value pairs.</p><pre><code>&lt;template&gt;
  &lt;select v-model=&quot;selected&quot;&gt;
    &lt;option v-for=&quot;option in options&quot; :value=&quot;option.value&quot;&gt;
      {{ option.label }}
    &lt;/option&gt;
  &lt;/select&gt;
&lt;/template&gt;
&lt;script&gt;
export default {
 name: &apos;CountrySelection&apos;,
 data () {
   return {
     selected: null,
     options: []
   }
 }
}
&lt;/script&gt;
</code></pre><h2 id="importing-the-country-codes">Importing the country codes</h2><p>Let&#x2019;s import the <code>i18n-iso-countries</code> package and register the English locale.</p><pre><code class="language-js">
&lt;template&gt;
  ...
&lt;/template&gt;
&lt;script&gt;
const countries = require(&apos;i18n-iso-countries&apos;)
countries.registerLocale(require(&apos;i18n-iso-countries/langs/en.json&apos;))

export default {
  name: &apos;CountrySelection&apos;,
  data () {
    ...
  }
}
&lt;/script&gt;

</code></pre><p><br>Instead of using a data option variable, I&#x2019;m going to map through the countries and create an array as computed.</p><pre><code class="language-js">&lt;template&gt;
 ...
&lt;/template&gt;
&lt;script&gt;
const countries = require(&apos;i18n-iso-countries&apos;)
countries.registerLocale(require(&apos;i18n-iso-countries/langs/en.json&apos;))
export default {
  name: &apos;CountrySelection&apos;,
  computed: {
    countries () {
      const list = countries.getNames(&apos;en&apos;, { select: &apos;official&apos; })
      return Object.keys(list).map((key) =&gt; ({ value: key, label: list[key] }))
    }
  },
  data () {
    return {
      selected: null
    }
  }
}
&lt;/script&gt;
</code></pre><h2 id="creating-a-vue-country-code-select">Creating a Vue Country Code Select</h2><p>Now, we can update the options to iterate through the <code>countries</code> computed property.</p><pre><code class="language-js">&lt;template&gt;
  &lt;select v-model=&quot;selected&quot;&gt;
    &lt;option v-for=&quot;country in countries&quot; :value=&quot;country.value&quot;&gt;
      {{ country.label }}
    &lt;/option&gt;
  &lt;/select&gt;
&lt;/template&gt;
&lt;script&gt;
const countries = require(&apos;i18n-iso-countries&apos;)
countries.registerLocale(require(&apos;i18n-iso-countries/langs/en.json&apos;))
export default {
  name: &apos;CountrySelection&apos;,
  computed: {
    countries () {
      const list = countries.getNames(&apos;en&apos;, { select: &apos;official&apos; })
      return Object.keys(list).map((key) =&gt; ({ value: key, label: list[key] }))
    }
  },
  data () {
    return {
      selected: null
    }
  }
}
&lt;/script&gt;
</code></pre><h2 id="conclusion">Conclusion</h2><p>Using <code>i18n-iso-countries</code>, we created a Vue selection component that provides us with the ISO codes of each country. This is a great addition to any Vue form for international users.</p><figure class="kg-card kg-image-card"><img src="http://www.michael1e.com/content/images/2021/04/Screen-Recording-2021-04-06-at-6.02.30-PM.gif" class="kg-image" alt loading="lazy"></figure>]]></content:encoded></item><item><title><![CDATA[EZOIC Review: How I doubled my revenue in one month with Ezoic in 2021]]></title><description><![CDATA[How I made more money with Ezoic than Adsense in one month. Best case study out there with pictures of my revenue and numbers.]]></description><link>https://www.michael1e.com/ezoic-review/</link><guid isPermaLink="false">605cf2763e2c6947b9ac8f5f</guid><category><![CDATA[personal finance]]></category><category><![CDATA[adsense]]></category><category><![CDATA[ezoic]]></category><category><![CDATA[google]]></category><category><![CDATA[money]]></category><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Thu, 25 Mar 2021 20:34:52 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1579621970795-87facc2f976d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDJ8fG1vbmV5fGVufDB8fHx8MTYxNjcwNDQ3Mg&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<h2 id="how-to-make-money-on-your-blog">How to make money on your blog</h2><img src="https://images.unsplash.com/photo-1579621970795-87facc2f976d?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MnwxMTc3M3wwfDF8c2VhcmNofDJ8fG1vbmV5fGVufDB8fHx8MTYxNjcwNDQ3Mg&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" alt="EZOIC Review: How I doubled my revenue in one month with Ezoic in 2021"><p>The easiest way to make money from your website and blog is by serving ads. &#xA0;<a href="https://www.google.com/adsense/start/">Google Adsense</a> has been around for over 15 years and there are now companies who pump your Adsense ads with steroids. In this post, I detail how much I was making with Adsense vs <a href="https://ezoic.com/?tap_a=6182-5778c2&amp;tap_s=1358495-890b67">Ezoic</a> and the amount of traffic required to get <a href="https://ezoic.com/?tap_a=6182-5778c2&amp;tap_s=1358495-890b67">Ezoic</a>. Let&#x2019;s get it! &#x1F4B0;</p><h3 id="update">Update:</h3><p>As of August 2022, I generate about <strong>$1500/month</strong> through my site.</p><h2 id="what-is-ezoic">What is Ezoic?</h2><!--kg-card-begin: html--><a href="https://www.ezoic.com/?tap_a=66667-6c3333&amp;tap_s=1358495-890b67" target="_BLANK" rel="nofollow"><img src="https://static.tapfiliate.com/5e6add9863d97.jpg?a=66667-6c3333&amp;s=1358495-890b67" border="0" alt="EZOIC Review: How I doubled my revenue in one month with Ezoic in 2021"></a><!--kg-card-end: html--><blockquote>Ezoic is an all-in-one publishing platform that allows digital publishers to scale intelligent decision-making on their websites easily. Publishers use Ezoic to improve user experiences and increase website revenue by using machine learning to adapt things like ads, layouts, and content to visitors on their websites based on the results of the automated multi-variate test.</blockquote><p>In other words, Ezoic takes your Google Ads and uses machine learning to get you the most money.</p><h2 id="ezoic-requirements">Ezoic Requirements</h2><p>To monetize with <a href="https://ezoic.com/?tap_a=6182-5778c2&amp;tap_s=1358495-890b67">Ezoic</a>, you must meet some of their requirements.</p><ol><li>Traffic size<br>Ezoic recommends you have an average of 10,000 visits a month. The more the better. Their machine learning algorithm needs a lot of data to figure out how to serve your ads for the most money.</li><li>Adsense<br>You have to already have a Google Adsense account with the website. It has to be in good standing with Google.</li><li>Adhere to &#xA0;<a href="https://support.google.com/adspolicy/answer/6008942?visit_id=637193837261946747-3713986391&amp;rd=1">Google&#x2019;s Ad Policy</a><br>Your site has to have original content, no keyword stuffing, and no invalid impressions.</li><li>Site Content<br>Rich, informational content sites benefit everybody. Google Adsense and Ezoic want to ensure a good experience for users and advertisers.</li></ol><h2 id="case-study-how-much-did-i-make-on-a-6-year-old-gaming-blog">Case study: How much did I make on a 6 year old gaming blog</h2><p>The best way to show you the difference between Adsense and Ezoic is to compare them side by side. The site stats is a 6-year-old blog in the gaming niche.</p><h3 id="how-much-i-made-with-google-adsense">How much I made with Google Adsense</h3><figure class="kg-card kg-image-card kg-card-hascaption"><img src="http://www.michael1e.com/content/images/2021/03/image.png" class="kg-image" alt="EZOIC Review: How I doubled my revenue in one month with Ezoic in 2021" loading="lazy" width="1155" height="688" srcset="http://www.michael1e.com/content/images/size/w600/2021/03/image.png 600w, http://www.michael1e.com/content/images/size/w1000/2021/03/image.png 1000w, http://www.michael1e.com/content/images/2021/03/image.png 1155w" sizes="(min-width: 720px) 720px"><figcaption>My Adsense revenue of $82.15</figcaption></figure><p>For December 2020, I made <strong>$81.15</strong> for over 29,000 page views with Google Adsense. &#xA0;On average, this is <strong>$2.65 a day</strong>, which isn&#x2019;t bad. The important stat is <em>Page RPM</em>, &#xA0;which means how much you get paid for every &#xA0;1 thousand views. My Page RPM shows as <strong>$2.76</strong>, which means 29,744 views x $2.76 = $82.15 in earnings. My site was starting to gain traction closer to the end of the month and following into the year 2021.</p><h3 id="how-much-did-i-make-with-ezoic">How much did I make with Ezoic</h3><figure class="kg-card kg-image-card kg-card-hascaption"><img src="http://www.michael1e.com/content/images/2021/03/image-2.png" class="kg-image" alt="EZOIC Review: How I doubled my revenue in one month with Ezoic in 2021" loading="lazy" width="1228" height="725" srcset="http://www.michael1e.com/content/images/size/w600/2021/03/image-2.png 600w, http://www.michael1e.com/content/images/size/w1000/2021/03/image-2.png 1000w, http://www.michael1e.com/content/images/2021/03/image-2.png 1228w" sizes="(min-width: 720px) 720px"><figcaption>My Ezoic revenue of $202.66</figcaption></figure><p>Wow, switching over to Ezoic, I more than doubled my site&apos;s money. I made <strong>$202.66</strong> for February 2021. Ezoic&#x2019;s version of Page RPM is <em>EPMV</em>, and as you can see it&#x2019;s more than doubled Adsense&#x2019;s RPM <strong>$5.81</strong>. I make <strong>$7.24 A DAY</strong> with Ezoic. Crazy!</p><p>As I said, my site is starting to gain more traction, so the page views are higher than in December 2020. If you want a one-to-one comparison, you can just take Ezoic&#x2019;s EPMV and multiply it by 29 to get a better estimate. If the two months had the same 29,000 page views in traffic, I would&#x2019;ve received <strong>$168.49</strong>.</p><h3 id="combination-of-adsense-and-ezoic">Combination of Adsense and Ezoic</h3><p>Even though I switched over to <a href="https://ezoic.com/?tap_a=6182-5778c2&amp;tap_s=1358495-890b67">Ezoic</a>, I still generate a little bit of Adsense revenue. This is because Adsense ads are still being served, just with Ezoic&#x2019;s steroids. &#xA0;Add another $24.84 for February 2021.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="http://www.michael1e.com/content/images/2021/03/image-3.png" class="kg-image" alt="EZOIC Review: How I doubled my revenue in one month with Ezoic in 2021" loading="lazy" width="851" height="418" srcset="http://www.michael1e.com/content/images/size/w600/2021/03/image-3.png 600w, http://www.michael1e.com/content/images/2021/03/image-3.png 851w" sizes="(min-width: 720px) 720px"><figcaption>Still making adsense revenue $24.84</figcaption></figure><p>My February 2021 revenue for my site is <strong>$227.5</strong>. &#x1F3E6;</p><h2 id="latest-update">Latest Update</h2><p>As of August 2022, I generate about <strong>$1500/month</strong> through my site.</p><h2 id="conclusion">Conclusion</h2><figure class="kg-card kg-image-card kg-card-hascaption"><img src="http://www.michael1e.com/content/images/2021/03/image-4.png" class="kg-image" alt="EZOIC Review: How I doubled my revenue in one month with Ezoic in 2021" loading="lazy" width="1248" height="527" srcset="http://www.michael1e.com/content/images/size/w600/2021/03/image-4.png 600w, http://www.michael1e.com/content/images/size/w1000/2021/03/image-4.png 1000w, http://www.michael1e.com/content/images/2021/03/image-4.png 1248w" sizes="(min-width: 720px) 720px"><figcaption>Still making bank with Ezoic</figcaption></figure><p>Moving to Ezoic has been the best thing I have done. My numbers have been looking better and better. Once you meet the requirements, I highly suggest <a href="https://ezoic.com/?tap_a=6182-5778c2&amp;tap_s=1358495-890b67">signing up for Ezoic</a>. You can see their 2019 <a href="https://40cupx20bt643wowwz361l9h-wpengine.netdna-ssl.com/wp-content/uploads/2019/01/2019-Ezoic-Publisher-Performance-Report-hi-res.pdf">revenue report</a> of publishers. I used this to determine how much I could make with Ezoic. <br></p><p></p>]]></content:encoded></item><item><title><![CDATA[How To Batch Rename TXT files to JSON]]></title><description><![CDATA[<h2 id="introduction">Introduction</h2><p>I needed to rename a bunch of .txt files to .json and I was too lazy to hand type it.<br>I found a quick bash script which can be ran in Mac OSX Terminal or any shell.</p><h2 id="renaming-the-files-dry-run">Renaming the files (dry run)</h2><p>This script will print out the new</p>]]></description><link>https://www.michael1e.com/how-to-batch-rename-txt-files-to-json/</link><guid isPermaLink="false">605ad7c13e2c6947b9ac8f17</guid><dc:creator><![CDATA[Michael Le]]></dc:creator><pubDate>Wed, 24 Mar 2021 06:20:02 GMT</pubDate><content:encoded><![CDATA[<h2 id="introduction">Introduction</h2><p>I needed to rename a bunch of .txt files to .json and I was too lazy to hand type it.<br>I found a quick bash script which can be ran in Mac OSX Terminal or any shell.</p><h2 id="renaming-the-files-dry-run">Renaming the files (dry run)</h2><p>This script will print out the new file names but won&apos;t rename them. This is to ensure, the bash script is renaming correct .txt files.</p><p>1) <code>cd</code> into the directory <br>2) Then type in the command <code>touch rename.sh</code>. This will create a new shell script.<br>3) We need to set permissions first by making it executable. <code>chmod 755 rename.sh</code>.<br>4) Copy and paste this to <code>rename.sh</code></p><figure class="kg-card kg-code-card"><pre><code class="language-bash">for file in *.txt
do
  echo mv &quot;$file&quot; &quot;$(basename &quot;$file&quot; .txt).txt&quot;
done</code></pre><figcaption>rename.sh</figcaption></figure><p>5) Run <code>./rename.sh</code></p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="http://www.michael1e.com/content/images/2021/03/Screen-Shot-2021-03-23-at-11.16.32-PM.png" class="kg-image" alt loading="lazy" width="310" height="262"><figcaption>Dry run of renaming .txt to .json files</figcaption></figure><h2 id="renaming-txt-to-json">Renaming .txt to .json </h2><p>If your dry run is successful, then we can remove <code>echo</code> from script. <code>echo</code> is a print function of bash, similar to <code>console.log</code> for Javascript.</p><figure class="kg-card kg-code-card"><pre><code class="language-bash">for file in *.txt
do
  mv &quot;$file&quot; &quot;$(basename &quot;$file&quot; .txt).txt&quot;
done</code></pre><figcaption>rename.sh</figcaption></figure><h2 id="conclusion">Conclusion</h2><p>You can run this script for any file extension as long as you change the .txt and json.</p>]]></content:encoded></item></channel></rss>