<?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: Tajeddine Alaoui</title>
    <description>The latest articles on DEV Community by Tajeddine Alaoui (@tajeddine).</description>
    <link>https://dev.to/tajeddine</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%2F61064%2F2f14280d-180e-474a-a0c4-d5cb7ce0d5e2.png</url>
      <title>DEV Community: Tajeddine Alaoui</title>
      <link>https://dev.to/tajeddine</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tajeddine"/>
    <language>en</language>
    <item>
      <title>Functional programming.js</title>
      <dc:creator>Tajeddine Alaoui</dc:creator>
      <pubDate>Thu, 11 Feb 2021 11:28:43 +0000</pubDate>
      <link>https://dev.to/tajeddine/functional-programming-js-3gh2</link>
      <guid>https://dev.to/tajeddine/functional-programming-js-3gh2</guid>
      <description>&lt;p&gt;Functional programming it's not a language, It's a paradigm (style of programming).&lt;/p&gt;

&lt;p&gt;So what are the perks of functional programming ?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Immutability (const variable instead of var/let)&lt;/li&gt;
&lt;li&gt;Higher-order functions (functions passed around as variables)&lt;/li&gt;
&lt;li&gt;Recursion (when a function calls itself)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And many more...&lt;/p&gt;

&lt;p&gt;When is functional programming usually used&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data processing&lt;/li&gt;
&lt;li&gt;Serverless&lt;/li&gt;
&lt;li&gt;High-Criticality systems&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The best part that i like about it is that it's really consice (short code) and robost compared to oop for instance.&lt;/p&gt;

&lt;p&gt;Her's an example of functional programming code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getOdds2(arr){
   return arr.filter(num =&amp;gt; num % 2 !== 0)
}
console.log(getOdds2(arr))
// logs [ 1, 3, 5, 7, 9 ]
// this can be even shorter
const getOdds3 = arr =&amp;gt; arr.filter(num =&amp;gt; num % 2 !== 0)
console.log(getOdds3(arr))
// logs [ 1, 3, 5, 7, 9 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>javascript</category>
      <category>functional</category>
    </item>
    <item>
      <title>Vue vs React</title>
      <dc:creator>Tajeddine Alaoui</dc:creator>
      <pubDate>Sun, 07 Feb 2021 09:02:40 +0000</pubDate>
      <link>https://dev.to/tajeddine/vue-vs-react-3630</link>
      <guid>https://dev.to/tajeddine/vue-vs-react-3630</guid>
      <description>&lt;p&gt;Vue.js gain a lot of popularity in the recent years, But is it convincing enough for developers to jump from react to vue ?&lt;br&gt;
Let's discuss on what are the differences between these giants.&lt;/p&gt;

</description>
      <category>vue</category>
      <category>react</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>Nuxt.js seo ready</title>
      <dc:creator>Tajeddine Alaoui</dc:creator>
      <pubDate>Tue, 19 Jan 2021 17:34:45 +0000</pubDate>
      <link>https://dev.to/tajeddine/nuxt-js-seo-ready-4a4i</link>
      <guid>https://dev.to/tajeddine/nuxt-js-seo-ready-4a4i</guid>
      <description>&lt;p&gt;Seo is a major pillar in web development and every production project have to be optimized for seo.&lt;/p&gt;

&lt;p&gt;We'll need to install 1 package that will assist us on seo, Will make our site stand out while sharing the link on social networks, Her's a preview.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IXsGi4wN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/i1bb42jg1c6c9ip3womk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IXsGi4wN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/i1bb42jg1c6c9ip3womk.png" alt="Alt Text" width="360" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can add: image, title, descreption and theme color.&lt;/p&gt;

&lt;p&gt;Let's start with installing nuxt-social-meta&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i nuxt-social-meta
or
yarn add nuxt-social-meta
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's add meta tags on nuxt-config.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;head: {
    htmlAttrs: {
      // Add the default language of the website
      lang: 'en',
    },
    title: 'My website title',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      // Add a descreption for the website
      {
        hid: 'description',
        name: 'description',
        content: 'Descreption...',
      },
    ],
    link: [
      // Add the author
      {
        name: 'author',
        content: 'John Doe',
      },
      // Keywords related to the website
      {
        name: 'keywords',
        content: 'the best website ever',
      },
      // Favicon
      { rel: 'icon', type: 'image/svg+xml', href: '/favicon.svg' },
    ],
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now let's add the module responsible for social networks url sharing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;modules: [
    [
      'nuxt-social-meta',
      {
        title: 'website-title',
        description: 'website-descreption',
        url: 'https://website.com',
        img: '/bg.png',
        locale: 'en',
        themeColor: '#000',
      },
    ],
],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to add custom meta tags for a page then do the following&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
export default {
  head() {
    return {
      title: 'my website',
      meta: [
        {
          hid: 'description',
          name: 'description',
          content: 'a website descreption',
        },
      ],
    }
  },
}
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You're nuxt app is seo ready !&lt;/p&gt;

</description>
      <category>nuxt</category>
      <category>vue</category>
      <category>seo</category>
    </item>
    <item>
      <title>Transform your existing Nuxt.js app to PWA</title>
      <dc:creator>Tajeddine Alaoui</dc:creator>
      <pubDate>Thu, 14 Jan 2021 11:41:11 +0000</pubDate>
      <link>https://dev.to/tajeddine/transform-your-nuxt-js-to-pwa-2a8j</link>
      <guid>https://dev.to/tajeddine/transform-your-nuxt-js-to-pwa-2a8j</guid>
      <description>&lt;h3&gt;
  
  
  Let's go the terminal and type:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add --dev @nuxtjs/pwa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i --save-dev @nuxtjs/pwa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once finished installing, go to nuxt-config.js and add the following&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;modules: ["@nuxtjs/pwa"],
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you're app have pwa technology, We only need to override default values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; // nuxt-config.js
  manifest: {
    icon: {
      // Add path to the app icon
      iconSrc: '',
    },
    // Short name of your app
    short_name: '',
    // Name of your app
    name: 'Chocoreto',
    // Add descreption
    descreption: '',
    start_url: '/',
    theme_color: '#fff',
    background_color: '#000',
  },

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And voila !&lt;/p&gt;

</description>
      <category>programming</category>
      <category>pwa</category>
      <category>nuxt</category>
      <category>vue</category>
    </item>
    <item>
      <title>HTTP Status codes</title>
      <dc:creator>Tajeddine Alaoui</dc:creator>
      <pubDate>Mon, 21 Dec 2020 11:15:20 +0000</pubDate>
      <link>https://dev.to/tajeddine/http-status-codes-2m7n</link>
      <guid>https://dev.to/tajeddine/http-status-codes-2m7n</guid>
      <description>&lt;p&gt;HTTP Stands for Hyper Text Transfer Protocol and it’s a way of communicating between web browsers and web servers.&lt;/p&gt;

&lt;p&gt;One of the ways that http is used to communicate between web browsers &amp;amp; web servers is http status code, It provides a number that represent the current state of the operation in the webpage.&lt;/p&gt;

&lt;p&gt;Here are some examples:&lt;/p&gt;

&lt;p&gt;Informational responses (100–199)&lt;br&gt;
Successful responses (200–299)&lt;br&gt;
Redirects (300–399)&lt;br&gt;
Client errors (400–499)&lt;br&gt;
Server errors (500–599)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oQTsmgLO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/oprwyrcgq7rmc4i15s22.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oQTsmgLO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/oprwyrcgq7rmc4i15s22.jpg" alt="http status code example" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you want to read more, These links will do the work:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP"&gt;http&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Status"&gt;http-status-code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cheers.&lt;/p&gt;

</description>
      <category>web</category>
      <category>frontenddev</category>
    </item>
  </channel>
</rss>
