<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
    <channel>
        <title>cyby.dev</title>
        <description>A blog about accessibility, the web, or anything else on cyby's mind.</description>
        <link>https://www.cyby.dev</link>
        <image>
            <url>https://www.cyby.dev/favicon-96x96.png</url>
            <title>cyby.dev</title>
            <link>https://www.cyby.dev</link>
        </image>
        <atom:link href="https://www.cyby.dev/feed" rel="self" type="application/rss+xml"/>
        <lastBuildDate>Sun, 08 Feb 2026 22:39:09 +0000</lastBuildDate>
        <language>en</language>
        <generator>Feedamic: the Atom and RSS Feed generator for Statamic</generator>
        <item>
            <title><![CDATA[Download Libro.fm files]]></title>
            <link>https://www.cyby.dev/blog/download-librofm-files</link>
            <guid isPermaLink="true">https://www.cyby.dev/blog/download-librofm-files</guid>
            <pubDate>Sat, 07 Feb 2026 06:00:00 +0000</pubDate>
            <description><![CDATA[I want to listen to the audiobooks that I've purchased from Libro.fm in my pocdast player because I like the UI. I can never remember how to do this and some I'm writing this, so that I can remember the next time I want to download a book. Download...]]></description>
            <content:encoded><![CDATA[<p>I want to listen to the audiobooks that I've purchased from <a href="https://libro.fm/">Libro.fm</a> in my pocdast player because I like the UI. I can never remember how to do this and some I'm writing this, so that I can remember the next time I want to download a book.</p>
<h2>Download files from Libro.fm</h2>
<ul>
<li>Login to my <a href="https://libro.fm/user">Libro.fm account</a></li>
<li>Under the Library title, there's a list of my books. Find the book that I'm interested in</li>
<li>Click the <code>Download files</code> link</li>
<li>This will open a disclosure widget, click <code>Audio m4b</code></li>
<li>Move the downloaded file to my <code>iCloud Drive/Downloads</code> folder</li>
<li>Wait for it to upload</li>
</ul>
<h2>Upload to Pocket Casts</h2>
<p>Now that I have the downloaded file, here's how I add it to Pocket Casts.</p>
<ul>
<li>Open the Pocket Casts app on my iPhone</li>
<li>Click on the <code>Profile</code> tab</li>
<li>Click on <code>Files</code></li>
<li>Click <code>Add file</code></li>
<li>Navigate to <code>iCloud Drive/Download</code></li>
<li>Click the <code>m4b</code> file</li>
<li>I don't need to make any adjustments and the book cover is automatically imported, so click <code>Save</code></li>
</ul>
<p>That's it! The file is now availble in <code>Profile/Files</code>. Once I press on play, the file shows up in my <code>Up Next</code> playlist.</p>
<h2>Once I finish the book</h2>
<p>Once I've read the book, I can delete the file from <code>Profile/Files</code>.</p>]]></content:encoded>
            <author>cyby5@protonmail.com (cyby)</author>
        </item>
        <item>
            <title><![CDATA[Make node list into an array]]></title>
            <link>https://www.cyby.dev/blog/make-node-list-into-an-array</link>
            <guid isPermaLink="true">https://www.cyby.dev/blog/make-node-list-into-an-array</guid>
            <pubDate>Sat, 07 Dec 2019 00:00:00 +0000</pubDate>
            <description><![CDATA[Most of the time when I'm coding with node lists, I want to iterate through each of them and preform some action. My first thought is, &quot;Node lists are like arrays, I should be able to use the array methods like .map() or .filter() right?&quot;...]]></description>
            <content:encoded><![CDATA[<p>Most of the time when I'm coding with <a href="https://developer.mozilla.org/en-US/docs/Web/API/NodeList">node lists</a>, I want to iterate through each of them and preform some action. My first thought is, &quot;Node lists are <em>like</em> arrays, I should be able to use the array methods like <code>.map()</code> or <code>.filter()</code> right?&quot; 🤔</p>
<p>But every time it backfires because Node lists are actually objects.</p>
<pre><code class="language-javascript">const nodeArray = document.querySelectorAll('p');

nodeArray.map(node =&gt; console.log(node);
// ❗️TypeError: nodeArray.map is not a function
</code></pre>
<p>To quickly fix this, I could either use the <code>.forEach()</code> method instead of <code>.map()</code>.</p>
<pre><code class="language-javascript">const nodeArray = document.querySelectorAll('p');

nodeArray.forEach(node =&gt; console.log(node);
// ✅ That works!
</code></pre>
<p>Or I could quickly turn the node list into an array using the <code>spread operator</code>.</p>
<pre><code class="language-javascript">const nodeArray = document.querySelectorAll('p');
const realArray = [...nodeArray];

realArray.map(node =&gt; console.log(node);
// ✅ That works!
</code></pre>]]></content:encoded>
            <author>cyby5@protonmail.com (cyby)</author>
        </item>
        <item>
            <title><![CDATA[Nested Destructuring]]></title>
            <link>https://www.cyby.dev/blog/nested-destructuring</link>
            <guid isPermaLink="true">https://www.cyby.dev/blog/nested-destructuring</guid>
            <pubDate>Sat, 22 Jun 2019 00:00:00 +0000</pubDate>
            <description><![CDATA[I always forget the syntax for nested object destructuring. So I wrote this article so that I don't forget again. Object Destructuring The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays,...]]></description>
            <content:encoded><![CDATA[<p>I always forget the syntax for nested object destructuring. So I wrote this article so that I don't forget again.</p>
<h2>Object Destructuring</h2>
<blockquote>
<p>The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables. - <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment">MDN Destructuring assignment</a></p>
</blockquote>
<p>Destructing is one of my favorite ES6 syntax improvements. But when I need to pull things out of nested objects, I can never remember the syntax. So I'm writing this so I can focus on how to remember the syntax and so that I can refer to this article if I forget. 😆</p>
<p>But first, lets looks at destructuring from one object.</p>
<pre><code class="language-jsx">const MyAwesomeButton = (props) =&gt; (
    &lt;button type=&quot;button&quot; className=&quot;button&quot;&gt;
        {props.label}
    &lt;/button&gt;
);
</code></pre>
<p>Here we have <code>MyAwesomeButton</code> that takes a <code>label</code> prop and puts it inside of a <code>&lt;button&gt;</code>. We can use object destructing to only show the parts that we need to use, such as <code>label</code>.</p>
<pre><code class="language-diff">+ const MyAwesomeButton = ({ label }) =&gt; (
- const MyAwesomeButton = props =&gt; (
  &lt;button type=&quot;button&quot; className=&quot;button&quot;&gt;
+   {label}
-   {props.label}
  &lt;/button&gt;
)
</code></pre>
<p>Now we've eliminated the reference to <code>props</code> and are only pulling out <code>label</code> so that we can use it as a variable name by itself. We need to wrap <code>{ label }</code> in parentheses because without them, JavaScript would interpret it as an <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#Creating_objects">object literal</a>.</p>
<p>Our final result looks like:</p>
<pre><code class="language-jsx">const MyAwesomeButton = ({ label }) =&gt; (
    &lt;button type=&quot;button&quot; className=&quot;&quot;&gt;
        {label}
    &lt;/button&gt;
);
</code></pre>
<h2>Now Lets Try Nesting</h2>
<p>Here is where the syntax gets confusing. If I want to pull from an object within an object, I totally can, but I never remember the right way to do it.</p>
<pre><code class="language-jsx">const MyAwesomeButton = (props) =&gt; (
    &lt;button type=&quot;button&quot; className=&quot;button&quot;&gt;
        {props.constants.icon}
        {props.constants.label}
    &lt;/button&gt;
);
</code></pre>
<p>So now I have an object inside of my props that have two different values, but they're nested inside of an object.</p>
<p>Before we look at how we can pull <code>icon</code> and <code>label</code> out of the prop, lets look at how an object literal is defined:</p>
<pre><code class="language-javascript">const myObject = {
    property: &quot;value&quot;,
    nestedObject: {
        nestedProperty: &quot;nested value&quot;,
    },
};
</code></pre>
<p>Ok we have curly braces, property names, and values. You can take the &quot;shape&quot; and apply it to how our destructuring will look.</p>
<pre><code class="language-javascript">// Pseudo code of how we would pull out `nestedProperty`
{
    nestedObject: {
        nestedProperty;
    }
}
</code></pre>
<p>Now reduce that format to one line.</p>
<pre><code class="language-javascript">{
    nestedObject: {
        nestedProperty;
    }
}
</code></pre>
<p>💡 Ah ha! I usually forget when I need to add another set of curly braces to get to the nested property!</p>
<p>Back to our React button example, I want to pull <code>icon</code> and <code>label</code> out of <code>props.constants</code>.</p>
<pre><code class="language-diff">+ const MyAwesomeButton = { constants: { icon }, constants: { label }  } =&gt; (
- const MyAwesomeButton = props =&gt; (
  &lt;button type=&quot;button&quot; className=&quot;button&quot;&gt;
+   {icon}
-   {props.constants.icon}
+   {label}
-   {props.constants.label}
  &lt;/button&gt;
)
</code></pre>
<p>Our component now doesn't reference <code>props</code> or <code>constants</code> and has a cleaning look.</p>
<pre><code class="language-jsx">const MyAwesomeButton = { constants: { icon }, constants: { label }  } =&gt; (
  &lt;button type=&quot;button&quot; className=&quot;button&quot;&gt;
    {icon}
    {label}
  &lt;/button&gt;
)
</code></pre>
<h2>GatsbyJS Example</h2>
<p>I got this wrong several times while building this website. Pulling from nested objects seems like a normal thing when working with GraphQL, the query language I'm using in Gatsby. I like how clean it looks, but it took a little while to get use to.</p>
<p>Here is one of the craziest examples of nested destructuring that I had to do:</p>
<pre><code class="language-jsx">{
    quotes.map(
        ({
            node: { avatar },
            node: { company },
            node: { id },
            node: { person },
            node: { quote },
            node: { url },
        }) =&gt; (
            &lt;li key={id} className=&quot;mb-8&quot;&gt;
                &lt;Quote
                    avatarAlt={`Avatar of ${person}`}
                    avatarUrl={avatar}
                    company={company}
                    linkUrl={url}
                    name={person}
                    quote={quote}
                /&gt;
            &lt;/li&gt;
        )
    );
}
</code></pre>
<p>For each quote, I'm pulling out each piece of data as its own variable and then using it where I need to. And there's not all these references to <code>node</code>, which I like.</p>
<h2>Conclusion</h2>
<p>The syntax for nested destructuring on the left side mirrors what defining a nested object would look like on the right side.</p>]]></content:encoded>
            <author>cyby5@protonmail.com (cyby)</author>
        </item>
    </channel>
</rss>
