<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ahmed Mohamed</title>
    <description>The latest articles on DEV Community by Ahmed Mohamed (@moezarella).</description>
    <link>https://dev.to/moezarella</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1253034%2F56b22030-9943-48eb-be47-94925e629a77.png</url>
      <title>DEV Community: Ahmed Mohamed</title>
      <link>https://dev.to/moezarella</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/moezarella"/>
    <language>en</language>
    <item>
      <title>11TY Sucks!</title>
      <dc:creator>Ahmed Mohamed</dc:creator>
      <pubDate>Mon, 26 Feb 2024 03:58:21 +0000</pubDate>
      <link>https://dev.to/moezarella/11ty-sucks-28fl</link>
      <guid>https://dev.to/moezarella/11ty-sucks-28fl</guid>
      <description>&lt;p&gt;I recently used 11ty and nunjucks to develop a portfolio website for a friend of mine and let's just say things weren't as smooth as butter.&lt;/p&gt;

&lt;p&gt;Let me start by saying that 11ty isn't inherently bad. In fact, it boasts simplicity and flexibility as its main selling points. However, as I delved deeper into my project, I stumbled upon some roadblocks that left me scratching my head and yearning for a smoother experience.&lt;/p&gt;

&lt;p&gt;One of the first hurdles I encountered was the lack of comprehensive documentation. Sure, there are tutorials and guides available, but when it comes to troubleshooting specific issues or implementing more advanced features, I found myself scouring the web for answers to no avail. This lack of thorough documentation made the learning curve steeper than I anticipated and hindered my progress.&lt;/p&gt;

&lt;p&gt;Another pain point I faced was the limited ecosystem surrounding 11ty. Unlike other popular static site generators like Gatsby or Hugo, 11ty doesn't enjoy a robust ecosystem of plugins and extensions. This meant that I had to rely on custom solutions or resort to cumbersome workarounds to achieve the functionality I needed. It felt like reinventing the wheel at times, which was both time-consuming and frustrating.&lt;/p&gt;

&lt;p&gt;Despite the frustrations I encountered while using 11ty, there was one aspect of the framework that I genuinely enjoyed: its performance. Thanks to its minimalist approach and focus on generating static HTML files, 11ty delivered lightning-fast load times and snappy navigation for my website. This performance boost not only enhanced the user experience but also made me appreciate the efficiency and elegance of 11ty's core architecture. It's a testament to the power of simplicity in web development and served as a reminder that sometimes less is indeed more.&lt;/p&gt;

&lt;p&gt;Overall, my experience with 11ty left me feeling underwhelmed and somewhat disappointed. While I appreciate its simplicity and the freedom it affords developers, its shortcomings in documentation, ecosystem, and convenience ultimately outweighed its benefits for me.&lt;/p&gt;

</description>
      <category>11ty</category>
      <category>programming</category>
      <category>webdev</category>
      <category>learning</category>
    </item>
    <item>
      <title>Alexa, are you invading my privacy?</title>
      <dc:creator>Ahmed Mohamed</dc:creator>
      <pubDate>Mon, 15 Jan 2024 23:46:09 +0000</pubDate>
      <link>https://dev.to/moezarella/alexa-are-you-invading-my-privacy-2ehp</link>
      <guid>https://dev.to/moezarella/alexa-are-you-invading-my-privacy-2ehp</guid>
      <description>&lt;p&gt;We find ourselves in an age where the label "smart" has become ubiquitous – from smartphones and smartwatches to smart homes and smart cars. It's so ingrained in our daily lives that we've almost taken it for granted, moreover, normalized it. As a tech enthusiast, this raises concerns, not just because our smartphones already track us extensively, but now, we've essentially become mobile data sources for numerous companies.&lt;/p&gt;

&lt;p&gt;Consider the fact that there are over 100 million Alexa-enabled devices in our homes. While these devices may initially seem like convenient time-savers, it's essential for us to reassess our perspectives. See Alexa devices are more than just voice-activated assistants. They are &lt;u&gt;listening, learning, and accumulating data&lt;/u&gt; on our preferences, habits, and even conversations within our homes. The sheer volume of data collected can be staggering, leading to questions about the extent of our privacy in this interconnected world.&lt;/p&gt;

&lt;p&gt;For those skeptical of these concerns,do you know that amazon was charged with Violating Children’s Privacy Law by Keeping Kids’ Alexa Voice Recordings Forever and Undermining Parents’ Deletion Requests?&lt;/p&gt;

&lt;p&gt;According to a complaint filed by the Department of Justice on behalf of the FTC, Amazon prevented parents from exercising their deletion rights under the COPPA Rule, kept sensitive voice and geolocation data for years, and used it for its own purposes, while putting data at risk of harm from unnecessary access.&lt;/p&gt;

&lt;p&gt;I personally own an amazon echo dot. I love how efficient it makes some of my daily mundane tasks as simple as saying "Alexa, set an alarm for 7:30 am". However, is this efficiency worth the invasion of my privacy rights?&lt;/p&gt;

</description>
      <category>security</category>
      <category>technology</category>
      <category>ai</category>
    </item>
    <item>
      <title>How to get a Spotify Refresh Token</title>
      <dc:creator>Ahmed Mohamed</dc:creator>
      <pubDate>Sun, 14 Jan 2024 07:41:40 +0000</pubDate>
      <link>https://dev.to/moezarella/how-to-get-a-spotify-refresh-token-1min</link>
      <guid>https://dev.to/moezarella/how-to-get-a-spotify-refresh-token-1min</guid>
      <description>&lt;p&gt;In this blog, I'll show you how to generate the Spotify Refresh Token and then use that to programmatically create an access token when needed.&lt;/p&gt;

&lt;p&gt;I needed the Spotify Refresh Token to display the currently playing track in the footer section.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Approach
&lt;/h1&gt;




&lt;h2&gt;
  
  
  Step 1: Generate your Spotify &lt;code&gt;client_id&lt;/code&gt; and &lt;code&gt;client_secret&lt;/code&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Go to &lt;a href="https://developer.spotify.com/dashboard/"&gt;Spotify developers dashboard&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then select or create your app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Note down your Client ID and Client Secret in a convenient location to use in Step 3.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  Step 2: Create URI for access code
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;In the URL below, replace &lt;code&gt;$CLIENT_ID&lt;/code&gt;, &lt;code&gt;$SCOPE&lt;/code&gt;, and &lt;code&gt;$REDIRECT_URI&lt;/code&gt; with the information you noted in Step 1. &lt;strong&gt;Make sure the &lt;code&gt;$REDIRECT_URI&lt;/code&gt; is &lt;a href="https://meyerweb.com/eric/tools/dencoder/"&gt;URL encoded&lt;/a&gt;.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  https://accounts.spotify.com/authorize?response_type&lt;span class="o"&gt;=&lt;/span&gt;code&amp;amp;client_id&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$CLIENT_ID&lt;/span&gt;&amp;amp;scope&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$SCOPE&lt;/span&gt;&amp;amp;redirect_uri&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$REDIRECT_URI&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This is how mine looked like.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  https://accounts.spotify.com/authorize?response_type&lt;span class="o"&gt;=&lt;/span&gt;code&amp;amp;client_id&lt;span class="o"&gt;=&lt;/span&gt;CLIENT_ID&amp;amp;scope&lt;span class="o"&gt;=&lt;/span&gt;SCOPE&amp;amp;redirect_uri&lt;span class="o"&gt;=&lt;/span&gt;https%3A%2F%2Fahmedrelated.com%2Fcallback
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Step 3: Get access code from the redirect URI
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You will be redirected to your redirect URI which in my case was set to &lt;em&gt;&lt;a href="https://ahmedrelated.com/callback"&gt;https://ahmedrelated.com/callback&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the address bar you will find a huge URL string similar to the one below. In place of &lt;code&gt;$ACCESSCODE&lt;/code&gt; there will be a long string of characters. Note down that string for the next step.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  https://ahmedrelated.com/callback?code&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$ACCESSCODE&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;h2&gt;
  
  
  Step 4: Get the refresh token
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Type the following CURL command in your terminal and replaces all the variables with the information you noted in Step 1 and Step 3 : &lt;code&gt;$CILENT_ID&lt;/code&gt;, &lt;code&gt;$CLIENT_SECRET&lt;/code&gt;, &lt;code&gt;$CODE&lt;/code&gt;, and &lt;code&gt;$REDIRECT_URI&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  curl &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;client_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$CLIENT_ID&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;client_secret&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$CLIENT_SECRET&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;grant_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;authorization_code &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$CODE&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nv"&gt;redirect_uri&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$REDIRECT_URI&lt;/span&gt; https://accounts.spotify.com/api/token
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;The resulting JSON string will look something like this. Note down the &lt;code&gt;refresh_token&lt;/code&gt;. This token will last for a very long time and can be used to generate a fresh &lt;code&gt;access_token&lt;/code&gt; whenever it is needed.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"access_token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"ACCESS_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"token_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Bearer"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"expires_in"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3600&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"refresh_token"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"REFRESH_TOKEN"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"scope"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"playlist-modify-private"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>api</category>
      <category>spotify</category>
      <category>json</category>
    </item>
    <item>
      <title>A blog a day keeps writer's block (and other things), at bay.</title>
      <dc:creator>Ahmed Mohamed</dc:creator>
      <pubDate>Sat, 13 Jan 2024 03:18:33 +0000</pubDate>
      <link>https://dev.to/moezarella/a-blog-a-day-keeps-writers-block-and-other-things-at-bay-idd</link>
      <guid>https://dev.to/moezarella/a-blog-a-day-keeps-writers-block-and-other-things-at-bay-idd</guid>
      <description>&lt;p&gt;I went down a rabbit hole recently sparked by my reading of James Clear’s &lt;em&gt;Atomic Habits&lt;/em&gt;, a book delving into the concept of small wins and how the seemingly insignificant actions we repeatedly undertake can shape our identity.&lt;/p&gt;

&lt;p&gt;The notion that "you are your habits, and your habits define you" struck a chord. This simple idea expanded in my mind, leading me to explore 'good habits' online. I stumbled upon a remarkable list of actions, some of which I had never considered doing daily, let alone in a million years. One such suggestion stood out: "Write every day."&lt;/p&gt;

&lt;p&gt;Writing every day? It sounded complex. What should I write? Where and how should I do it? should I use AI? While I jot down my gratitudes sporadically and engage in daily coding, does that even count as writing?&lt;/p&gt;

&lt;p&gt;Despite the initial reservations, I've decided to embrace this challenge. I shall commit to writing every day with no restrictions on the topic and no predefined criteria. It's an undertaking I'm eager to explore and see where it leads.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgfkmbmfooip91jjkedou.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgfkmbmfooip91jjkedou.jpeg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>success</category>
      <category>growth</category>
      <category>story</category>
    </item>
  </channel>
</rss>
