<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <id>https://www.cyby.dev/feed/atom</id>
    <title type="text">cyby.dev</title>
    <subtitle type="text">A blog about accessibility, the web, or anything else on cyby's mind.</subtitle>
    <link xmlns="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="https://www.cyby.dev/feed/atom"/>
    <updated>2026-02-08T22:39:36+00:00</updated>
    <icon>https://www.cyby.dev/favicon-96x96.png</icon>
    <generator uri="https://github.com/mitydigital/feedamic" version="3.0.8">Feedamic: the Atom and RSS Feed generator for Statamic</generator>
    <entry>
        <title type="text">Download Libro.fm files</title>
        <link href="https://www.cyby.dev/blog/download-librofm-files"/>
        <id>https://www.cyby.dev/blog/download-librofm-files</id>
        <published>2026-02-07T06:00:00+00:00</published>
        <updated>2026-02-07T17:06:43+00:00</updated>
        <summary type="text">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...</summary>
        <content type="html">&lt;p&gt;I want to listen to the audiobooks that I've purchased from &lt;a href=&quot;https://libro.fm/&quot;&gt;Libro.fm&lt;/a&gt; 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.&lt;/p&gt;
&lt;h2&gt;Download files from Libro.fm&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Login to my &lt;a href=&quot;https://libro.fm/user&quot;&gt;Libro.fm account&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Under the Library title, there's a list of my books. Find the book that I'm interested in&lt;/li&gt;
&lt;li&gt;Click the &lt;code&gt;Download files&lt;/code&gt; link&lt;/li&gt;
&lt;li&gt;This will open a disclosure widget, click &lt;code&gt;Audio m4b&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Move the downloaded file to my &lt;code&gt;iCloud Drive/Downloads&lt;/code&gt; folder&lt;/li&gt;
&lt;li&gt;Wait for it to upload&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Upload to Pocket Casts&lt;/h2&gt;
&lt;p&gt;Now that I have the downloaded file, here's how I add it to Pocket Casts.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Open the Pocket Casts app on my iPhone&lt;/li&gt;
&lt;li&gt;Click on the &lt;code&gt;Profile&lt;/code&gt; tab&lt;/li&gt;
&lt;li&gt;Click on &lt;code&gt;Files&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Add file&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Navigate to &lt;code&gt;iCloud Drive/Download&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Click the &lt;code&gt;m4b&lt;/code&gt; file&lt;/li&gt;
&lt;li&gt;I don't need to make any adjustments and the book cover is automatically imported, so click &lt;code&gt;Save&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;That's it! The file is now availble in &lt;code&gt;Profile/Files&lt;/code&gt;. Once I press on play, the file shows up in my &lt;code&gt;Up Next&lt;/code&gt; playlist.&lt;/p&gt;
&lt;h2&gt;Once I finish the book&lt;/h2&gt;
&lt;p&gt;Once I've read the book, I can delete the file from &lt;code&gt;Profile/Files&lt;/code&gt;.&lt;/p&gt;</content>
        <author>
            <name>cyby</name>
            <email>cyby5@protonmail.com</email>
        </author>
    </entry>
    <entry>
        <title type="text">Make node list into an array</title>
        <link href="https://www.cyby.dev/blog/make-node-list-into-an-array"/>
        <id>https://www.cyby.dev/blog/make-node-list-into-an-array</id>
        <published>2019-12-07T00:00:00+00:00</published>
        <updated>2026-01-26T22:39:04+00:00</updated>
        <summary type="text">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;...</summary>
        <content type="html">&lt;p&gt;Most of the time when I'm coding with &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/NodeList&quot;&gt;node lists&lt;/a&gt;, I want to iterate through each of them and preform some action. My first thought is, &amp;quot;Node lists are &lt;em&gt;like&lt;/em&gt; arrays, I should be able to use the array methods like &lt;code&gt;.map()&lt;/code&gt; or &lt;code&gt;.filter()&lt;/code&gt; right?&amp;quot; 🤔&lt;/p&gt;
&lt;p&gt;But every time it backfires because Node lists are actually objects.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;const nodeArray = document.querySelectorAll('p');

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

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

realArray.map(node =&amp;gt; console.log(node);
// ✅ That works!
&lt;/code&gt;&lt;/pre&gt;</content>
        <author>
            <name>cyby</name>
            <email>cyby5@protonmail.com</email>
        </author>
    </entry>
    <entry>
        <title type="text">Nested Destructuring</title>
        <link href="https://www.cyby.dev/blog/nested-destructuring"/>
        <id>https://www.cyby.dev/blog/nested-destructuring</id>
        <published>2019-06-22T00:00:00+00:00</published>
        <updated>2026-01-26T22:39:16+00:00</updated>
        <summary type="text">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,...</summary>
        <content type="html">&lt;p&gt;I always forget the syntax for nested object destructuring. So I wrote this article so that I don't forget again.&lt;/p&gt;
&lt;h2&gt;Object Destructuring&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;The destructuring assignment syntax is a JavaScript expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables. - &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment&quot;&gt;MDN Destructuring assignment&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;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. 😆&lt;/p&gt;
&lt;p&gt;But first, lets looks at destructuring from one object.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;const MyAwesomeButton = (props) =&amp;gt; (
    &amp;lt;button type=&amp;quot;button&amp;quot; className=&amp;quot;button&amp;quot;&amp;gt;
        {props.label}
    &amp;lt;/button&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here we have &lt;code&gt;MyAwesomeButton&lt;/code&gt; that takes a &lt;code&gt;label&lt;/code&gt; prop and puts it inside of a &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt;. We can use object destructing to only show the parts that we need to use, such as &lt;code&gt;label&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-diff&quot;&gt;+ const MyAwesomeButton = ({ label }) =&amp;gt; (
- const MyAwesomeButton = props =&amp;gt; (
  &amp;lt;button type=&amp;quot;button&amp;quot; className=&amp;quot;button&amp;quot;&amp;gt;
+   {label}
-   {props.label}
  &amp;lt;/button&amp;gt;
)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we've eliminated the reference to &lt;code&gt;props&lt;/code&gt; and are only pulling out &lt;code&gt;label&lt;/code&gt; so that we can use it as a variable name by itself. We need to wrap &lt;code&gt;{ label }&lt;/code&gt; in parentheses because without them, JavaScript would interpret it as an &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#Creating_objects&quot;&gt;object literal&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Our final result looks like:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;const MyAwesomeButton = ({ label }) =&amp;gt; (
    &amp;lt;button type=&amp;quot;button&amp;quot; className=&amp;quot;&amp;quot;&amp;gt;
        {label}
    &amp;lt;/button&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Now Lets Try Nesting&lt;/h2&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;const MyAwesomeButton = (props) =&amp;gt; (
    &amp;lt;button type=&amp;quot;button&amp;quot; className=&amp;quot;button&amp;quot;&amp;gt;
        {props.constants.icon}
        {props.constants.label}
    &amp;lt;/button&amp;gt;
);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So now I have an object inside of my props that have two different values, but they're nested inside of an object.&lt;/p&gt;
&lt;p&gt;Before we look at how we can pull &lt;code&gt;icon&lt;/code&gt; and &lt;code&gt;label&lt;/code&gt; out of the prop, lets look at how an object literal is defined:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;const myObject = {
    property: &amp;quot;value&amp;quot;,
    nestedObject: {
        nestedProperty: &amp;quot;nested value&amp;quot;,
    },
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ok we have curly braces, property names, and values. You can take the &amp;quot;shape&amp;quot; and apply it to how our destructuring will look.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;// Pseudo code of how we would pull out `nestedProperty`
{
    nestedObject: {
        nestedProperty;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now reduce that format to one line.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-javascript&quot;&gt;{
    nestedObject: {
        nestedProperty;
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;💡 Ah ha! I usually forget when I need to add another set of curly braces to get to the nested property!&lt;/p&gt;
&lt;p&gt;Back to our React button example, I want to pull &lt;code&gt;icon&lt;/code&gt; and &lt;code&gt;label&lt;/code&gt; out of &lt;code&gt;props.constants&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-diff&quot;&gt;+ const MyAwesomeButton = { constants: { icon }, constants: { label }  } =&amp;gt; (
- const MyAwesomeButton = props =&amp;gt; (
  &amp;lt;button type=&amp;quot;button&amp;quot; className=&amp;quot;button&amp;quot;&amp;gt;
+   {icon}
-   {props.constants.icon}
+   {label}
-   {props.constants.label}
  &amp;lt;/button&amp;gt;
)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Our component now doesn't reference &lt;code&gt;props&lt;/code&gt; or &lt;code&gt;constants&lt;/code&gt; and has a cleaning look.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;const MyAwesomeButton = { constants: { icon }, constants: { label }  } =&amp;gt; (
  &amp;lt;button type=&amp;quot;button&amp;quot; className=&amp;quot;button&amp;quot;&amp;gt;
    {icon}
    {label}
  &amp;lt;/button&amp;gt;
)
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;GatsbyJS Example&lt;/h2&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Here is one of the craziest examples of nested destructuring that I had to do:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-jsx&quot;&gt;{
    quotes.map(
        ({
            node: { avatar },
            node: { company },
            node: { id },
            node: { person },
            node: { quote },
            node: { url },
        }) =&amp;gt; (
            &amp;lt;li key={id} className=&amp;quot;mb-8&amp;quot;&amp;gt;
                &amp;lt;Quote
                    avatarAlt={`Avatar of ${person}`}
                    avatarUrl={avatar}
                    company={company}
                    linkUrl={url}
                    name={person}
                    quote={quote}
                /&amp;gt;
            &amp;lt;/li&amp;gt;
        )
    );
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;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 &lt;code&gt;node&lt;/code&gt;, which I like.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The syntax for nested destructuring on the left side mirrors what defining a nested object would look like on the right side.&lt;/p&gt;</content>
        <author>
            <name>cyby</name>
            <email>cyby5@protonmail.com</email>
        </author>
    </entry>
</feed>
