<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Programming on Aamnah - Frontend Web Developer</title>
    <link>https://aamnah.com/notes/programming/</link>
    <description>Recent content in Programming on Aamnah - Frontend Web Developer</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 13 Dec 2021 00:00:00 +0500</lastBuildDate>
    <atom:link href="https://aamnah.com/notes/programming/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Getting up to speed with Regex in order to redirect URLs</title>
      <link>https://aamnah.com/notes/programming/regex-url-patterns/</link>
      <pubDate>Mon, 13 Dec 2021 00:00:00 +0500</pubDate>
      <guid>https://aamnah.com/notes/programming/regex-url-patterns/</guid>
      <description>&lt;p&gt;We have 5 different types of news pages:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;News (the main blog posts listing page)&lt;/li&gt;&#xA;&lt;li&gt;Category&lt;/li&gt;&#xA;&lt;li&gt;Archive (listing page that lists all posts)&lt;/li&gt;&#xA;&lt;li&gt;Monthly archive (archive page that lists posts from a particular month in a year)&lt;/li&gt;&#xA;&lt;li&gt;Article (the individual blog past page)&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;All these pages have a different URL structure. We are going to redirect them based on what type of page it is, and then build the new URL by taking parts from the old URL&lt;/p&gt;</description>
    </item>
    <item>
      <title>Adding a Staging branch to your Git Flow setup</title>
      <link>https://aamnah.com/notes/programming/change-gitflow-master-staging-branch/</link>
      <pubDate>Mon, 06 Apr 2020 14:13:53 +0500</pubDate>
      <guid>https://aamnah.com/notes/programming/change-gitflow-master-staging-branch/</guid>
      <description>&lt;p&gt;We have a CI/CD setup and we need a &lt;code&gt;staging&lt;/code&gt; environment now (based off of a branch we&amp;rsquo;re going to call &lt;code&gt;staging&lt;/code&gt;). Git flow by default only has &lt;code&gt;develop&lt;/code&gt; and &lt;code&gt;master&lt;/code&gt;. What we&amp;rsquo;re going to do to is create a &lt;code&gt;staging&lt;/code&gt; branch and make it the default for production releases (aka what &lt;code&gt;master&lt;/code&gt; used to be).&lt;/p&gt;&#xA;&lt;p&gt;This branch will then get deployed (automatically) to the Staging environment. Once we&amp;rsquo;re happy with everything, we&amp;rsquo;ll manually merge the branch in &lt;code&gt;master&lt;/code&gt; and it will then be deployed live (manually).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Getting started with Flutter</title>
      <link>https://aamnah.com/notes/programming/flutter-getting-started/</link>
      <pubDate>Sun, 24 Nov 2019 00:00:00 +0500</pubDate>
      <guid>https://aamnah.com/notes/programming/flutter-getting-started/</guid>
      <description>&lt;h3 id=&#34;setting-up-on-linux&#34;&gt;Setting up on Linux&lt;/h3&gt;&#xA;&lt;h4 id=&#34;download-and-extract-the-flutter-sdk&#34;&gt;Download and extract the Flutter SDK&lt;/h4&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Extract the tarball where you want, usual places are &lt;code&gt;/usr/local/&lt;/code&gt; and &lt;code&gt;/opt&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;Update &lt;code&gt;$PATH&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h4 id=&#34;install-vs-code-extension-ext-install-ms-vscodecpptools&#34;&gt;Install VS Code extension &lt;code&gt;ext install ms-vscode.cpptools&lt;/code&gt;&lt;/h4&gt;&#xA;&lt;p&gt;At this point, if you run &lt;code&gt;flutter doctor&lt;/code&gt; it&amp;rsquo;ll look up your system for development capabilities. For example, it told me i didn&amp;rsquo;t have the Android toolchain and Android studio not installed so couldn&amp;rsquo;t develop for Android. Also, no connected devices.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Migrating Facebook plugin comments to WordPress</title>
      <link>https://aamnah.com/notes/programming/migrate-comments-facebook-plugin-wordpress/</link>
      <pubDate>Mon, 02 Sep 2019 00:00:01 +0500</pubDate>
      <guid>https://aamnah.com/notes/programming/migrate-comments-facebook-plugin-wordpress/</guid>
      <description>&lt;ul&gt;&#xA;&lt;li&gt;I already have extracted all the facebook plugin data and have them in a JavaScript file.&lt;/li&gt;&#xA;&lt;li&gt;The site had about 4000 news pages where the Facebook comments plugin was used. Not all of them had comments&lt;/li&gt;&#xA;&lt;li&gt;The scraped file lists all pages regardless of whether it had comments or not. I only need the 70 or so entries where we have comments, i.e. the &lt;code&gt;comments&lt;/code&gt; property is there.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;extracting-the-comments-and-getting-them-in-wordpress-ready-format&#34;&gt;Extracting the comments and getting them in WordPress ready format&lt;/h3&gt;&#xA;&lt;p&gt;Following is the JavaScript code used to extract only the comments and get them in the right format to be exported in WordPress database, i.e. change their properties to have the column names in the &lt;code&gt;wp_comments&lt;/code&gt; table.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using Prettier to automatically fix syntax for you</title>
      <link>https://aamnah.com/notes/programming/prettier/</link>
      <pubDate>Tue, 20 Feb 2018 00:00:00 +0500</pubDate>
      <guid>https://aamnah.com/notes/programming/prettier/</guid>
      <description>&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;npm i -D Prettier&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Pretty a file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;npm prettier src/Filename.js --write&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# Prettier config file&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;touch ~/.prettierrc&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;{}&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;{}&lt;/code&gt; just means take everything default. VS Code will automatically start using prettier to format your files if it sees a &lt;code&gt;.prettierrc&lt;/code&gt; file. Make sure you have the following settings enabled in VS Code settings&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;# VS Code config&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;Editor: Format On Save&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;Prettier: Require Config&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-json&#34; data-lang=&#34;json&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;scrpts&amp;#34;&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;2&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&#x9;&lt;span class=&#34;nt&#34;&gt;&amp;#34;format&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;prettier --write &amp;#39;src/**/*.{js,jsx,html,css,json}&amp;#39;&amp;#34;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;ln&#34;&gt;3&lt;/span&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&#34;https://frontendmasters.com/courses/complete-react-v4/adding-prettier-cli-script/&#34;&gt;https://frontendmasters.com/courses/complete-react-v4/adding-prettier-cli-script/&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Writing Code for Humans to Read</title>
      <link>https://aamnah.com/notes/programming/human-readable-code/</link>
      <pubDate>Fri, 20 Oct 2017 00:00:00 +0500</pubDate>
      <guid>https://aamnah.com/notes/programming/human-readable-code/</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;Programs are meant to be read by humans and only incidentally for computers to execute. - Donald Knuth&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Write your code for humans, humans are the ones who&amp;rsquo;ll read, maintain and improve it. Computers only get machine code, don&amp;rsquo;t worry about it.&lt;/li&gt;&#xA;&lt;li&gt;Whitespace is amazing when done right&lt;/li&gt;&#xA;&lt;li&gt;Be consistent. Be consistent in your naming, in capitalization, in spacing, in indentation, in code style. Pick a style, and stick to it.&lt;/li&gt;&#xA;&lt;li&gt;Have a directory based README file, but only if it is necessary. Don&amp;rsquo;t make a directory just for a README file, that&amp;rsquo;s over-organizing it.&lt;/li&gt;&#xA;&lt;li&gt;Documentation to the code should live with the code (i.e. comments). Ideally, your code  should be self-documented&lt;/li&gt;&#xA;&lt;li&gt;Don&amp;rsquo;t comment &lt;em&gt;how&lt;/em&gt; (unless it&amp;rsquo;s really complicated), focus on the &lt;em&gt;why&lt;/em&gt;&lt;/li&gt;&#xA;&lt;li&gt;Abstraction can make things hard to understand, proceed with caution&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;You only write it once, you&amp;rsquo;ll read it lots of times&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
    </item>
    <item>
      <title>Scope</title>
      <link>https://aamnah.com/notes/programming/scope-in-programming/</link>
      <pubDate>Mon, 16 Jan 2017 00:00:01 +0500</pubDate>
      <guid>https://aamnah.com/notes/programming/scope-in-programming/</guid>
      <description>&lt;h1 id=&#34;scope&#34;&gt;Scope&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;where to look for things&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h2 id=&#34;notes&#34;&gt;Notes&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;JavaScript is a compiled language. It is compiled everytime it is run (i.e. compiled at runtime)&lt;/li&gt;&#xA;&lt;li&gt;JavaScript has only function scope atm.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;links&#34;&gt;Links&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://frontendmasters.com/courses/advanced-javascript/#v=bzmsufj4uk&amp;amp;p=0.1878&#34;&gt;Frontend Masters: Advanced JavaScript - Scope&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
  </channel>
</rss>
