<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>JavaScript &amp;mdash; Attach to Process</title>
    <link>https://devblog.dinobansigan.com/tag:JavaScript</link>
    <description>Thoughts and Notes on Software Development</description>
    <pubDate>Mon, 27 Apr 2026 16:29:26 +0000</pubDate>
    <image>
      <url>https://i.snap.as/4wmUdb6N.png</url>
      <title>JavaScript &amp;mdash; Attach to Process</title>
      <link>https://devblog.dinobansigan.com/tag:JavaScript</link>
    </image>
    <item>
      <title>DevNotes - 004 </title>
      <link>https://devblog.dinobansigan.com/devnotes-004?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[To cause Azure to keep sending emails repeatedly for your Heath Check alerts, you need to uncheck the checkbox that says &#34;Automatically Resolve Alerts&#34;. &#xA;&#xA;hr class=&#34;sb&#34;/&#xA;&#xA;If you want to see what kind of error Axios throws, it is better to use console.log(error.toJSON()) than console.log(error). That&#39;s because the former option will list out all the properties from the error variable, while the latter option will only list out the error message itself.&#xA;&#xA;hr class=&#34;sb&#34;/&#xA;&#xA;Instead of adding todo comments, track it as a task so it doesn&#39;t get lost.&#xA;&#xA;Source: TODO: Post an Article&#xA;&#xA;hr class=&#34;sb&#34;/&#xA;&#xA;Looking for a new way to do end-to-end testing on modern web apps? Check out Playwright. The tests are pretty easy to follow because it&#39;s basically a set of instructions written in code. So as you might have guessed, it&#39;s catered more to developers than non-technical folks.&#xA;&#xA;hr class=&#34;sb&#34;/&#xA;&#xA;I am going through the Pro ASP.NET Core 6 book. After trying to run the command libman install bootstrap@5.1.3 -d wwwroot/lib/bootstrap from page 72 (Chapter 4) of the book, I started getting the error listed below:&#xA;&#xA;[LIB002]: The &#34;bootstrap@5.1.3&#34; library could not be resolved by the &#34;cdnjs&#34; provider&#xA;&#xA;Turns out it was an issue with the library manager package that was installed. The fix is to install a newer one. More info can be found here: &#xA;&#xA;https://github.com/Apress/pro-asp.net-core-6/blob/main/errata.md&#xA;&#xA;hr class=&#34;sb&#34;/&#xA;&#xA;Was looking for a way to add a list of objects to the appsettings.json file, then retrieve that list and turn them into something I can check against in a controller class. This answer works wonderfully.&#xA;&#xA;hr class=&#34;sb&#34;/&#xA;&#xA;React Hook Form -- seems like a cool alternative form handler for React.&#xA;&#xA;hr class=&#34;sb&#34;/&#xA;&#xA;SQL to MongoDB Mapping Chart -- good reference on how to write MongoDB queries based on expected SQL Server queries.&#xA;&#xA;hr class=&#34;sb&#34;/&#xA;&#xA;Reasons to blog if you&#39;re a software developer:&#xA;&#xA;It helps you write better emails at work.&#xA;It helps you write better user stories and acceptance criteria.&#xA;It helps you communicate your ideas better.&#xA;&#xA;If you&#39;re noticing a pattern there, it&#39;s all about being a better communicator. And you would want that, because that also helps you advance in your career.&#xA;&#xA;hr class=&#34;sb&#34;/&#xA;&#xA;Series: #DevNotes&#xA;Tags: #Axios #ASPNetCore #Azure #Blogging #JavaScript #MongoDB #Playwright #React #SqlServer #Tests&#xA;&#xA;a href=&#34;https://remark.as/p/devblog.dinobansigan.com/devnotes-004&#34;Discuss.../a or leave a comment below.]]&gt;</description>
      <content:encoded><![CDATA[<p>To cause Azure to keep sending emails repeatedly for your Heath Check alerts, you need to uncheck the checkbox that says “Automatically Resolve Alerts”.</p>

<hr class="sb"/>

<p>If you want to see what kind of error <a href="https://axios-http.com/">Axios</a> throws, it is better to use <code>console.log(error.toJSON())</code> than <code>console.log(error)</code>. That&#39;s because the former option will list out all the properties from the error variable, while the latter option will only list out the error message itself.</p>

<hr class="sb"/>

<p>Instead of adding <em>todo</em> comments, track it as a task so it doesn&#39;t get lost.</p>

<p>Source: <a href="https://thedailywtf.com/articles/todo-post-an-article">TODO: Post an Article</a></p>

<hr class="sb"/>

<p>Looking for a new way to do end-to-end testing on modern web apps? Check out <a href="https://playwright.dev/">Playwright</a>. The tests are pretty easy to follow because it&#39;s basically a set of instructions written in code. So as you might have guessed, it&#39;s catered more to developers than non-technical folks.</p>

<hr class="sb"/>

<p>I am going through the Pro ASP.NET Core 6 book. After trying to run the command <code>libman install bootstrap@5.1.3 -d wwwroot/lib/bootstrap</code> from page 72 (Chapter 4) of the book, I started getting the error listed below:</p>

<p><code>[LIB002]: The &#34;bootstrap@5.1.3&#34; library could not be resolved by the &#34;cdnjs&#34; provider</code></p>

<p>Turns out it was an issue with the library manager package that was installed. The fix is to install a newer one. More info can be found here:</p>

<p><a href="https://github.com/Apress/pro-asp.net-core-6/blob/main/errata.md">https://github.com/Apress/pro-asp.net-core-6/blob/main/errata.md</a></p>

<hr class="sb"/>

<p>Was looking for a way to add a list of objects to the appsettings.json file, then retrieve that list and turn them into something I can check against in a controller class. <a href="https://stackoverflow.com/a/56226359/5041911">This answer</a> works wonderfully.</p>

<hr class="sb"/>

<p><a href="https://react-hook-form.com/">React Hook Form</a> — seems like a cool alternative form handler for React.</p>

<hr class="sb"/>

<p><a href="https://docs.mongodb.com/manual/reference/sql-comparison/">SQL to MongoDB Mapping Chart</a> — good reference on how to write MongoDB queries based on expected SQL Server queries.</p>

<hr class="sb"/>

<p>Reasons to blog if you&#39;re a software developer:</p>
<ul><li>It helps you write better emails at work.</li>
<li>It helps you write better user stories and acceptance criteria.</li>
<li>It helps you communicate your ideas better.</li></ul>

<p>If you&#39;re noticing a pattern there, it&#39;s all about being a better communicator. And you would want that, because that also helps you <a href="https://devblog.dinobansigan.com/career-advancement-for-software-developers-peter-lyons">advance in your career</a>.</p>

<hr class="sb"/>

<p><strong>Series</strong>: <a href="https://devblog.dinobansigan.com/tag:DevNotes" class="hashtag"><span>#</span><span class="p-category">DevNotes</span></a>
<strong>Tags:</strong> <a href="https://devblog.dinobansigan.com/tag:Axios" class="hashtag"><span>#</span><span class="p-category">Axios</span></a> <a href="https://devblog.dinobansigan.com/tag:ASPNetCore" class="hashtag"><span>#</span><span class="p-category">ASPNetCore</span></a> <a href="https://devblog.dinobansigan.com/tag:Azure" class="hashtag"><span>#</span><span class="p-category">Azure</span></a> <a href="https://devblog.dinobansigan.com/tag:Blogging" class="hashtag"><span>#</span><span class="p-category">Blogging</span></a> <a href="https://devblog.dinobansigan.com/tag:JavaScript" class="hashtag"><span>#</span><span class="p-category">JavaScript</span></a> <a href="https://devblog.dinobansigan.com/tag:MongoDB" class="hashtag"><span>#</span><span class="p-category">MongoDB</span></a> <a href="https://devblog.dinobansigan.com/tag:Playwright" class="hashtag"><span>#</span><span class="p-category">Playwright</span></a> <a href="https://devblog.dinobansigan.com/tag:React" class="hashtag"><span>#</span><span class="p-category">React</span></a> <a href="https://devblog.dinobansigan.com/tag:SqlServer" class="hashtag"><span>#</span><span class="p-category">SqlServer</span></a> <a href="https://devblog.dinobansigan.com/tag:Tests" class="hashtag"><span>#</span><span class="p-category">Tests</span></a></p>

<p><strong><a href="https://remark.as/p/devblog.dinobansigan.com/devnotes-004">Discuss...</a></strong> or leave a comment below.</p>
]]></content:encoded>
      <guid>https://devblog.dinobansigan.com/devnotes-004</guid>
      <pubDate>Thu, 16 Feb 2023 04:13:20 +0000</pubDate>
    </item>
    <item>
      <title>Attach to Process Write.as Theme</title>
      <link>https://devblog.dinobansigan.com/attach-to-process-write-as-theme?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[I thought I&#39;d share the Custom CSS and JavaScript I use on this Write.as blog. The design is inspired by this Hugo Hello Friend theme I saw on micro.blog.!--more--&#xA;&#xA;Here is the Custom CSS I use on this blog:&#xA;/ Written in 2020 by Riley Walz&#xA;&#xA; This theme is licensed under a Creative Commons Attribution 4.0 &#xA; International License.&#xA;&#xA; You should have received a copy of the license along with this&#xA; work. If not, see http://creativecommons.org/licenses/by/4.0/&#xA;/&#xA;&#xA;.post-title {&#xA;    padding-right: 1em;&#xA;}&#xA;&#xA;.book {&#xA;&#x9;display: none;&#xA;}&#xA;&#xA;.read-more {&#xA;&#x9;display: none;&#xA;}&#xA;&#xA;.h-entry {&#xA;&#x9;justify-content: space-between;&#xA;&#x9;display: flex;&#xA;}&#xA;&#xA;body#collection #wrapper article,&#xA;body#subpage #wrapper article {&#xA;&#x9;margin-bottom: 1em;&#xA;}&#xA;&#xA;.dt-published {&#xA;&#x9;flex-shrink: 0;&#xA;}&#xA;&#xA;@media screen and (max-width: 700px) {&#xA;&#x9;.h-entry {&#xA;&#x9;&#x9;display: block&#xA;&#x9;}&#xA;&#x9;body#collection #wrapper time,&#xA;&#x9;body#subpage #wrapper time {&#xA;&#x9;&#x9;font-size: 0.9em;&#xA;&#x9;}&#xA;&#x9;.post-title {&#xA;&#x9;&#x9;font-size: 1.2rem;&#xA;&#x9;}&#xA;&#x9;body#collection #wrapper article,&#xA;&#x9;body#subpage #wrapper article {&#xA;&#x9;&#x9;margin-bottom: 1.5em;&#xA;&#x9;}&#xA;}&#xA;&#xA;emailsub {&#xA;&#x9;text-align: center;&#xA;&#x9;margin-top: 50px;&#xA;}&#xA;&#xA;/ My own theme changes /&#xA;post article {&#xA;    max-width: 60rem;&#xA;}&#xA;&#xA;body#post header, body#subpage header {&#xA;&#x9;margin-bottom: 1em;&#xA;}&#xA;&#xA;body#post header h1 {&#xA;    font-size: 2em;&#xA;}&#xA;&#xA;body#post pre {&#xA;    margin-bottom: -2.5em;&#xA;}&#xA;&#xA;post-body div.e-content div.contact-form {&#xA;    display: contents;&#xA;    margin-top: -3em;&#xA;}&#xA;&#xA;fnContactEmbed {&#xA;    display: none;&#xA;}&#xA;&#xA;fnContactEmbedIframe {&#xA;&#x9;background: #FAFAD2;&#xA;&#x9;border-radius: 6px;&#xA;}&#xA;&#xA;/ Dark Theme attempt /&#xA;body {&#xA;    font-family: Inter,-apple-system,BlinkMacSystemFont,Roboto,Segoe UI,Helvetica,Arial,sans-serif!important;&#xA;    text-rendering: optimizeLegibility;&#xA;    -webkit-text-size-adjust: 100%;&#xA;    &#xA;    background: #292a2d;&#xA;    /background-secondary: #3b3d42;&#xA;    header: #252627;/&#xA;    color: #a9a9b3;&#xA;    /color-secondary: #73747b;/&#xA;    border-color: #4a4b50;&#xA;}&#xA;#post article.norm, .font.norm, body#collection article.norm, body#subpage article.norm, input#title.norm, pre.norm, span.norm, textarea.norm {&#xA;    font-family: Inter,-apple-system,BlinkMacSystemFont,Roboto,Segoe UI,Helvetica,Arial,sans-serif!important;&#xA;}&#xA;post nav a:not(.home), header nav a {&#xA;    color: #a9a9b3;&#xA;}&#xA;&#xA;body h1 a, body header h2 a, header p.description, .post-title a:link, .post-title a:visited, a, a:visited {&#xA;    color: #a9a9b3;&#xA;}&#xA;body h1 a:hover, body header h2 a:hover, div.e-content p a, div.e-content ul li a {&#xA;    color: #a9a9b3;&#xA;    text-decoration: underline;&#xA;}&#xA;body#post article time.dt-published, body#subpage article time.dt-published {&#xA;    color: #73747b;&#xA;}&#xA;&#xA;subscribe-btn {&#xA;    border: 1px #045FB4;&#xA;    background: #045FB4;&#xA;}&#xA;subscribe-btn:hover {&#xA;    text-shadow: 0px 0px 6px white;&#xA;}&#xA;&#xA;.e-content a.hashtag:link {&#xA;    background-color: #292a2d;&#xA;    border-radius: 7px;&#xA;    border-style: solid;&#xA;    border-color: #a9a9b3;&#xA;    border-width: 1px;&#xA;    padding-left: 10px;&#xA;    padding-right: 10px;&#xA;    padding-top: 2px;&#xA;    padding-bottom: 2px;&#xA;    text-decoration: none;&#xA;&#x9;font-style: normal;&#xA;    line-height: 2em;&#xA;    color: #a9a9b3;&#xA;}&#xA;.e-content a.hashtag:visited {&#xA;    color: #a9a9b3;&#xA;&#x9;text-decoration: none;&#xA;}&#xA;.e-content a.hashtag:hover span + span {&#xA;    text-decoration: none;&#xA;}&#xA;.e-content a.hashtag:hover {&#xA;    background-color: #a9a9b3;&#xA;    border-color: #a9a9b3;&#xA;    color: #292a2d;&#xA;    text-decoration: none;&#xA;}&#xA;&#xA;body footer {&#xA;    text-align: center;&#xA;    padding: 0 2em;&#xA;}&#xA;&#xA;body footer nav {&#xA;    color: #73747b;&#xA;    padding-bottom: 48px;&#xA;    margin-bottom: 0px;&#xA;}&#xA;&#xA;body footer nav a {&#xA;    font-weight: bold;&#xA;    color: #73747b!important;&#xA;    text-decoration: none!important;&#xA;    margin: 0!important;&#xA;}&#xA;body footer nav a:hover {&#xA;    color: #a9a9b3!important;&#xA;    text-decoration: underline!important;&#xA;    margin: 0!important;&#xA;}&#xA;&#xA;body #post code, body#collection code, body#post code, body#subpage code {&#xA;&#x9;font-family: Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;&#xA;&#x9;background: #282c34;&#xA;&#x9;border-color: #3b3d42;&#xA;&#x9;padding: 3px 6px 3px 6px;&#xA;&#x9;margin: 0 2px;&#xA;&#x9;border-radius: 5px;&#xA;&#x9;font-size: .9rem;&#xA;&#x9;font-weight: 400;&#xA;}&#xA;body #post pre, body#collection pre, body#post pre, body#subpage pre {&#xA;    background: #282c34;&#xA;    border: 1px solid #3b3d42;&#xA;}&#xA;&#xA;hyvor-talk-view {&#xA;    margin-top: 1em;&#xA;    margin-bottom: -4em;&#xA;}&#xA;&#xA;/ Hide post views /&#xA;header nav .views {&#xA;    display: none;&#xA;}&#xA;&#xA;/ Hide Stats link /&#xA;nav#manage ul a[href=&#34;/me/c/attach-to-process/stats&#34;],&#xA;nav#manage ul a[href=&#34;/me/c/attach-to-process/subscribers&#34;]{&#xA;  display: none;&#xA;}&#xA;&#xA;/ Highlight.js Atom One Dark Reasonable Theme /&#xA;.hljs {&#xA;&#x9;display: block!important;&#xA;&#x9;overflow-x: auto!important;&#xA;&#x9;padding: .5em!important;&#xA;&#x9;color: #abb2bf!important;&#xA;&#x9;background: #282c34!important;&#xA;}&#xA;&#xA;.hljs-keyword,&#xA;.hljs-operator {&#xA;&#x9;color: #f92672!important;&#xA;}&#xA;&#xA;.hljs-pattern-match {&#xA;&#x9;color: #f92672!important;&#xA;}&#xA;&#xA;.hljs-pattern-match .hljs-constructor {&#xA;&#x9;color: #61aeee!important;&#xA;}&#xA;&#xA;.hljs-function {&#xA;&#x9;color: #61aeee!important;&#xA;}&#xA;&#xA;.hljs-function .hljs-params {&#xA;&#x9;color: #a6e22e!important;&#xA;}&#xA;&#xA;.hljs-function .hljs-params .hljs-typing {&#xA;&#x9;color: #fd971f!important;&#xA;}&#xA;&#xA;.hljs-module-access .hljs-module {&#xA;&#x9;color: #7e57c2!important;&#xA;}&#xA;&#xA;.hljs-constructor {&#xA;&#x9;color: #e2b93d!important;&#xA;}&#xA;&#xA;.hljs-constructor .hljs-string {&#xA;&#x9;color: #9ccc65!important;&#xA;}&#xA;&#xA;.hljs-comment,&#xA;.hljs-quote {&#xA;&#x9;color: #b18eb1!important;&#xA;&#x9;font-style: italic!important;&#xA;}&#xA;&#xA;.hljs-doctag,&#xA;.hljs-formula {&#xA;&#x9;color: #c678dd!important;&#xA;}&#xA;&#xA;.hljs-deletion,&#xA;.hljs-name,&#xA;.hljs-section,&#xA;.hljs-selector-tag,&#xA;.hljs-subst {&#xA;&#x9;color: #e06c75!important;&#xA;}&#xA;&#xA;.hljs-literal {&#xA;&#x9;color: #56b6c2!important;&#xA;}&#xA;&#xA;.hljs-addition,&#xA;.hljs-attribute,&#xA;.hljs-meta-string,&#xA;.hljs-regexp,&#xA;.hljs-string {&#xA;&#x9;color: #98c379!important;&#xA;}&#xA;&#xA;.hljs-builtin,&#xA;.hljs-class .hljs-title {&#xA;&#x9;color: #e6c07b!important;&#xA;}&#xA;&#xA;.hljs-attr,&#xA;.hljs-number,&#xA;.hljs-selector-attr,&#xA;.hljs-selector-class,&#xA;.hljs-selector-pseudo,&#xA;.hljs-template-variable,&#xA;.hljs-type,&#xA;.hljs-variable {&#xA;&#x9;color: #d19a66!important;&#xA;}&#xA;&#xA;.hljs-bullet,&#xA;.hljs-link,&#xA;.hljs-meta,&#xA;.hljs-selector-id,&#xA;.hljs-symbol,&#xA;.hljs-title {&#xA;&#x9;color: #61aeee!important;&#xA;}&#xA;&#xA;.hljs-emphasis {&#xA;&#x9;font-style: italic!important;&#xA;}&#xA;&#xA;.hljs-strong {&#xA;&#x9;font-weight: 700!important;&#xA;}&#xA;&#xA;.hljs-link {&#xA;&#x9;text-decoration: underline!important;&#xA;}&#xA;&#xA;/ Attempt at blink cursor /&#xA;.logocursor {&#xA;    display: inline-block;&#xA;    width: 15px;&#xA;    height: 1.5rem;&#xA;    background: #045FB4;&#xA;    margin-left: 5px;&#xA;    border-radius: 1px;&#xA;    -webkit-animation: cursor 1s infinite;&#xA;    animation: cursor 1s infinite;&#xA;}&#xA;@-webkit-keyframes cursor {&#xA; 0% {&#xA;  opacity:0;&#xA; }&#xA; 50% {&#xA;  opacity:1;&#xA; }&#xA; to {&#xA;  opacity:0;&#xA; }&#xA;}&#xA;@keyframes cursor {&#xA; 0% {&#xA;  opacity:0&#xA; }&#xA; 50% {&#xA;  opacity:1&#xA; }&#xA; to {&#xA;  opacity:0&#xA; }&#xA;}&#xA;Note that I include the attribution to Riley Walz at the top, since I used his theme to get the home page to show up with titles and dates only.&#xA;&#xA;And here is the Custom JavaScript I use on this blog:&#xA;/ Reading Time JS Widget /&#xA;const wpm = 200; // Average reading rate in words per minute (WPM)&#xA;&#xA;let ps = document.querySelectorAll(&#39;p&#39;);&#xA;let wordCount = 0;&#xA;for (var i=0; i&lt;ps.length; i++) {&#xA;&#x9;wordCount += ps[i].innerText.split(/\s+/).length;&#xA;}&#xA;let $time = document.querySelector(&#39;#post-body .dt-published&#39;);&#xA;if ($time) {&#xA;    const minuteToRead = Math.round(wordCount / wpm)   0 ? Math.round(wordCount / wpm) : 1;&#xA;&#x9;$time.style.display = &#39;inline-block&#39;;&#xA;&#x9;$time.insertAdjacentHTML(&#34;afterend&#34;, &#39;span style=&#34;color: #73747b&#34; &amp;middot; &#39; + minuteToRead + &#39; min read/span&#39;);&#xA;}&#xA;&#xA;/ Add blinking cursor to blog title /&#xA;const blogTitle = document.getElementById(&#34;blog-title&#34;);&#xA;const blogTitleChildNodes = blogTitle.childNodes;&#xA;blogTitleChildNodes[0].innerHTML += &#39;span class=&#34;logocursor&#34;/span&#39;;&#xA;&#xA;/ Custom Footer/&#xA;const customFooterHTML = Copyright © 2018 - ${new Date().getFullYear()} by a class=&#34;home pubd&#34; href=&#34;https://dinobansigan.com/&#34; target=&#34;blank&#34;Dino Bansigan/abr /The opinions expressed herein are my own and do not represent those of my employerbr /or any other third-party views in any way.br /This work is licensed under a class=&#34;home pubd&#34; href=&#34;https://creativecommons.org/licenses/by-nc-sa/4.0?ref=chooser-v1&#34; target=&#34;_blank&#34; rel=&#34;license noopener noreferrer&#34; style=&#34;display:inline-block;&#34;CC BY-NC-SA 4.0img style=&#34;height:22px!important;margin-left:3px;vertical-align:text-bottom;&#34; src=&#34;https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1&#34;img style=&#34;height:22px!important;margin-left:3px;vertical-align:text-bottom;&#34; src=&#34;https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1&#34;img style=&#34;height:22px!important;margin-left:3px;vertical-align:text-bottom;&#34; src=&#34;https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1&#34;img style=&#34;height:22px!important;margin-left:3px;vertical-align:text-bottom;&#34; src=&#34;https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1&#34;/abr /powered by a class=&#34;home pubd&#34; href=&#34;https://write.as/&#34;write.as/a;&#xA;let x = document.querySelector(&#39;footer&#39;).getElementsByTagName(&#39;nav&#39;)[0];&#xA;x.innerHTML = customFooterHTML;&#xA;Note that I removed the scripts for getting Hyvor Talk comments added to this blog since most people don&#39;t have it. &#xA;&#xA;I also left the custom Footer script intact. So, if you&#39;re going to use it, make sure to modify the values to match your site.&#xA;&#xA;Tags: #CSS #JavaScript #Themes&#xA;&#xA;!--emailsub--&#xA;&#xA;a href=&#34;https://remark.as/p/devblog.dinobansigan.com/attach-to-process-write-as-theme&#34;Discuss.../a or leave a comment below.]]&gt;</description>
      <content:encoded><![CDATA[<p>I thought I&#39;d share the Custom CSS and JavaScript I use on this <a href="https://write.as/">Write.as</a> blog. The design is inspired by this <a href="https://hugo-hello-friend.vercel.app/">Hugo Hello Friend</a> theme I saw on <a href="https://micro.blog/">micro.blog</a>.</p>

<p>Here is the Custom CSS I use on this blog:</p>

<pre><code class="language-css">/* Written in 2020 by Riley Walz

 This theme is licensed under a Creative Commons Attribution 4.0 
 International License.

 You should have received a copy of the license along with this
 work. If not, see http://creativecommons.org/licenses/by/4.0/
*/

.post-title {
    padding-right: 1em;
}

.book {
	display: none;
}

.read-more {
	display: none;
}

.h-entry {
	justify-content: space-between;
	display: flex;
}

body#collection #wrapper article,
body#subpage #wrapper article {
	margin-bottom: 1em;
}

.dt-published {
	flex-shrink: 0;
}

@media screen and (max-width: 700px) {
	.h-entry {
		display: block
	}
	body#collection #wrapper time,
	body#subpage #wrapper time {
		font-size: 0.9em;
	}
	.post-title {
		font-size: 1.2rem;
	}
	body#collection #wrapper article,
	body#subpage #wrapper article {
		margin-bottom: 1.5em;
	}
}

#emailsub {
	text-align: center;
	margin-top: 50px;
}

/*** My own theme changes ***/
#post article {
    max-width: 60rem;
}

body#post header, body#subpage header {
	margin-bottom: 1em;
}

body#post header h1 {
    font-size: 2em;
}

body#post pre {
    margin-bottom: -2.5em;
}

#post-body div.e-content div.contact-form {
    display: contents;
    margin-top: -3em;
}

#fnContactEmbed {
    display: none;
}

#fnContactEmbedIframe {
	background: #FAFAD2;
	border-radius: 6px;
}

/* Dark Theme attempt */
body {
    font-family: Inter,-apple-system,BlinkMacSystemFont,Roboto,Segoe UI,Helvetica,Arial,sans-serif!important;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    
    background: #292a2d;
    /*background-secondary: #3b3d42;
    header: #252627;*/
    color: #a9a9b3;
    /*color-secondary: #73747b;*/
    border-color: #4a4b50;
}
#post article.norm, .font.norm, body#collection article.norm, body#subpage article.norm, input#title.norm, pre.norm, span.norm, textarea.norm {
    font-family: Inter,-apple-system,BlinkMacSystemFont,Roboto,Segoe UI,Helvetica,Arial,sans-serif!important;
}
#post nav a:not(.home), header nav a {
    color: #a9a9b3;
}

body h1 a, body header h2 a, header p.description, .post-title a:link, .post-title a:visited, a, a:visited {
    color: #a9a9b3;
}
body h1 a:hover, body header h2 a:hover, div.e-content p a, div.e-content ul li a {
    color: #a9a9b3;
    text-decoration: underline;
}
body#post article time.dt-published, body#subpage article time.dt-published {
    color: #73747b;
}

#subscribe-btn {
    border: 1px #045FB4;
    background: #045FB4;
}
#subscribe-btn:hover {
    text-shadow: 0px 0px 6px white;
}

.e-content a.hashtag:link {
    background-color: #292a2d;
    border-radius: 7px;
    border-style: solid;
    border-color: #a9a9b3;
    border-width: 1px;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 2px;
    padding-bottom: 2px;
    text-decoration: none;
	font-style: normal;
    line-height: 2em;
    color: #a9a9b3;
}
.e-content a.hashtag:visited {
    color: #a9a9b3;
	text-decoration: none;
}
.e-content a.hashtag:hover span + span {
    text-decoration: none;
}
.e-content a.hashtag:hover {
    background-color: #a9a9b3;
    border-color: #a9a9b3;
    color: #292a2d;
    text-decoration: none;
}

body footer {
    text-align: center;
    padding: 0 2em;
}

body footer nav {
    color: #73747b;
    padding-bottom: 48px;
    margin-bottom: 0px;
}

body footer nav a {
    font-weight: bold;
    color: #73747b!important;
    text-decoration: none!important;
    margin: 0!important;
}
body footer nav a:hover {
    color: #a9a9b3!important;
    text-decoration: underline!important;
    margin: 0!important;
}

body #post code, body#collection code, body#post code, body#subpage code {
	font-family: Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;
	background: #282c34;
	border-color: #3b3d42;
	padding: 3px 6px 3px 6px;
	margin: 0 2px;
	border-radius: 5px;
	font-size: .9rem;
	font-weight: 400;
}
body #post pre, body#collection pre, body#post pre, body#subpage pre {
    background: #282c34;
    border: 1px solid #3b3d42;
}

#hyvor-talk-view {
    margin-top: 1em;
    margin-bottom: -4em;
}

/* Hide post views */
header nav .views {
    display: none;
}

/* Hide Stats link */
nav#manage ul a[href=&#34;/me/c/attach-to-process/stats&#34;],
nav#manage ul a[href=&#34;/me/c/attach-to-process/subscribers&#34;]{
  display: none;
}

/* Highlight.js Atom One Dark Reasonable Theme */
.hljs {
	display: block!important;
	overflow-x: auto!important;
	padding: .5em!important;
	color: #abb2bf!important;
	background: #282c34!important;
}

.hljs-keyword,
.hljs-operator {
	color: #f92672!important;
}

.hljs-pattern-match {
	color: #f92672!important;
}

.hljs-pattern-match .hljs-constructor {
	color: #61aeee!important;
}

.hljs-function {
	color: #61aeee!important;
}

.hljs-function .hljs-params {
	color: #a6e22e!important;
}

.hljs-function .hljs-params .hljs-typing {
	color: #fd971f!important;
}

.hljs-module-access .hljs-module {
	color: #7e57c2!important;
}

.hljs-constructor {
	color: #e2b93d!important;
}

.hljs-constructor .hljs-string {
	color: #9ccc65!important;
}

.hljs-comment,
.hljs-quote {
	color: #b18eb1!important;
	font-style: italic!important;
}

.hljs-doctag,
.hljs-formula {
	color: #c678dd!important;
}

.hljs-deletion,
.hljs-name,
.hljs-section,
.hljs-selector-tag,
.hljs-subst {
	color: #e06c75!important;
}

.hljs-literal {
	color: #56b6c2!important;
}

.hljs-addition,
.hljs-attribute,
.hljs-meta-string,
.hljs-regexp,
.hljs-string {
	color: #98c379!important;
}

.hljs-built_in,
.hljs-class .hljs-title {
	color: #e6c07b!important;
}

.hljs-attr,
.hljs-number,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-pseudo,
.hljs-template-variable,
.hljs-type,
.hljs-variable {
	color: #d19a66!important;
}

.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-selector-id,
.hljs-symbol,
.hljs-title {
	color: #61aeee!important;
}

.hljs-emphasis {
	font-style: italic!important;
}

.hljs-strong {
	font-weight: 700!important;
}

.hljs-link {
	text-decoration: underline!important;
}

/* Attempt at blink cursor */
.logo__cursor {
    display: inline-block;
    width: 15px;
    height: 1.5rem;
    background: #045FB4;
    margin-left: 5px;
    border-radius: 1px;
    -webkit-animation: cursor 1s infinite;
    animation: cursor 1s infinite;
}
@-webkit-keyframes cursor {
 0% {
  opacity:0;
 }
 50% {
  opacity:1;
 }
 to {
  opacity:0;
 }
}
@keyframes cursor {
 0% {
  opacity:0
 }
 50% {
  opacity:1
 }
 to {
  opacity:0
 }
}
</code></pre>

<p><em>Note that I include the attribution to Riley Walz at the top, since I used his theme to get the home page to show up with titles and dates only.</em></p>

<p>And here is the Custom JavaScript I use on this blog:</p>

<pre><code class="language-js">/* Reading Time JS Widget */
const wpm = 200; // Average reading rate in words per minute (WPM)

let ps = document.querySelectorAll(&#39;p&#39;);
let wordCount = 0;
for (var i=0; i&lt;ps.length; i++) {
	wordCount += ps[i].innerText.split(/\s+/).length;
}
let $time = document.querySelector(&#39;#post-body .dt-published&#39;);
if ($time) {
    const minuteToRead = Math.round(wordCount / wpm) &gt; 0 ? Math.round(wordCount / wpm) : 1;
	$time.style.display = &#39;inline-block&#39;;
	$time.insertAdjacentHTML(&#34;afterend&#34;, &#39;&lt;span style=&#34;color: #73747b&#34;&gt; &amp;middot; &#39; + minuteToRead + &#39; min read&lt;/span&gt;&#39;);
}

/* Add blinking cursor to blog title */
const blogTitle = document.getElementById(&#34;blog-title&#34;);
const blogTitleChildNodes = blogTitle.childNodes;
blogTitleChildNodes[0].innerHTML += &#39;&lt;span class=&#34;logo__cursor&#34;&gt;&lt;/span&gt;&#39;;

/* Custom Footer*/
const customFooterHTML = `Copyright © 2018 - ${new Date().getFullYear()} by &lt;a class=&#34;home pubd&#34; href=&#34;https://dinobansigan.com/&#34; target=&#34;_blank&#34;&gt;Dino Bansigan&lt;/a&gt;&lt;br /&gt;The opinions expressed herein are my own and do not represent those of my employer&lt;br /&gt;or any other third-party views in any way.&lt;br /&gt;This work is licensed under &lt;a class=&#34;home pubd&#34; href=&#34;https://creativecommons.org/licenses/by-nc-sa/4.0?ref=chooser-v1&#34; target=&#34;_blank&#34; rel=&#34;license noopener noreferrer&#34; style=&#34;display:inline-block;&#34;&gt;CC BY-NC-SA 4.0&lt;img style=&#34;height:22px!important;margin-left:3px;vertical-align:text-bottom;&#34; src=&#34;https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1&#34;&gt;&lt;img style=&#34;height:22px!important;margin-left:3px;vertical-align:text-bottom;&#34; src=&#34;https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1&#34;&gt;&lt;img style=&#34;height:22px!important;margin-left:3px;vertical-align:text-bottom;&#34; src=&#34;https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1&#34;&gt;&lt;img style=&#34;height:22px!important;margin-left:3px;vertical-align:text-bottom;&#34; src=&#34;https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1&#34;&gt;&lt;/a&gt;&lt;br /&gt;powered by &lt;a class=&#34;home pubd&#34; href=&#34;https://write.as/&#34;&gt;write.as&lt;/a&gt;`;
let x = document.querySelector(&#39;footer&#39;).getElementsByTagName(&#39;nav&#39;)[0];
x.innerHTML = customFooterHTML;
</code></pre>

<p>Note that I removed the scripts for getting Hyvor Talk comments added to this blog since most people don&#39;t have it.</p>

<p>I also left the custom Footer script intact. So, if you&#39;re going to use it, make sure to modify the values to match your site.</p>

<p><em>Tags: <a href="https://devblog.dinobansigan.com/tag:CSS" class="hashtag"><span>#</span><span class="p-category">CSS</span></a> <a href="https://devblog.dinobansigan.com/tag:JavaScript" class="hashtag"><span>#</span><span class="p-category">JavaScript</span></a> <a href="https://devblog.dinobansigan.com/tag:Themes" class="hashtag"><span>#</span><span class="p-category">Themes</span></a></em></p>



<p><strong><a href="https://remark.as/p/devblog.dinobansigan.com/attach-to-process-write-as-theme">Discuss...</a></strong> or leave a comment below.</p>
]]></content:encoded>
      <guid>https://devblog.dinobansigan.com/attach-to-process-write-as-theme</guid>
      <pubDate>Mon, 21 Feb 2022 17:59:41 +0000</pubDate>
    </item>
    <item>
      <title>Useful Array Functions in JavaScript and C&amp;#35;</title>
      <link>https://devblog.dinobansigan.com/useful-array-functions-in-javascript-and-csharp?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[How to check if array contains a specific item&#xA;&#xA;To check if an object or item is contained in a JavaScript array, you can use the includes function, like so:&#xA;const customerIds = [1, 2, 3, 4, 5];&#xA;console.log(&#39;IsIncludedInArray&#39;, customerIds.includes(3));&#xA;&#xA;To do the same thing in C#, you can use the Contains or Any LINQ method, like so:&#xA;var customerIds = new int[5] { 1, 2, 3, 4, 5};&#xA;Console.WriteLine(&#34;IsIncludedInArray &#34; + customerIds.Contains(3));&#xA;Console.WriteLine(&#34;IsIncludedInArray &#34; + customerIds.Any(n =  n == 3));&#xA;&#xA;---&#xA;&#xA;How to filter out contents in an array&#xA;&#xA;To filter out the contents of an array in JavaScript, you can use the filter function., like so:&#xA;const customerIds = [1, 2, 3, 4, 5];&#xA;const filteredCustomerIds = customerIds.filter(n =  n &lt;= 3);&#xA;console.log(&#39;Filtered CustomerIds&#39;, filteredCustomerIds);&#xA;&#xA;To do the same thing in C#, you can use the Where LINQ method.&#xA;var customerIds = new int[5] { 1, 2, 3, 4, 5};&#xA;var filteredCustomerIds = customerIds.Where(n =  n &lt;= 3);&#xA;&#xA;foreach (var n in filteredCustomerIds)&#xA;{&#xA;  Console.WriteLine(n);&#xA;}&#xA;&#xA;Tags: #JavaScript #CSharp #DotNet&#xA;&#xA;a href=&#34;https://remark.as/p/devblog.dinobansigan.com/useful-array-functions-in-javascript-and-csharp&#34;Discuss.../a or leave a comment below.]]&gt;</description>
      <content:encoded><![CDATA[<h3 id="how-to-check-if-array-contains-a-specific-item" id="how-to-check-if-array-contains-a-specific-item">How to check if array contains a specific item</h3>

<p>To check if an object or item is contained in a JavaScript array, you can use the <code>includes</code> function, like so:</p>

<pre><code class="language-js">const customerIds = [1, 2, 3, 4, 5];
console.log(&#39;IsIncludedInArray&#39;, customerIds.includes(3));
</code></pre>

<p>To do the same thing in C#, you can use the <code>Contains</code> or <code>Any</code> LINQ method, like so:</p>

<pre><code class="language-cs">var customerIds = new int[5] { 1, 2, 3, 4, 5};
Console.WriteLine(&#34;IsIncludedInArray &#34; + customerIds.Contains(3));
Console.WriteLine(&#34;IsIncludedInArray &#34; + customerIds.Any(n =&gt; n == 3));
</code></pre>

<hr/>

<h3 id="how-to-filter-out-contents-in-an-array" id="how-to-filter-out-contents-in-an-array">How to filter out contents in an array</h3>

<p>To filter out the contents of an array in JavaScript, you can use the <code>filter</code> function., like so:</p>

<pre><code class="language-js">const customerIds = [1, 2, 3, 4, 5];
const filteredCustomerIds = customerIds.filter(n =&gt; n &lt;= 3);
console.log(&#39;Filtered CustomerIds&#39;, filteredCustomerIds);
</code></pre>

<p>To do the same thing in C#, you can use the <code>Where</code> LINQ method.</p>

<pre><code class="language-cs">var customerIds = new int[5] { 1, 2, 3, 4, 5};
var filteredCustomerIds = customerIds.Where(n =&gt; n &lt;= 3);

foreach (var n in filteredCustomerIds)
{
  Console.WriteLine(n);
}
</code></pre>

<p>Tags: <a href="https://devblog.dinobansigan.com/tag:JavaScript" class="hashtag"><span>#</span><span class="p-category">JavaScript</span></a> <a href="https://devblog.dinobansigan.com/tag:CSharp" class="hashtag"><span>#</span><span class="p-category">CSharp</span></a> <a href="https://devblog.dinobansigan.com/tag:DotNet" class="hashtag"><span>#</span><span class="p-category">DotNet</span></a></p>

<p><strong><a href="https://remark.as/p/devblog.dinobansigan.com/useful-array-functions-in-javascript-and-csharp">Discuss...</a></strong> or leave a comment below.</p>
]]></content:encoded>
      <guid>https://devblog.dinobansigan.com/useful-array-functions-in-javascript-and-csharp</guid>
      <pubDate>Sat, 05 Feb 2022 13:46:15 +0000</pubDate>
    </item>
    <item>
      <title>Get Random Post using JavaScript</title>
      <link>https://devblog.dinobansigan.com/get-random-post-using-javascript?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[On my Above the Earth and Seas photo-blog, I was able to add a link to get a random post using just plain JavaScript. &#xA;&#xA;The reason this works is because I decided to use numbers for all the post slugs/urls. That allows me to use simple Math functions in JavaScript to come up with a random number. Then I use that random number to construct a url to link to. It&#39;s pretty basic but it works.&#xA;&#xA;Here is the Custom JavaScript that I added:&#xA;// This number matches the url of my latest post&#xA;const latestIndex = 36;&#xA;&#xA;/ Get random post /&#xA;const a = document.querySelector(&#39;a[href$=&#34;/random&#34;]&#39;);&#xA;if (a !== null) {&#xA;    const randomIndex = Math.floor((Math.random() * latestIndex) + 1);&#xA;    const pad = &#39;000&#39;;&#xA;    const randomPostIndex = (pad + parseInt(randomIndex)).slice(-pad.length);&#xA;    const randomPostUrl = &#39;https://ateas.dinobansigan.com/&#39; + randomPostIndex;&#xA;    a.setAttribute(&#39;href&#39;, randomPostUrl);&#xA;    a.setAttribute(&#39;title&#39;, &#39;Get a random post&#39;);&#xA;}&#xA;&#xA;Tags: #JavaScript&#xA;&#xA;a href=&#34;https://remark.as/p/devblog.dinobansigan.com/get-random-post-using-javascript&#34;Discuss.../a or leave a comment below.]]&gt;</description>
      <content:encoded><![CDATA[<p>On my <a href="https://ateas.dinobansigan.com/">Above the Earth and Seas</a> photo-blog, I was able to add a link to get a random post using just plain JavaScript.</p>

<p>The reason this works is because I decided to use numbers for all the post slugs/urls. That allows me to use simple Math functions in JavaScript to come up with a random number. Then I use that random number to construct a url to link to. It&#39;s pretty basic but it works.</p>

<p>Here is the Custom JavaScript that I added:</p>

<pre><code class="language-js">// This number matches the url of my latest post
const latestIndex = 36;

/* Get random post */
const a = document.querySelector(&#39;a[href$=&#34;/random&#34;]&#39;);
if (a !== null) {
    const randomIndex = Math.floor((Math.random() * latestIndex) + 1);
    const pad = &#39;000&#39;;
    const randomPostIndex = (pad + parseInt(randomIndex)).slice(-pad.length);
    const randomPostUrl = &#39;https://ateas.dinobansigan.com/&#39; + randomPostIndex;
    a.setAttribute(&#39;href&#39;, randomPostUrl);
    a.setAttribute(&#39;title&#39;, &#39;Get a random post&#39;);
}
</code></pre>

<p>Tags: <a href="https://devblog.dinobansigan.com/tag:JavaScript" class="hashtag"><span>#</span><span class="p-category">JavaScript</span></a></p>

<p><strong><a href="https://remark.as/p/devblog.dinobansigan.com/get-random-post-using-javascript">Discuss...</a></strong> or leave a comment below.</p>
]]></content:encoded>
      <guid>https://devblog.dinobansigan.com/get-random-post-using-javascript</guid>
      <pubDate>Fri, 30 Jul 2021 23:12:05 +0000</pubDate>
    </item>
    <item>
      <title>JavaScript Destructuring</title>
      <link>https://devblog.dinobansigan.com/javascript-destructuring?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[As part of learning React, I&#39;m also trying to shore up my JavaScript skills. Thankfully, the React: Getting Started pluralsight course also offers a modern JavaScript crash course. These are my notes from when I tried to understand JavaScript&#39;s Destructuring feature.&#xA;&#xA;Note that you can run the sample code on a JavaScript tester website, like say the JSComplete Playground.&#xA;&#xA;So, the JavaScript destructuring assignment syntax allows you to get just the properties you want from an object. It seems to be like a shortcut for getting to the properties of an object. For example:&#xA;&#xA;const customerInfo = {&#xA;&#x9;firstName: &#34;Dino&#34;,&#xA;&#x9;lastName: &#34;Bansigan&#34;,&#xA;&#x9;emailAddress: &#34;myemail@email.com&#34;,&#xA;&#x9;website: &#34;dinobansigan.com&#34;&#xA;}&#xA;&#xA;const getFullName = ({firstName, lastName}) =  {&#xA;&#x9;return firstName + &#34; &#34; + lastName;&#xA;}&#xA;&#xA;console.log(getFullName(customerInfo));&#xA;&#xA;In the code above, you can see how I have created a customerInfo object. Then next is a function called getFullName that takes a firstName and lastName parameter. These parameters are destructured from the customerInfo object. &#xA;&#xA;If you look at the last bit of code where I call console.log, you can see that instead of passing in parameters customerInfo.firstName and customerInfo.lastName, all I had to do, was pass in the customerInfo object. JavaScript through the destructuring feature is smart enough to know to use the firstName and lastName properties from the customerInfo object.&#xA;&#xA;!--more--&#xA;hr class=&#34;sb&#34;/&#xA;This destructuring feature can come in handy with arrays too. Together with the rest and spread operators, you can pick specific values from an array, split arrays and spread items to build a new array. For example:&#xA;&#xA;const fellowShipOftheRing = [&#34;Frodo&#34;, &#34;Gandalf&#34;, &#34;Sam&#34;, &#34;Aragorn&#34;, &#34;Legolas&#34;, &#34;Pippin&#34;, &#34;Merry&#34;, &#34;Boromir&#34;];&#xA;&#xA;let [ringBearer, ...restOfFellowShip] = fellowShipOftheRing;&#xA;&#xA;console.log(&#34;Ringbearer: &#34; + ringBearer);&#xA;console.log(&#34;Rest of the Fellowship: &#34; + restOfFellowShip);&#xA;&#xA;const copyOfTheRestOfFellowship = [...restOfFellowShip];&#xA;restOfFellowShip = null;&#xA;console.log(&#34;Rest of the Fellowship: &#34; + restOfFellowShip);&#xA;console.log(&#34;Copy of the Rest of the Fellowship: &#34; + copyOfTheRestOfFellowship);&#xA;&#xA;If you look at the code above, you can see an array called the fellowShipOftheRing. It has all nine members of the Fellowship. Then on the next line, you can see how you could easily pick out the first value from the fellowShipOftheRing array and assign it to the ringBearer variable. Then the rest of contents of the array are assigned to the restOfFellowShip variable. That&#39;s pretty cool!&#xA;&#xA;Then the next set of code shows how to make a copy of the restOfFellowShip array using the spread operator. The easiest way I can visualize it, is you basically spread the contents of the  restOfFellowShip array inside the brackets to create a new array for the copyOfTheRestOfFellowship variable. And to prove that it is a real copy of the array and not just another pointer to the original array, I set the restOfFellowShip array to a value of null before calling console.log.&#xA;&#xA;That&#39;s as far as my notes went. If you found any mistakes in this post, please educate me by leaving a comment below or getting in touch with me. Thanks!&#xA;&#xA;Tags: #JavaScript&#xA;&#xA;a href=&#34;https://remark.as/p/devblog.dinobansigan.com/javascript-destructuring&#34;Discuss.../a or leave a comment below.]]&gt;</description>
      <content:encoded><![CDATA[<p><em>As part of learning React, I&#39;m also trying to shore up my JavaScript skills. Thankfully, the <a href="https://www.pluralsight.com/courses/react-js-getting-started">React: Getting Started</a> pluralsight course also offers a modern JavaScript crash course. These are my notes from when I tried to understand JavaScript&#39;s <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment">Destructuring</a> feature.</em></p>

<p><em>Note that you can run the sample code on a JavaScript tester website, like say the <a href="https://jscomplete.com/playground">JSComplete Playground</a>.</em></p>

<p>So, the JavaScript destructuring assignment syntax allows you to get just the properties you want from an object. It seems to be like a shortcut for getting to the properties of an object. For example:</p>

<pre><code class="language-js">const customerInfo = {
	firstName: &#34;Dino&#34;,
	lastName: &#34;Bansigan&#34;,
	emailAddress: &#34;myemail@email.com&#34;,
	website: &#34;dinobansigan.com&#34;
}

const getFullName = ({firstName, lastName}) =&gt; {
	return firstName + &#34; &#34; + lastName;
}

console.log(getFullName(customerInfo));
</code></pre>

<p>In the code above, you can see how I have created a <code>customerInfo</code> object. Then next is a function called <code>getFullName</code> that takes a <code>firstName</code> and <code>lastName</code> parameter. These parameters are <em>destructured</em> from the <code>customerInfo</code> object.</p>

<p>If you look at the last bit of code where I call <code>console.log</code>, you can see that instead of passing in parameters <code>customerInfo.firstName</code> and <code>customerInfo.lastName</code>, all I had to do, was pass in the <code>customerInfo</code> object. JavaScript through the destructuring feature is smart enough to know to use the <code>firstName</code> and <code>lastName</code> properties from the <code>customerInfo</code> object.</p>



<hr class="sb"/>

<p>This destructuring feature can come in handy with arrays too. Together with the rest and spread operators, you can pick specific values from an array, split arrays and <em>spread</em> items to build a new array. For example:</p>

<pre><code class="language-js">const fellowShipOftheRing = [&#34;Frodo&#34;, &#34;Gandalf&#34;, &#34;Sam&#34;, &#34;Aragorn&#34;, &#34;Legolas&#34;, &#34;Pippin&#34;, &#34;Merry&#34;, &#34;Boromir&#34;];

let [ringBearer, ...restOfFellowShip] = fellowShipOftheRing;

console.log(&#34;Ringbearer: &#34; + ringBearer);
console.log(&#34;Rest of the Fellowship: &#34; + restOfFellowShip);

const copyOfTheRestOfFellowship = [...restOfFellowShip];
restOfFellowShip = null;
console.log(&#34;Rest of the Fellowship: &#34; + restOfFellowShip);
console.log(&#34;Copy of the Rest of the Fellowship: &#34; + copyOfTheRestOfFellowship);
</code></pre>

<p>If you look at the code above, you can see an array called the <code>fellowShipOftheRing</code>. It has all nine members of the Fellowship. Then on the next line, you can see how you could easily pick out the first value from the <code>fellowShipOftheRing</code> array and assign it to the <code>ringBearer</code> variable. Then the rest of contents of the array are assigned to the <code>restOfFellowShip</code> variable. That&#39;s pretty cool!</p>

<p>Then the next set of code shows how to make a <em>copy</em> of the <code>restOfFellowShip</code> array using the spread operator. The easiest way I can visualize it, is you basically <em>spread</em> the contents of the  <code>restOfFellowShip</code> array inside the brackets to create a new array for the <code>copyOfTheRestOfFellowship</code> variable. And to prove that it is a real <em>copy</em> of the array and not just another pointer to the original array, I set the <code>restOfFellowShip</code> array to a value of null before calling <code>console.log</code>.</p>

<p><em>That&#39;s as far as my notes went. If you found any mistakes in this post, please educate me by leaving a comment below or <a href="https://journal.dinobansigan.com/comments">getting in touch with me</a>. Thanks!</em></p>

<p><em>Tags: <a href="https://devblog.dinobansigan.com/tag:JavaScript" class="hashtag"><span>#</span><span class="p-category">JavaScript</span></a></em></p>

<p><strong><a href="https://remark.as/p/devblog.dinobansigan.com/javascript-destructuring">Discuss...</a></strong> or leave a comment below.</p>
]]></content:encoded>
      <guid>https://devblog.dinobansigan.com/javascript-destructuring</guid>
      <pubDate>Mon, 15 Feb 2021 04:27:20 +0000</pubDate>
    </item>
    <item>
      <title>Hide Publish Date Using JavaScript</title>
      <link>https://devblog.dinobansigan.com/hide-publish-date-using-javascript?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[I am using the Lanyon theme on my micro.blog hosted photo-blog. I noticed that the Published Date was showing up on my about page. Here is how I managed to hide it using some JavaScript.&#xA;&#xA;script type=&#34;text/javascript&#34;&#xA;var isAboutPage = /\/about\/$/i.test(window.location.href);&#xA;if (isAboutPage) {&#xA;  var x = document.getElementsByClassName(&#34;post-date&#34;);&#xA;  if (x) {&#xA;    x[0].remove();&#xA;  }&#xA;}&#xA;/script&#xA;&#xA;I added the script to the layouts/partials/default_foot.html file, just before the closing /body tag.&#xA;&#xA;This is a result of me playing around with Custom JavaScript on my write.as sites. I was able to carry over what I learned here and use it to fix something on another website. One of the best benefits of maintaining a personal website, is brushing up on your HTML, CSS and JavaScript skills.&#xA;&#xA;Tags: #JavaScript #MicroBlog&#xA;&#xA;a href=&#34;https://remark.as/p/devblog.dinobansigan.com/hide-publish-date-using-javascript&#34;Discuss.../a or leave a comment below.]]&gt;</description>
      <content:encoded><![CDATA[<p>I am using the <a href="https://github.com/microdotblog/theme-lanyon">Lanyon theme</a> on my micro.blog hosted <a href="https://dino.micro.blog/">photo-blog</a>. I noticed that the <em>Published Date</em> was showing up on my <a href="https://dino.micro.blog/about/">about page</a>. Here is how I managed to hide it using some JavaScript.</p>

<pre><code class="language-js">&lt;script type=&#34;text/javascript&#34;&gt;
var isAboutPage = /\/about\/$/i.test(window.location.href);
if (isAboutPage) {
  var x = document.getElementsByClassName(&#34;post-date&#34;);
  if (x) {
    x[0].remove();
  }
}
&lt;/script&gt;
</code></pre>

<p>I added the script to the <code>layouts/partials/default_foot.html</code> file, just before the closing <code>&lt;/body&gt;</code> tag.</p>

<p><em>This is a result of me playing around with Custom JavaScript on my <a href="https://write.as/">write.as</a> sites. I was able to carry over what I learned here and use it to fix something on another website. One of the best benefits of maintaining a personal website, is brushing up on your HTML, CSS and JavaScript skills.</em></p>

<p><em>Tags: <a href="https://devblog.dinobansigan.com/tag:JavaScript" class="hashtag"><span>#</span><span class="p-category">JavaScript</span></a> <a href="https://devblog.dinobansigan.com/tag:MicroBlog" class="hashtag"><span>#</span><span class="p-category">MicroBlog</span></a></em></p>

<p><strong><a href="https://remark.as/p/devblog.dinobansigan.com/hide-publish-date-using-javascript">Discuss...</a></strong> or leave a comment below.</p>
]]></content:encoded>
      <guid>https://devblog.dinobansigan.com/hide-publish-date-using-javascript</guid>
      <pubDate>Sat, 06 Feb 2021 00:33:57 +0000</pubDate>
    </item>
    <item>
      <title>On Learning React</title>
      <link>https://devblog.dinobansigan.com/on-learning-react?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[My first attempt at learning the React JavaScript library was by reading the ASP.NET Core 3 and React book. I started reading that book a few months ago. I&#39;ve gone through the first six chapters, which mostly covers how to build a web app front-end using React. While I did learn a lot reading those chapters, I was barely keeping up. &#xA;&#xA;There&#39;s so many new concepts, new libraries, new methods, new syntax to learn. It felt overwhelming at times. It didn&#39;t help that I kept getting distracted at the JSX syntax -- which looked insane to me at times. &#xA;&#xA;I found myself simply typing what was in the book. But I actually couldn&#39;t tell you why the code worked. I was honestly struggling to keep up. But more importantly, I was confused and frustrated at it all. Why would you even want to go through all this trouble of writing a React app? I didn&#39;t get it. And consequently, I wasn&#39;t too excited to learn more. But I had to.&#xA;&#xA;!--more--&#xA;So, after having gone through the first six chapters of the book, today I decided to take a stab at this React: Getting Started pluralsight course. And my God, what a change! &#xA;&#xA;I&#39;m actually now excited to learn more about what I can do with React. I&#39;ve only gone through the first two chapters, which are basically an introduction to React. But man what a blessing! It explained really well so much of the key concepts that I&#39;ve struggled to grasp. A lot of the confusion I had while reading the book, is now slowly starting to make sense.&#xA;&#xA;It&#39;s almost like this course is required reading, before actually reading the book.&#xA;&#xA;I now better understand props. I now better understand state management between components. I now better understand components, which is crucial if I ever want to master React. Even the JSX syntax is now starting to make sense.&#xA;&#xA;I get it now. I get why you would want to build a web app using React. I get why you would want to learn React. And now I&#39;m excited to learn more. I feel like if you want to start learning React, you should give this pluralsight course a try first. &#xA;&#xA;This is not to say that the book, ASP.NET Core 3 and React, is a bad book. It&#39;s not. It&#39;s actually very detailed and covers a lot of topics that will definitely be useful at work. It&#39;s just that I think it&#39;s too advanced for a React beginner like me. I need to get a better handle on the basics and key concepts of React, before I can fully appreciate the book.&#xA;&#xA;P.S. Apologies if this post is not as polished as other posts. I&#39;m trying to follow Joel&#39;s advice on caring less and writing more.&#xA;&#xA;Tags: #JavaScript #ReactJS&#xA;&#xA;a href=&#34;https://remark.as/p/devblog.dinobansigan.com/on-learning-react&#34;Discuss.../a or leave a comment below.]]&gt;</description>
      <content:encoded><![CDATA[<p>My first attempt at learning the <a href="https://reactjs.org/">React</a> JavaScript library was by reading the <a href="https://www.oreilly.com/library/view/aspnet-core-3/9781789950229/">ASP.NET Core 3 and React</a> book. I started reading that book a few months ago. I&#39;ve gone through the first six chapters, which mostly covers how to build a web app front-end using React. While I did learn a lot reading those chapters, I was barely keeping up.</p>

<p>There&#39;s so many new concepts, new libraries, new methods, new syntax to learn. It felt overwhelming at times. It didn&#39;t help that I kept getting distracted at the JSX syntax — <em>which looked insane to me at times</em>.</p>

<p>I found myself simply typing what was in the book. But I actually couldn&#39;t tell you why the code worked. I was honestly struggling to keep up. But more importantly, I was confused and frustrated at it all. Why would you even want to go through all this trouble of writing a React app? I didn&#39;t get it. And consequently, I wasn&#39;t too excited to learn more. But I had to.</p>



<p>So, after having gone through the first six chapters of the book, today I decided to take a stab at this <a href="https://www.pluralsight.com/courses/react-js-getting-started">React: Getting Started</a> pluralsight course. And my God, what a change!</p>

<p>I&#39;m actually now excited to learn more about what I can do with React. I&#39;ve only gone through the first two chapters, which are basically an introduction to React. But man what a blessing! It explained really well so much of the key concepts that I&#39;ve struggled to grasp. A lot of the confusion I had while reading the book, is now slowly starting to make sense.</p>

<p><em>It&#39;s almost like this course is required reading, before actually reading the book.</em></p>

<p>I now better understand props. I now better understand state management between components. I now better understand components, which is crucial if I ever want to master React. Even the JSX syntax is now starting to make sense.</p>

<p>I get it now. I get why you would want to build a web app using React. I get why you would want to learn React. And now I&#39;m excited to learn more. I feel like if you want to start learning React, you should give this pluralsight course a try first.</p>

<p>This is not to say that the book, ASP.NET Core 3 and React, is a bad book. It&#39;s not. It&#39;s actually very detailed and covers a lot of topics that will definitely be useful at work. It&#39;s just that I think it&#39;s too advanced for a React beginner like me. I need to get a better handle on the basics and key concepts of React, before I can fully appreciate the book.</p>

<p><em>P.S. Apologies if this post is not as polished as other posts. I&#39;m trying to follow Joel&#39;s advice <a href="https://joelhooks.com/on-writing-more">on caring less and writing more</a>.</em></p>

<p><em>Tags: <a href="https://devblog.dinobansigan.com/tag:JavaScript" class="hashtag"><span>#</span><span class="p-category">JavaScript</span></a> <a href="https://devblog.dinobansigan.com/tag:ReactJS" class="hashtag"><span>#</span><span class="p-category">ReactJS</span></a></em></p>

<p><strong><a href="https://remark.as/p/devblog.dinobansigan.com/on-learning-react">Discuss...</a></strong> or leave a comment below.</p>
]]></content:encoded>
      <guid>https://devblog.dinobansigan.com/on-learning-react</guid>
      <pubDate>Fri, 05 Feb 2021 06:38:15 +0000</pubDate>
    </item>
    <item>
      <title>How to Customize the Footer on a Write.as Website</title>
      <link>https://devblog.dinobansigan.com/how-to-customize-the-footer-on-a-write-as-website?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[There are two ways that I know of to customize the footer on a Write.as website. The first one is through CSS and the second one is through JavaScript. I&#39;ll go through those two options in this post.&#xA;&#xA;Option 1: CSS&#xA;&#xA;I got this idea of customizing the footer via CSS after looking at Robert Xu&#39;s Write.as powered site. It puzzled me that I could not highlight the text in the footer. After viewing the page source, I finally figured out that it was CSS trickery. &#xA;&#xA;So, anyway here we are. To customize the footer using CSS, all you need to do is modify the following CSS script, then add it to the Custom CSS settings for your website.&#xA;footer nav::before {&#xA;    content: &#34;Copyright © 2020 - 2021 by Your Name \A&#34;;&#xA;    white-space: pre-wrap;&#xA;}&#xA;!--more--&#xA;Note the \A at the end of the content value. That basically functions like a line break (br /) in HTML. Without that, the content value will show up to the left of the &#34;published with write.as&#34; footer text. With \A in place, the content value will show up above the &#34;published with write.as&#34; footer text.&#xA;&#xA;That also means that through the use of \A, you can add however many lines of text you want into your footer.&#xA;&#xA;So, the main thing I like about using CSS for a customized footer, is that even if JavaScript is disabled on the browser, it will still work. If all you really want is to display some text on the footer, this is the best option in my opinion.&#xA;&#xA;Now the thing that I don&#39;t like about it, is that it doesn&#39;t allow you to add hyperlinks in your footer. If you want to do that, then you have to use JavaScript.&#xA;&#xA;hr class=&#34;sb&#34;/&#xA;&#xA;Option 2: JavaScript&#xA;&#xA;As I mentioned above, one of the reasons to go with JavaScript for a customized footer, is that it allows you to add hyperlinks as part of the footer content. This means that you can add links to other websites, or to a license, etc...&#xA;&#xA;To customize the footer using JavaScript, modify the contents of the customFooterHTML variable below, then copy and add the JavaScript code to the Custom Javascript settings for your website.&#xA;/ Custom Footer/&#xA;var customFooterHTML = &#39;Copyright © 2019 - 2021 by a class=&#34;home pubd&#34; href=&#34;WebsiteUrl&#34; target=&#34;_blank&#34;Your Name/abr /The opinions expressed herein are my own and do not represent those of my employerbr /or any other third-party views in any way.br /published with a class=&#34;home pubd&#34; href=&#34;https://write.as/&#34;write.as/a&#39;;&#xA;&#xA;var x = document.querySelector(&#39;footer&#39;).getElementsByTagName(&#39;nav&#39;)[0];&#xA;x.innerHTML = customFooterHTML;&#xA;span class=&#34;imageCaption&#34;For an example of this customized footer in action, scroll to the bottom of this page./span&#xA;&#xA;Note that I added class=&#34;home pubd&#34; to my links (anchor elements). home and pubd are Write.as classes that have their own specific styling. I added them so that I won&#39;t run into padding issues in the footer. This also means that you can put in other class names that you can style via your own Custom CSS settings.&#xA;&#xA;Also note that instead of using \A to force a line break, I use the regular HTML br / line break. This is one of the benefits of going with the JavaScript approach. You are pretty much working with HTML at this point. This also means that you can put any valid HTML elements in there.&#xA;&#xA;Lastly, note that I also added published with a class=&#34;home pubd&#34; href=&#34;https://write.as/&#34;write.as/a as part of the value for customFooterHTML. That&#39;s because with this approach, you are replacing the content of the footer with the content inside the customFooterHTML variable. So, if I don&#39;t add it, that text won&#39;t show up. &#xA;&#xA;Maybe that&#39;s something you don&#39;t want to include in the first place. If that&#39;s the case, then you can simply exclude it from the value of the  customFooterHTML variable.&#xA;&#xA;So, you already know what I like about this approach -- the ability to use HTML and add hyperlinks. What about drawbacks? &#xA;&#xA;Well, since this is done via the Custom Javascript settings for your website, if one of the scripts in there runs into an error, it is possible that your footer won&#39;t be rendered. Also, if someone is viewing your website on a browser with JavaScript disabled, then your footer also won&#39;t show up. It&#39;s not that big of a deal, but something to keep in mind when using this approach.&#xA;&#xA;Tags: #HowTo #WriteAs #CSS #JavaScript&#xA;&#xA;a href=&#34;https://remark.as/p/devblog.dinobansigan.com/how-to-customize-the-footer-on-a-write-as-website&#34;Discuss.../a or leave a comment below.]]&gt;</description>
      <content:encoded><![CDATA[<p>There are two ways that I know of to customize the footer on a <a href="https://write.as/">Write.as</a> website. The first one is through CSS and the second one is through JavaScript. I&#39;ll go through those two options in this post.</p>

<h3 id="option-1-css" id="option-1-css">Option 1: CSS</h3>

<p>I got this idea of customizing the footer via CSS after looking at <a href="https://robxu9.com/">Robert Xu&#39;s</a> Write.as powered site. It puzzled me that I could not highlight the text in the footer. After viewing the page source, I finally figured out that it was CSS trickery.</p>

<p>So, anyway here we are. To customize the footer using CSS, all you need to do is modify the following CSS script, then add it to the Custom CSS settings for your website.</p>

<pre><code class="language-css">footer nav::before {
    content: &#34;Copyright © 2020 - 2021 by Your Name \A&#34;;
    white-space: pre-wrap;
}
</code></pre>



<p>Note the <code>\A</code> at the end of the <code>content</code> value. That basically functions like a line break (<code>&lt;br /&gt;</code>) in HTML. Without that, the content value will show up to the left of the “published with write.as” footer text. With <code>\A</code> in place, the content value will show up above the “published with write.as” footer text.</p>

<p>That also means that through the use of <code>\A</code>, you can add however many lines of text you want into your footer.</p>

<p>So, the main thing I like about using CSS for a customized footer, is that even if JavaScript is disabled on the browser, it will still work. If all you really want is to display some text on the footer, this is the best option in my opinion.</p>

<p>Now the thing that I don&#39;t like about it, is that it doesn&#39;t allow you to add hyperlinks in your footer. If you want to do that, then you have to use JavaScript.</p>

<hr class="sb"/>

<h3 id="option-2-javascript" id="option-2-javascript">Option 2: JavaScript</h3>

<p>As I mentioned above, one of the reasons to go with JavaScript for a customized footer, is that it allows you to add hyperlinks as part of the footer content. This means that you can add links to other websites, or to a license, etc...</p>

<p>To customize the footer using JavaScript, modify the contents of the <code>customFooterHTML</code> variable below, then copy and add the JavaScript code to the Custom Javascript settings for your website.</p>

<pre><code class="language-js">/* Custom Footer*/
var customFooterHTML = &#39;Copyright © 2019 - 2021 by &lt;a class=&#34;home pubd&#34; href=&#34;WebsiteUrl&#34; target=&#34;_blank&#34;&gt;Your Name&lt;/a&gt;&lt;br /&gt;The opinions expressed herein are my own and do not represent those of my employer&lt;br /&gt;or any other third-party views in any way.&lt;br /&gt;published with &lt;a class=&#34;home pubd&#34; href=&#34;https://write.as/&#34;&gt;write.as&lt;/a&gt;&#39;;

var x = document.querySelector(&#39;footer&#39;).getElementsByTagName(&#39;nav&#39;)[0];
x.innerHTML = customFooterHTML;
</code></pre>

<p><span class="imageCaption">For an example of this customized footer in action, scroll to the bottom of this page.</span></p>

<p>Note that I added <code>class=&#34;home pubd&#34;</code> to my links (anchor elements). <code>home</code> and <code>pubd</code> are Write.as classes that have their own specific styling. I added them so that I won&#39;t run into padding issues in the footer. This also means that you can put in other class names that you can style via your own Custom CSS settings.</p>

<p>Also note that instead of using <code>\A</code> to force a line break, I use the regular HTML <code>&lt;br /&gt;</code> line break. This is one of the benefits of going with the JavaScript approach. You are pretty much working with HTML at this point. This also means that you can put any valid HTML elements in there.</p>

<p>Lastly, note that I also added <code>published with &lt;a class=&#34;home pubd&#34; href=&#34;https://write.as/&#34;&gt;write.as&lt;/a&gt;</code> as part of the value for <code>customFooterHTML</code>. That&#39;s because with this approach, you are replacing the content of the footer with the content inside the <code>customFooterHTML</code> variable. So, if I don&#39;t add it, that text won&#39;t show up.</p>

<p><em>Maybe that&#39;s something you don&#39;t want to include in the first place. If that&#39;s the case, then you can simply exclude it from the value of the  <code>customFooterHTML</code> variable.</em></p>

<p>So, you already know what I like about this approach — the ability to use HTML and add hyperlinks. What about drawbacks?</p>

<p>Well, since this is done via the Custom Javascript settings for your website, if one of the scripts in there runs into an error, it is possible that your footer won&#39;t be rendered. Also, if someone is viewing your website on a browser with JavaScript disabled, then your footer also won&#39;t show up. It&#39;s not that big of a deal, but something to keep in mind when using this approach.</p>

<p><em>Tags: <a href="https://devblog.dinobansigan.com/tag:HowTo" class="hashtag"><span>#</span><span class="p-category">HowTo</span></a> <a href="https://devblog.dinobansigan.com/tag:WriteAs" class="hashtag"><span>#</span><span class="p-category">WriteAs</span></a> <a href="https://devblog.dinobansigan.com/tag:CSS" class="hashtag"><span>#</span><span class="p-category">CSS</span></a> <a href="https://devblog.dinobansigan.com/tag:JavaScript" class="hashtag"><span>#</span><span class="p-category">JavaScript</span></a></em></p>

<p><strong><a href="https://remark.as/p/devblog.dinobansigan.com/how-to-customize-the-footer-on-a-write-as-website">Discuss...</a></strong> or leave a comment below.</p>
]]></content:encoded>
      <guid>https://devblog.dinobansigan.com/how-to-customize-the-footer-on-a-write-as-website</guid>
      <pubDate>Sat, 16 Jan 2021 00:00:00 +0000</pubDate>
    </item>
    <item>
      <title>A Possible Limitation with WebAssembly Apps?</title>
      <link>https://devblog.dinobansigan.com/a-possible-limitation-with-webassembly-apps?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[A WriteFreely user recently got in touch with me, asking if I could modify the Write.as Archive Page Generator app, to make it work with WriteFreely instances. I spent some time with it last week and I ran into a snag. I&#39;m getting this TypeError: Failed to fetch JavaScript error whenever it tries to fetch data from the WriteFreely instance I&#39;m testing. &#xA;&#xA;When I try getting posts from a Write.as blog using a Blazor WASM app, it works. When I try getting posts from a WriteFreely instance blog, using the Blazor WASM app, it won&#39;t work. But when I try getting posts from a WriteFreely instance blog, using a .NET Core console app that uses the WriteAs.NET library I wrote, the same library that the Blazor WASM app uses, it works. Something weird is going on.&#xA;&#xA;My research into the issue indicates a possible limitation with WebAssembly apps. There must be some security setting on the WriteFreely instance I&#39;m testing, that&#39;s blocking my Blazor WASM requests. The Write.as API is obviously not blocking my requests, so something is going on with that WriteFreely instance. &#xA;&#xA;I dug into it some more and found that it is a CORS related issue. But at this point, there&#39;s nothing else I could on my end to fix it. I created a thread on discuss.write.as to talk about it.&#xA;&#xA;Tags: #Blazor #JavaScript #WebAssembly&#xA;&#xA;a href=&#34;https://remark.as/p/devblog.dinobansigan.com/a-possible-limitation-with-webassembly-apps&#34;Discuss.../a or leave a comment below.]]&gt;</description>
      <content:encoded><![CDATA[<p>A WriteFreely user recently got in touch with me, asking if I could modify the <a href="https://apps.dinobansigan.com/WriteAsArchivePageGenerator">Write.as Archive Page Generator</a> app, to make it work with WriteFreely instances. I spent some time with it last week and I ran into a snag. I&#39;m getting this <code>TypeError: Failed to fetch</code> JavaScript error whenever it tries to fetch data from the WriteFreely instance I&#39;m testing.</p>

<p>When I try getting posts from a Write.as blog using a Blazor WASM app, it works. When I try getting posts from a WriteFreely instance blog, using the Blazor WASM app, it won&#39;t work. But when I try getting posts from a WriteFreely instance blog, using a .NET Core console app that uses the <a href="https://github.com/DinoBansigan/WriteAs.NET">WriteAs.NET library</a> I wrote, the same library that the Blazor WASM app uses, it works. Something weird is going on.</p>

<p>My research into the issue indicates a possible limitation with WebAssembly apps. There must be some security setting on the WriteFreely instance I&#39;m testing, that&#39;s blocking my Blazor WASM requests. The Write.as API is obviously not blocking my requests, so something is going on with that WriteFreely instance.</p>

<p>I dug into it some more and found that it is a CORS related issue. But at this point, there&#39;s nothing else I could on my end to fix it. I created a <a href="https://discuss.write.as/t/writefreely-archive-page-generator/2267">thread on discuss.write.as</a> to talk about it.</p>

<p><em>Tags: <a href="https://devblog.dinobansigan.com/tag:Blazor" class="hashtag"><span>#</span><span class="p-category">Blazor</span></a> <a href="https://devblog.dinobansigan.com/tag:JavaScript" class="hashtag"><span>#</span><span class="p-category">JavaScript</span></a> <a href="https://devblog.dinobansigan.com/tag:WebAssembly" class="hashtag"><span>#</span><span class="p-category">WebAssembly</span></a></em></p>

<p><strong><a href="https://remark.as/p/devblog.dinobansigan.com/a-possible-limitation-with-webassembly-apps">Discuss...</a></strong> or leave a comment below.</p>
]]></content:encoded>
      <guid>https://devblog.dinobansigan.com/a-possible-limitation-with-webassembly-apps</guid>
      <pubDate>Tue, 22 Dec 2020 02:00:00 +0000</pubDate>
    </item>
    <item>
      <title>Domain Redirect via HTML and JavaScript</title>
      <link>https://devblog.dinobansigan.com/domain-redirect-via-html-and-javascript?pk_campaign=rss-feed</link>
      <description>&lt;![CDATA[I purchased a new domain, nowlisteningto.com for my Now Listening to... music blog. Prior to buying the new domain name, I didn&#39;t realize how big of a pain it was going to be to set up redirection. Turns out, you can&#39;t setup a 301 redirect using just DNS records. It has to be done on a web server level, or via your domain registrar. My issue is that I can&#39;t use my domain registrar for redirects, because I use Netlify to manage the DNS records for my domains. And from what I can see, Netlify doesn&#39;t have a menu option for redirecting from one domain to another.&#xA;&#xA;So, I ended up doing a redirect via HTML and JavaScript, by hosting a static site on Netlify. This static site&#39;s purpose is to simply redirect from nowlisteningto.dinobansigan.com to nowlisteningto.com. It is not ideal, but this will do for now until I figure out a better solution. Thanks to this answer on StackOverflow for the idea.&#xA;&#xA;Tags: #CustomDomain #DomainRedirect #HTML #JavaScript&#xA;&#xA;a href=&#34;https://remark.as/p/devblog.dinobansigan.com/domain-redirect-via-html-and-javascript&#34;Discuss.../a or leave a comment below.]]&gt;</description>
      <content:encoded><![CDATA[<p>I purchased a new domain, <strong>nowlisteningto.com</strong> for my <a href="https://nowlisteningto.com/">Now Listening to... music blog</a>. Prior to buying the new domain name, I didn&#39;t realize how big of a pain it was going to be to set up redirection. Turns out, you can&#39;t setup a 301 redirect using just DNS records. It has to be done on a web server level, or via your domain registrar. My issue is that I can&#39;t use my domain registrar for redirects, because I use Netlify to manage the DNS records for my domains. And from what I can see, Netlify doesn&#39;t have a menu option for redirecting from one domain to another.</p>

<p>So, I ended up doing a redirect via HTML and JavaScript, by hosting a static site on Netlify. This static site&#39;s purpose is to simply redirect from <em>nowlisteningto.dinobansigan.com</em> to <em>nowlisteningto.com</em>. It is not ideal, but this will do for now until I figure out a better solution. Thanks to this <a href="https://stackoverflow.com/a/5411601/5041911">answer on StackOverflow</a> for the idea.</p>

<p><em>Tags: <a href="https://devblog.dinobansigan.com/tag:CustomDomain" class="hashtag"><span>#</span><span class="p-category">CustomDomain</span></a> <a href="https://devblog.dinobansigan.com/tag:DomainRedirect" class="hashtag"><span>#</span><span class="p-category">DomainRedirect</span></a> <a href="https://devblog.dinobansigan.com/tag:HTML" class="hashtag"><span>#</span><span class="p-category">HTML</span></a> <a href="https://devblog.dinobansigan.com/tag:JavaScript" class="hashtag"><span>#</span><span class="p-category">JavaScript</span></a></em></p>

<p><strong><a href="https://remark.as/p/devblog.dinobansigan.com/domain-redirect-via-html-and-javascript">Discuss...</a></strong> or leave a comment below.</p>
]]></content:encoded>
      <guid>https://devblog.dinobansigan.com/domain-redirect-via-html-and-javascript</guid>
      <pubDate>Tue, 15 Dec 2020 02:00:00 +0000</pubDate>
    </item>
  </channel>
</rss>