<?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: Asif Zubayer Palak</title>
    <description>The latest articles on DEV Community by Asif Zubayer Palak (@acesif).</description>
    <link>https://dev.to/acesif</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%2F712904%2F67c41f29-a076-4d65-971e-50d41984cd15.jpg</url>
      <title>DEV Community: Asif Zubayer Palak</title>
      <link>https://dev.to/acesif</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/acesif"/>
    <language>en</language>
    <item>
      <title>🐧 How to SSH Into Your Android Phone Running Ubuntu Server (via Termux + Tailscale)</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Wed, 11 Jun 2025 06:57:58 +0000</pubDate>
      <link>https://dev.to/acesif/how-to-ssh-into-your-android-phone-running-ubuntu-server-via-termux-tailscale-31d4</link>
      <guid>https://dev.to/acesif/how-to-ssh-into-your-android-phone-running-ubuntu-server-via-termux-tailscale-31d4</guid>
      <description>&lt;p&gt;Have you ever wanted to SSH into your Android phone like it's a real Linux server? With Termux, Ubuntu, and Tailscale, you can do exactly that — without root!&lt;/p&gt;

&lt;p&gt;This guide walks you through setting up a fully functional Ubuntu environment inside Termux, exposing it via Tailscale, and making it the default shell on your phone. By the end, you'll be able to SSH into your phone from any device in your tailnet.&lt;/p&gt;

&lt;p&gt;🧰 Prerequisites&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Android phone&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://tailscale.com/download" rel="noopener noreferrer"&gt;Tailscale&lt;/a&gt; installed and connected on both your phone and your PC&lt;/li&gt;
&lt;li&gt;Termux installed via &lt;a href="https://f-droid.org/en/packages/com.termux/" rel="noopener noreferrer"&gt;F-Droid&lt;/a&gt; (not from Play Store — it’s deprecated!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some Linux experience&lt;/p&gt;

&lt;p&gt;⚠️ If You See This Error…&lt;br&gt;
CANNOT LINK EXECUTABLE "-sh": Library "/data/data/com.termux/files/..."&lt;/p&gt;

&lt;p&gt;You likely installed Termux from the Play Store, which is broken on modern Android.&lt;br&gt;
Solution: Uninstall Termux and install it via F-Droid or GitHub Releases.&lt;/p&gt;

&lt;p&gt;✅ Step 1: Install Ubuntu (or any other distro) in Termux Using proot-distro&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pkg update &amp;amp;&amp;amp; pkg upgrade
pkg install proot-distro
proot-distro list
proot-distro install ubuntu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To enter Ubuntu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;proot-distro login ubuntu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ Step 2: Make Ubuntu the Default Shell in Termux&lt;br&gt;
You want Ubuntu to load automatically when you launch Termux. Here's how:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Edit the startup script:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano ~/.bash_profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;Add this to the end of the file:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if [ -z "$PROOT_DISTRO_NAME" ]; then
  proot-distro login ubuntu-22.04
fi
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This prevents recursive launches if you’re already inside Ubuntu.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Reopen Termux
Now you'll land directly inside Ubuntu every time you open Termux. 🎉&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;✅ Step 3: Set Up SSH Server Inside Ubuntu&lt;/p&gt;

&lt;p&gt;Launch Ubuntu:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;proot-distro login ubuntu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apt update &amp;amp;&amp;amp; apt install openssh-server
passwd  # Set root password
service ssh start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your SSH server is live on Ubuntu inside Termux.&lt;/p&gt;

&lt;p&gt;✅ Step 4: SSH Into Your Phone via Tailscale&lt;br&gt;
Make sure your phone is connected to Tailscale and visible on your PC. Find the IP (e.g., 101.125.41.99).&lt;/p&gt;

&lt;p&gt;From your PC:&lt;/p&gt;

&lt;p&gt;If you want to ssh into Ubuntu inside termux&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh root@ip -p 8022
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or you can ssh into termux's shell by first:&lt;/p&gt;

&lt;p&gt;Inside termux&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;whoami # it should be something like u0_a124
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then from your pc or other host device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh u0_a124@ip -p 8022
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can change the port in the sshd_config, or use the default 8022 if inside Termux.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Fullstackopen Summary Part 3</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Wed, 15 Nov 2023 15:00:55 +0000</pubDate>
      <link>https://dev.to/acesif/fullstackopen-summary-part-3-4j09</link>
      <guid>https://dev.to/acesif/fullstackopen-summary-part-3-4j09</guid>
      <description>&lt;p&gt;This post contains the summary of what I learnt in fullstackopen (Part 3) &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Preparing the backend&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a directory for your backend and use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to create a &lt;code&gt;package.json&lt;/code&gt; file.&lt;br&gt;
Create a file called &lt;code&gt;index.js&lt;/code&gt; to implement your backend code and to run it, you need to use&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Implement the server code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to handle server side development,&lt;br&gt;
we need to use &lt;code&gt;express&lt;/code&gt;&lt;br&gt;
To install it, run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install express
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, in index.js file, import the express library and use it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express')
const app = express()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Listening on a port&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const PORT=3001
app.listen(PORT, ()=&amp;gt; {
  console.log(`Server running on port ${PORT}`)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;GET Request to show on local server&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let data = [ ... data in json format ... ]

app.get('/', (request, response) =&amp;gt; {
  response.send('&amp;lt;h1&amp;gt;Hello World!&amp;lt;/h1&amp;gt;')
})

app.get('/api/data', (request, response) =&amp;gt; {
  response.json(data)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Observe live changes in the server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In order to observe live changes in the server, we need to use nodemon&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install nodemon --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To observe live changes in the server use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nodemon index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Defining parameters for routes&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.get('/api/notes/:id', (request, response) =&amp;gt; {
  const id = request.params.id
  const note = notes.find(note =&amp;gt; note.id === id)
  response.json(note)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;request.params.id&lt;/code&gt; contains the parameter id from the route url.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Emulate requests to the backend&lt;/strong&gt;&lt;br&gt;
Use POSTMAN to simulate requests to the backend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Posting data to the backend&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.use(express.json())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This allows sending data to the backend in json format&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.post('/api/notes', (request, response) =&amp;gt;{
  const note = request.body  
  response.json(note)
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Middlewares&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Middlewares are functions used for handling request and response objects.&lt;br&gt;
Used by the express server like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.use(middleware)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CORS&lt;/strong&gt;&lt;br&gt;
In order to allow the client to access data from a server hosted on a different website or server, express needs to enable cors.&lt;/p&gt;

&lt;p&gt;In terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install cors
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In index.js&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const cors = require('cors')
app.use(cors())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Production Build&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To deploy the app, we must first create the production build which is made by&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;which creates a folder called &lt;code&gt;dist&lt;/code&gt; containing the build files.&lt;/p&gt;

&lt;p&gt;Once the production build has been run, you can move it to the backend folder and then allow the backend to use the static content using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.use(express.static('dist'))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Proxy&lt;/strong&gt;&lt;br&gt;
We can use proxy to shorten the base url link since the backend is hosted on another url.&lt;br&gt;
To do so, go to &lt;code&gt;vite.config.js&lt;/code&gt; file 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;import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

export default defineConfig({
  plugins: [react()],
  server: {    
   proxy: {      
    '/api': {        
      target: 'http://localhost:3001',
      changeOrigin: true,      
    },    
  }  
 },
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Saving data to mongodb&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to mongodb atlas to create a cluster and get a mongodb uri like:&lt;br&gt;
&lt;code&gt;mongodb+srv://fullstack:&amp;lt;password&amp;gt;@cluster0.o1opl.mongodb.net/?retryWrites=true&amp;amp;w=majority&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To use the mongodb database, we need to use a node package called mongoose which can be installed using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install mongoose
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and to implement it, you need to go to the server side 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;const mongoose = require('mongoose')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To use the specific mongodb cluster, we need to use the cluster's uri which should be saved as an environment variable in a &lt;code&gt;.env&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;To set it up, you need to install &lt;code&gt;dotenv&lt;/code&gt;&lt;br&gt;
and import it using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require('dotenv').config()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;let's say the variable name is &lt;code&gt;MONGO_URI&lt;/code&gt;, so to use it, you need to access it by &lt;code&gt;process.env.MONGO_URI&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configuring the schema&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongoose.set('strictQuery',false)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ensures that only the items stated in the schema gets saved into the mongodb database.&lt;/p&gt;

&lt;p&gt;Then we connect the mongodb database to our backend using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mongoose.connect(process.env.MONGO_URI)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we declare a schema to set the basis of the data that our database will hold using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const schema = new mongoose.Schema({
  item_1: datatype,
  item_2: datatype,
  ....
})
const Object = mongoose.model('Object',schema)

&amp;lt;create an entry using that schema, this part is demonstrated later on&amp;gt;

entry.save().then(res =&amp;gt; {
  mongoose.connection.close()
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Fetching items from the database&lt;/strong&gt;&lt;br&gt;
We previously made an instance called &lt;code&gt;Object&lt;/code&gt; which followed the schema we made.&lt;/p&gt;

&lt;p&gt;In order to get all the entries in that object, we use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.get('/api/data'.(req,res) =&amp;gt; {
  Object.find({}).then(result=&amp;gt;{
    res.json(result)
  })
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Transforming mongodb output&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The response from the mongodb database comes with some default values such as &lt;code&gt;_id&lt;/code&gt; and &lt;code&gt;__v&lt;/code&gt;.&lt;br&gt;
These needs to be transformed into attributes that are &lt;em&gt;cleaner&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Implement that by using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;schema.set('toJSON', {
  transform: (document, returnedObject) =&amp;gt; {
    returnedObject.id = returnedObject._id.toString()
    delete returnedObject._id
    delete returnedObject.__v
  }
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you save this configuration, you need to export it by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;module.exports = mongoose.model('Object',schema)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Error Handling&lt;/strong&gt;&lt;br&gt;
We can handle the errors in a middleware, in the middleware's HTTP request, you can 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;app.get('/api/notes/:id', (request, response, next) =&amp;gt; {  Note.findById(request.params.id)
    .then(note =&amp;gt; {
        ...
    .catch(error =&amp;gt; next(error))})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the &lt;code&gt;next&lt;/code&gt; function sends the error down the next routes till it reaches the errorhandler middleware.&lt;/p&gt;

&lt;p&gt;You can initiate the errorhandler middleware like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const errorHandler = (error, request, response, next) =&amp;gt; {
  console.error(error.message)

  if (error.name === 'CastError') {
    return response.status(400).send({ error: 'malformatted id' })
  } 

  next(error)
}

// this has to be the last loaded middleware.
app.use(errorHandler)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The order of middleware loading&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.use(express.static('dist'))
app.use(express.json())
app.use(requestLogger)

app.post('/api/notes', (request, response) =&amp;gt; {
  const body = request.body
  // ...
})

const unknownEndpoint = (request, response) =&amp;gt; {
  response.status(404).send({ error: 'unknown endpoint' })
}

// handler of requests with unknown endpoint
app.use(unknownEndpoint)

const errorHandler = (error, request, response, next) =&amp;gt; {
  // ...
}

// handler of requests with result to errors
app.use(errorHandler)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Delete and Update Requests&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Delete&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.delete('/api/notes/:id', (request, response, next) =&amp;gt; {
  Note.findByIdAndRemove(request.params.id)
    .then(result =&amp;gt; {
      response.status(204).end()
    })
    .catch(error =&amp;gt; next(error))
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Update&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.put('/api/notes/:id', (request, response, next) =&amp;gt; {
  const body = request.body

  const note = {
    content: body.content,
    important: body.important,
  }

  Note.findByIdAndUpdate(request.params.id, note, { new: true })
    .then(updatedNote =&amp;gt; {
      response.json(updatedNote)
    })
    .catch(error =&amp;gt; next(error))
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Enforce Validation&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const noteSchema = new mongoose.Schema({
  content: {    
    type: String,    
    minLength: 5,    
    required: true  
  },  
  important: Boolean
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add this to errorhandler&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;else if (error.name === 'ValidationError') {    
  return response.status(400).json({ error: error.message })  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add this to the update request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; Note.findByIdAndUpdate(
    request.params.id, 
    { content, important },    
    { new: true, runValidators: true, context: 'query' }  
) 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>tutorial</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Fullstackopen Summary Part 2</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Wed, 08 Nov 2023 09:10:40 +0000</pubDate>
      <link>https://dev.to/acesif/fullstackopen-summary-part-2-8l8</link>
      <guid>https://dev.to/acesif/fullstackopen-summary-part-2-8l8</guid>
      <description>&lt;h3&gt;
  
  
  This post contains the summary of what I learnt in fullstackopen (Part 2)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Higher Order Functions in Javascript such as map,filter,reduce and find:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Filter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const ages = [32, 33, 16, 40];
const result = ages.filter(age=&amp;gt;{
  return age&amp;gt;=18
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ 32, 33, 40 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Map:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbers = [65, 44, 12, 4];
const newArr = numbers.map(num=&amp;gt;{
  return num*10
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ 650, 440, 120, 40 ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reduce:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const arr = [1.5, 20.3, 11.1, 40.7]
const total = arr.reduce((sum,item)=&amp;gt;{
  return sum+item
},0)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;73.6 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Find:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const array = [10, 20, 30, 40, 50];
const found = array.find((element)=&amp;gt;{
    return element &amp;gt; 20;
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Key attribute&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When rendering mapped out items, we need to assign the &lt;code&gt;key&lt;/code&gt; attribute to distinguish between each element. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useState hook&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [item,setItem] = useState(initialValue)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that the state updates asynchronously, so if you update an item using useState, it might not immediately be in effect until the next render.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Forms in React&lt;/strong&gt;&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;form onSubmit={addNote}&amp;gt;        
  &amp;lt;input 
    value={newNote}
    onChange={handleNoteChange}
  /&amp;gt;        
  &amp;lt;button type="submit"&amp;gt;save&amp;lt;/button&amp;gt;      &amp;lt;/form&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Using JSON server&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After making a json file containing all the data.&lt;br&gt;
Install json-server using&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install json-server --save-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and then run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;json-server --port 3000 --watch db.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Fetching data from server side
We need to use axios to fetch data, therefore
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install axios
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To use axios&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import axios from 'axios'
axios.get('http://localhost:3001/data')
.then(res=&amp;gt; console.log(res.data))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;useEffect hook&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is used to fetch data from the server as it executes immediately upon render.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {        
 axios
  .get('http://localhost:3001/')
  .then(response =&amp;gt; {        
       setNotes(response.data)      
 })  
}, [])
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The array at the end is called the dependency array where you can pass variables and functions, which would cause the DOM to render upon changes in those variables and functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Axios post and put&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://axios-http.com/docs/post_example"&gt;POST&lt;/a&gt;&lt;br&gt;
PUT:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;axios.put(url, changedNote).then(response =&amp;gt; {
  setNotes(notes.map(note =&amp;gt; 
  note.id !== id ? note : response.data))
})
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Creating a separate module
Keep all the axios requests in a separate module and maintain modularity 
and lastly export those functions using
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default { 
  getAll, 
  create, 
  update 
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Error Handling&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Attaching&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.catch(error){
  console.log(error)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Outputs the error in case the request doesn't pass through&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Fullstackopen Summary Part 1</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Sun, 05 Nov 2023 19:07:46 +0000</pubDate>
      <link>https://dev.to/acesif/fullstackopen-summary-part-1-3bl0</link>
      <guid>https://dev.to/acesif/fullstackopen-summary-part-1-3bl0</guid>
      <description>&lt;h2&gt;
  
  
  This post contains the summary of what I learnt in fullstackopen (Part 1)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Creating a react app
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm create vite@latest appname -- --template react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Running vite application
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Export Component
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[...create component...]
export default ComponentName
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Import component
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import ComponentName from '../component.jsx'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;What to render&lt;br&gt;
The react app cannot render objects&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How to render objects&lt;br&gt;
using the map function:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;object.map(item =&amp;gt; &amp;lt;p&amp;gt;{item}&amp;lt;p&amp;gt;)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;works if each item in the object is not an object itself as well.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;this&lt;/code&gt; keyword&lt;br&gt;
&lt;code&gt;this&lt;/code&gt; tells us about what context it was called from.&lt;br&gt;
if &lt;code&gt;this&lt;/code&gt; is called from a reference, it becomes a global object, and if it is called within a function, &lt;code&gt;this&lt;/code&gt; refers to the scope of the function.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Using props&lt;br&gt;
Pass it through the component:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;Component prop={variable} /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using props on the components:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const Component = ({prop1,prop2}) =&amp;gt; {
...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Updating object
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const items = {
right: 0,
left: 0
}
const updated = {
...items,
left: items.left + 1
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>react</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>4 BEST places to find Open Source projects</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Fri, 20 Oct 2023 13:24:48 +0000</pubDate>
      <link>https://dev.to/acesif/4-best-places-to-find-open-source-projects-5e2c</link>
      <guid>https://dev.to/acesif/4-best-places-to-find-open-source-projects-5e2c</guid>
      <description>&lt;h2&gt;
  
  
  Beginners who are looking to contribute to open source either to improve their skills, include in their portfolio or for whatever reason - they often get confused on where to start to which repositories to work on.
&lt;/h2&gt;

&lt;p&gt;To address these issues, there are some techniques and places where you can pick a project and get started with contributing.&lt;/p&gt;

&lt;p&gt;However, there are some criterion to keep in mind before you get started:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Know your skills&lt;/li&gt;
&lt;li&gt;Complexity of the project&lt;/li&gt;
&lt;li&gt;Maintenance of a repository&lt;/li&gt;
&lt;li&gt;Where to find projects/repositories?&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Know your skills
&lt;/h3&gt;

&lt;p&gt;In order to start contributing, you need to have the skill set necessary to understand the existing project code and workflow as well.&lt;br&gt;
Many people may comment on that you do not need technical skills if you want to work on the &lt;strong&gt;Documentation&lt;/strong&gt;. However, that cannot be further from the truth, since working on the Documentation requires you to have a full understanding of the project's workflow. &lt;/p&gt;

&lt;p&gt;Now, to understand whether a project is fit for you can be estimated by looking at the right-hand side of the Github Repository.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NV6yNuoq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2omc8rxdr0jjh025cw7b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NV6yNuoq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2omc8rxdr0jjh025cw7b.png" alt="Image description" width="419" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your skill set correspond to these, you may work on the project.&lt;/p&gt;

&lt;p&gt;NOTE: You should ideally have knowledge of &lt;code&gt;Markdown&lt;/code&gt; syntax, if you don't -- you may want to check out &lt;a href="https://commonmark.org/help/tutorial/"&gt;this&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Complexity of the project
&lt;/h3&gt;

&lt;p&gt;Some projects are easy, some are not-so-easy. In order to decide whether you want to delve into a project, you should check out the &lt;code&gt;Issues&lt;/code&gt; tab in the specific repository.&lt;br&gt;
Ideally, you should read the &lt;code&gt;README&lt;/code&gt; file carefully and look into the directories and read the code to get an abstract idea of how things are working.&lt;/p&gt;

&lt;p&gt;If you feel like &lt;em&gt;Yeah I might/could solve this problem&lt;/em&gt; after looking at the issues, you can dive in. &lt;br&gt;
It's fine if you feel like you cannot fix any of these, you just need some time to learn the missing gaps in your knowledge-base and look more through the codebase.&lt;/p&gt;

&lt;h3&gt;
  
  
  Maintenance of a repository
&lt;/h3&gt;

&lt;p&gt;Check the date of the last merge date of a &lt;strong&gt;Pull Request&lt;/strong&gt; or the frequency of the responses in the &lt;strong&gt;Issues&lt;/strong&gt;&lt;br&gt;
If the repository has not been maintained in more than 3 months, it's most likely that your pull request or issues may not be addressed and get dropped.&lt;/p&gt;

&lt;p&gt;Ideally, the activity in a repository should be between few days to a week or two.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where to find Open Source Projects?
&lt;/h2&gt;

&lt;p&gt;Finding good open source repositories might be a bit daunting, but there are several resources that can help you find them easily:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://goodfirstissue.dev/"&gt;GoodFirstIssue&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GrpUTszd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd60brvtxg9yhezj1k6g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GrpUTszd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jd60brvtxg9yhezj1k6g.png" alt="Image description" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a good resource that allows you to filter and find repositories open for contribution based on your preferred language.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/topics/open-source"&gt;Github Open Source Tag&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ob_2KA2H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kner3i9g5hd3jxv396yo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ob_2KA2H--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kner3i9g5hd3jxv396yo.png" alt="Image description" width="800" height="507"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many Github repositories tag themselves open for contribution so that people can easily contribute.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/topics/good-first-issue"&gt;Github Good First Issue&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--durmdRYt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/diyleh3kzx43sviwwk75.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--durmdRYt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/diyleh3kzx43sviwwk75.png" alt="Image description" width="800" height="564"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is Github's own good first issue tag that many repositories have that are perfect for people who are beginner programmers or first time into open source contribution.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://firstcontributions.github.io/"&gt;First Contributions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--73wAZF7m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dw5fc79hrc501i24h1eo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--73wAZF7m--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dw5fc79hrc501i24h1eo.png" alt="Image description" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is similar to GoodFirstIssue, where you can filter projects or repositories based on the language and technologies used.&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>hacktoberfest</category>
      <category>community</category>
      <category>git</category>
    </item>
    <item>
      <title>How to mount a drive at boot in Arch Linux</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Tue, 03 Oct 2023 11:16:25 +0000</pubDate>
      <link>https://dev.to/acesif/how-to-mount-a-drive-at-boot-in-arch-linux-2g7d</link>
      <guid>https://dev.to/acesif/how-to-mount-a-drive-at-boot-in-arch-linux-2g7d</guid>
      <description>&lt;h1&gt;
  
  
  If you have a removable drive and you don't want to manually mount every time you boot your PC, you can easily set it up to automatically mount every time your PC boots up.
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Gathering the required info
&lt;/h3&gt;

&lt;p&gt;In order to set up the auto mount, you need to know several things such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the drive partition directory&lt;/li&gt;
&lt;li&gt;mount point &lt;/li&gt;
&lt;li&gt;UUID&lt;/li&gt;
&lt;li&gt;File System or FS&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;To find these information, run
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lsblk -f
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;on your terminal.&lt;/p&gt;

&lt;p&gt;You will get something like this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jxe5eWGG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vj0k6n47qvwddamvcdmo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jxe5eWGG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vj0k6n47qvwddamvcdmo.png" alt="Image description" width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Look for your desired partition directory such as &lt;code&gt;sdc1&lt;/code&gt; or &lt;code&gt;sdb1&lt;/code&gt; and take note of the FSTYPE and copy the UUID.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next, you will need to create a mount point by running this command:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir /run/media/user/directory_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where &lt;code&gt;user&lt;/code&gt; is your username and &lt;code&gt;directory_name&lt;/code&gt; is what you want the partition to be called.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Once done, use vim/nano or any other text editor to open &lt;code&gt;/etc/ftsab&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It will look something like this:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CBnzDRKF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p76pdl23knktfmdz67va.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CBnzDRKF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p76pdl23knktfmdz67va.png" alt="Image description" width="800" height="415"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a new line and add the following entry
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# /dev/your_partition_directory

UUID=(copied UUID here)  mount_point(eg: /run/media/user/partition) filetype(eg: ntfs or ext4) rw,relatime
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Match the format with the example image above and then save and exit.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reboot your pc and check if the partitions are automatically mounted.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>archlinux</category>
      <category>linux</category>
      <category>tutorial</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to set media key-binds for dwm in Arch Linux</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Mon, 02 Oct 2023 14:24:49 +0000</pubDate>
      <link>https://dev.to/acesif/how-to-set-media-key-binds-for-dwm-in-arch-linux-1hfe</link>
      <guid>https://dev.to/acesif/how-to-set-media-key-binds-for-dwm-in-arch-linux-1hfe</guid>
      <description>&lt;h2&gt;
  
  
  After installing Arch Linux with suckless dwm window manager, some of the keys in your keyboard may stop working.
&lt;/h2&gt;

&lt;p&gt;This requires the need to manually set up keybinds for your set up.&lt;/p&gt;

&lt;h4&gt;
  
  
  Required Installations
&lt;/h4&gt;

&lt;p&gt;In order to get started, there are some packages that you need to install to set the keybinds.&lt;br&gt;
The packages are &lt;code&gt;xbindkeys&lt;/code&gt; and &lt;code&gt;xbindkeys_config&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The commands to install these two packages for Arch are:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;if you don't have yay installed, run this first&lt;/em&gt; &lt;br&gt;
&lt;code&gt;sudo pacman -Sy yay&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;or you can also build them from AUR, but I suggest using yay&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yay -S xbindkeys xbindkeys_config-gtk2
xbindkeys -d &amp;gt; ~/.xbindkeysrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a file called .xbindkeysrc in your home directory which contains all your keybinds, but we will be using the GUI version instead.&lt;/p&gt;

&lt;p&gt;If you want to &lt;em&gt;not&lt;/em&gt; use the GUI version or if it is not working for you, check out the xbindkeys manual &lt;a href="https://man.archlinux.org/man/extra/xbindkeys/xbindkeys.1.en"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Setting Keybinds
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Open the application called &lt;code&gt;xbindkeys_config&lt;/code&gt; either from dmenu or from the terminal&lt;/li&gt;
&lt;li&gt;You will be prompted with a window such as:
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--E8Nxy8xr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/spt3xut646eugejuf2at.png" alt="Image description" width="800" height="732"&gt;
&lt;/li&gt;
&lt;li&gt;On the bottom bar, there are several options, select &lt;code&gt;New&lt;/code&gt; which will open a panel to the left.&lt;/li&gt;
&lt;li&gt;There are several text boxes for each attribute. &lt;strong&gt;Name&lt;/strong&gt; would contain the name of the keybind, &lt;strong&gt;Key&lt;/strong&gt; will contain the keycode of the hardware keys and &lt;strong&gt;Action&lt;/strong&gt; contains the command that will execute upon pressing the button.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Configs for Keybinds
&lt;/h4&gt;

&lt;p&gt;Config for Volume Up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First write &lt;strong&gt;Volume Up&lt;/strong&gt; in the name and then select &lt;code&gt;Get Key&lt;/code&gt; that will pop up a blank window.&lt;/li&gt;
&lt;li&gt;Select the key combination for your keybind &lt;/li&gt;
&lt;li&gt;Next, put this command into the &lt;strong&gt;Action&lt;/strong&gt; box
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pactl set-sink-volume @DEFAULT_SINK@ +1%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can change 1% to whatever value you want to increment the volume by.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lastly hit &lt;strong&gt;Save&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Config for Volume Down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Same as Volume up except the &lt;strong&gt;Action&lt;/strong&gt; command will be
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pactl set-sink-volume @DEFAULT_SINK@ -1%
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Config for Mute:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To mute/unmute the Audio Output/Speaker/Headphone
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pactl set-sink-mute @DEFAULT_SINK@ toggle
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;To mute/unmute the Audio Input/Microphone
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pactl set-source-mute @DEFAULT_SOURCE@ toggle
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Config for Media Playback:&lt;/p&gt;

&lt;p&gt;To set keybinds for pause/play or next/previous, you need to install &lt;code&gt;playerctl&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Run the command &lt;code&gt;yay -Sy playerctl&lt;/code&gt; in the terminal and you are good to go.&lt;/p&gt;

&lt;p&gt;The Action Commands for &lt;strong&gt;Pause/Play&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;playerctl play-pause
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Action Commands for &lt;strong&gt;Previous Track&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;playerctl previous
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Action Commands for &lt;strong&gt;Next Track&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;playerctl next
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Once Done, Hit Save and Exit and lastly, in order for your keybinds to remain permanent after each boot, you must configure your .xinitrc in the directory &lt;code&gt;~.xinitrc&lt;/code&gt;
&lt;/h4&gt;

&lt;p&gt;Use a text editor of your choice and add the following line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;xbindkeys &amp;amp;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;before &lt;code&gt;exec dwm&lt;/code&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>archlinux</category>
    </item>
    <item>
      <title>JS Classes: Extend and Super Keyword</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Wed, 29 Mar 2023 15:27:16 +0000</pubDate>
      <link>https://dev.to/acesif/js-classes-part-2-extend-and-super-keywords-in-js-classes-4o0m</link>
      <guid>https://dev.to/acesif/js-classes-part-2-extend-and-super-keywords-in-js-classes-4o0m</guid>
      <description>&lt;h2&gt;
  
  
  Extend and Super Keywords are used to implement &lt;a href="https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)"&gt;Inheritance&lt;/a&gt; in JS.
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;extends&lt;/code&gt; keyword, as the name suggests, extends a class - meaning, one class inherits the properties from another class.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;super&lt;/code&gt; keyword refers to superclass or parent objects. It is used to call and to access superclass methods and constructor.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to use the Extend and Super Keywords?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Vehicle{
 constructor(vehicleType,numofSeats){
   this.vehicleType = vehicleType;
   this.numofSeats = numofSeats;
   this.forSale = false;
 }
 describe(){
  return `This ${vehicleType} has ${numofSeats}`;
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we will use the &lt;strong&gt;extend&lt;/strong&gt; keyword to inherit the properties of the Vehicle class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Car extends Vehicle{
  constructor(vehicleType,numofSeats,color){
    super(vehicleType,numofSeats);
     this.color = color;
     this.forSale = true;
  }
  describe(){
    super();
  }
}

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;super&lt;/code&gt; calls the constructor function of the Vehicle class since we are extending from Vehicle. &lt;/p&gt;

&lt;p&gt;Doing so reduces your hassle of writing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.vehicleType = vehicleType;
this.numofSeats = numofSeats;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;all over again for the &lt;code&gt;Car&lt;/code&gt; class.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;color&lt;/code&gt; is a property that was not in the &lt;code&gt;Vehicle&lt;/code&gt; class, therefore - we add it in the &lt;code&gt;Car&lt;/code&gt; constructor and assign &lt;code&gt;this.color&lt;/code&gt; to &lt;code&gt;color&lt;/code&gt;.&lt;br&gt;
Since we are selling the Car, &lt;code&gt;this.forSale&lt;/code&gt; should be set to &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In case of functions, you can also inherit and call it from the parent class. Such as the code snippet&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;describe(){
  super();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;as shown in the code above invokes the super function inside the &lt;code&gt;describe()&lt;/code&gt; function. What this does is the &lt;code&gt;Car&lt;/code&gt; class invokes the &lt;code&gt;describe&lt;/code&gt; function from the &lt;code&gt;Vehicle&lt;/code&gt; class. Meaning that the &lt;code&gt;Car&lt;/code&gt; subclass is calling the &lt;code&gt;describe()&lt;/code&gt;function from the &lt;code&gt;Vehicle&lt;/code&gt; class while using the parameters of the &lt;code&gt;Car&lt;/code&gt; subclass.&lt;/p&gt;

&lt;h3&gt;
  
  
  To learn about &lt;code&gt;static&lt;/code&gt; methods, check out JS Classes: Static Methods
&lt;/h3&gt;

</description>
    </item>
    <item>
      <title>JS Classes: Classes and Constructors</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Fri, 03 Mar 2023 11:24:08 +0000</pubDate>
      <link>https://dev.to/acesif/js-classes-part-1-intro-to-js-es6-classes-5hfl</link>
      <guid>https://dev.to/acesif/js-classes-part-1-intro-to-js-es6-classes-5hfl</guid>
      <description>&lt;h2&gt;
  
  
  What are classes?
&lt;/h2&gt;

&lt;p&gt;Classes are a template for creating objects. Use the keyword &lt;code&gt;class&lt;/code&gt; to create a class.&lt;br&gt;
Always add a method named &lt;code&gt;constructor()&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Creating a new class
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Car{
 constructor(brand, model, color){
  this.brand = brand;
  this.model = model;
  this.color = color;
  this.sold = false;
 }
 carSold(){
  this.sold = true;
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We create a class with the &lt;code&gt;class&lt;/code&gt; keyword and then create the &lt;code&gt;constructor&lt;/code&gt; function. &lt;/p&gt;

&lt;p&gt;The constructor function immediately gets invoked when we create an object using this class. &lt;/p&gt;

&lt;p&gt;You might notice that there is a function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;carSold(){
  this.sold = true;
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which is actually in the ES6 syntax. Normally, you'd see this function written like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;this.carSold = function(){
 this.sold = true;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Creating an object with the class
&lt;/h3&gt;

&lt;p&gt;Now as you're done creating the class, time to create an object with it.&lt;br&gt;
To do this you need to type in:&lt;br&gt;
&lt;code&gt;let &amp;lt;object_name&amp;gt; = new &amp;lt;class_name&amp;gt;(&amp;lt;parameters&amp;gt;)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For example, for the class stated above:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let car1 = new Car('Toyota','Sienna','Blue')'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This would create an object car1 of Brand: Toyota, Model: Sienna and Color: Blue.&lt;/p&gt;

&lt;p&gt;Here, the parameters inside the round brackets are passed to the constructor and thus sets the &lt;strong&gt;Brand&lt;/strong&gt; to &lt;em&gt;Toyota&lt;/em&gt;,  &lt;strong&gt;Model&lt;/strong&gt; to &lt;em&gt;Sienna&lt;/em&gt; and &lt;strong&gt;Color&lt;/strong&gt; to &lt;em&gt;Blue&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Initially its &lt;code&gt;sold&lt;/code&gt; status is set to &lt;code&gt;false&lt;/code&gt;.&lt;br&gt;
This is changed by calling the &lt;code&gt;carSold()&lt;/code&gt; function.&lt;br&gt;
So if you call &lt;code&gt;car1.carSold()&lt;/code&gt; - the value of &lt;code&gt;car1.sold&lt;/code&gt; will be &lt;code&gt;true&lt;/code&gt; &lt;/p&gt;

&lt;h3&gt;
  
  
  To learn about the Extend and Super keyword, check out &lt;a href="https://dev.to/acesif/js-classes-part-2-extend-and-super-keywords-in-js-classes-4o0m"&gt;JS Classes: Extend and Super Keyword&lt;/a&gt;
&lt;/h3&gt;

</description>
      <category>javascript</category>
      <category>oop</category>
      <category>tutorial</category>
      <category>career</category>
    </item>
    <item>
      <title>13 Terminal commands in Linux that you *must* know!</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Wed, 04 Jan 2023 14:26:54 +0000</pubDate>
      <link>https://dev.to/acesif/13-terminal-commands-in-linux-that-you-must-know-f0o</link>
      <guid>https://dev.to/acesif/13-terminal-commands-in-linux-that-you-must-know-f0o</guid>
      <description>&lt;h3&gt;
  
  
  Linux is a popular operating system that majority of the web servers use. If you are a web developer, your website is most likely being hosted on a Linux environment and using some of its tools.
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Although you may not need to interact much with Linux - as a developer, it is powerful for &lt;strong&gt;you&lt;/strong&gt; to know how to get around in a Linux environment.
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Below are some of the commonly used Linux Terminal commands used for basic operations:
&lt;/h3&gt;

&lt;h2&gt;
  
  
  &amp;lt; ls &amp;gt;
&lt;/h2&gt;

&lt;p&gt;ls is a terminal command used to display the list of files and sub-directories in the current directory.&lt;/p&gt;

&lt;p&gt;The syntax of this command is&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;ls [flag] [File]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Some of the commonly used flags are &lt;br&gt;
&lt;code&gt;ls -a&lt;/code&gt;&lt;br&gt;
list all files including hidden files.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls -l&lt;/code&gt;&lt;br&gt;
list with long format - shows permissions.&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%2Fv9hs32tcox3vxs0h3cs0.png" 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%2Fv9hs32tcox3vxs0h3cs0.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &amp;lt; cd &amp;gt;
&lt;/h2&gt;

&lt;p&gt;cd stands for change directory and is used to move to another directory from your current directory.&lt;/p&gt;

&lt;p&gt;The syntax of the command is&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;cd [directory_name]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;cd /&lt;/code&gt; can be used to move to the root directory&lt;br&gt;
&lt;code&gt;cd a/b/c&lt;/code&gt; can be used to move to a nested directory. Here, c is inside b and b is inside a.&lt;br&gt;
&lt;code&gt;cd ~&lt;/code&gt; or just &lt;code&gt;cd&lt;/code&gt; can be used to move to the home directory.&lt;br&gt;
&lt;code&gt;cd ..&lt;/code&gt; can be used to move up one directory (previous directory).&lt;br&gt;
&lt;code&gt;cd "new folder"&lt;/code&gt; is the format used to change to a directory which has a blankspace in its name.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  &amp;lt; man &amp;gt;
&lt;/h2&gt;

&lt;p&gt;man command shows the user manual of any command that we can run on&lt;br&gt;
the terminal. The manual contains NAME, SYNOPSIS, DESCRIPTION, OPTIONS etc. related to the command.&lt;br&gt;
This is one of the most useful commands in Linux because it helps you learn to use other commands.&lt;/p&gt;

&lt;p&gt;The syntax of the command is&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;man [command_name]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Entering &lt;code&gt;man nmap&lt;/code&gt; gave out this result:&lt;br&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%2Fuqgvbieocdov999b8i6f.png" 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%2Fuqgvbieocdov999b8i6f.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &amp;lt; touch &amp;gt;
&lt;/h2&gt;

&lt;p&gt;The touch command primarily serves two purposes: create a file and modify a file's timestamp.&lt;/p&gt;

&lt;p&gt;The syntax of the command is&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;touch &amp;lt;flag&amp;gt; &amp;lt;file_name&amp;gt;&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Simply using &lt;code&gt;touch &amp;lt;file_name&amp;gt;&lt;/code&gt; will let you create a file if it doesn't exist. &lt;br&gt;
If a file of that name exists, it will update its timestamp to current time.&lt;/p&gt;

&lt;p&gt;You can create multiple files together using touch by &lt;code&gt;touch &amp;lt;file1&amp;gt; &amp;lt;file2&amp;gt; ... &amp;lt;filex&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can create multiple ordered files using touch by &lt;code&gt;touch &amp;lt;filename{&amp;lt;start&amp;gt;..&amp;lt;finish&amp;gt;}&amp;gt;&lt;/code&gt;&lt;br&gt;
Example: &lt;code&gt;touch file{1..10}&lt;/code&gt; or &lt;code&gt;touch file{a..z}&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &amp;lt; mkdir &amp;gt;
&lt;/h2&gt;

&lt;p&gt;mkdir is a command that is used to create new directories.&lt;/p&gt;

&lt;p&gt;The syntax of the command is&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;mkdir [flag] [directory]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;The command &lt;code&gt;mkdir folder1&lt;/code&gt; is used to create a folder named &lt;code&gt;folder1&lt;/code&gt;. You can create multiple folder simultaneously by &lt;code&gt;mkdir folder1 folder2 folder3 ...&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;You can also create nested directories:&lt;br&gt;
&lt;code&gt;mkdir -p a/b/c&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;if folder a and folder b do not exist, they will be created before creating folder c.&lt;/p&gt;
&lt;h2&gt;
  
  
  &amp;lt; pwd &amp;gt;
&lt;/h2&gt;

&lt;p&gt;pwd stands for present working directory and it displays the path of the directory you are currently in.&lt;/p&gt;

&lt;p&gt;The syntax is simply &lt;code&gt;pwd&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &amp;lt; clear &amp;gt;
&lt;/h2&gt;

&lt;p&gt;clear command clears the terminal. If your terminal is cluttered with commands and outputs, clear command is used to erase them.&lt;/p&gt;

&lt;p&gt;The syntax is simply &lt;code&gt;clear&lt;/code&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  &amp;lt; mv &amp;gt;
&lt;/h2&gt;

&lt;p&gt;mv command can be used to either move one or more files or directories from one place to another or rename a file or folder.&lt;/p&gt;

&lt;p&gt;The syntax for this command is&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mv [flag] [source] [destination]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mv a.txt b.txt&lt;/code&gt; is an example where mv was used to rename &lt;em&gt;a.txt&lt;/em&gt; to &lt;em&gt;b.txt&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;mv a.txt folder1&lt;/code&gt; is an example where mv was used to move &lt;em&gt;a.txt&lt;/em&gt; was moved to a folder named &lt;em&gt;folder1&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &amp;lt; cp &amp;gt;
&lt;/h2&gt;

&lt;p&gt;cp is used for copying files or directories from one location to another.&lt;/p&gt;

&lt;p&gt;The syntax for using this command is&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cp [source] [destination]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;This can be used to move a file into a folder or a folder into a folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  &amp;lt; rm &amp;gt;
&lt;/h2&gt;

&lt;p&gt;rm is used to remove files in a directory, although they cannot delete directories by default. But with some flags, they can delete directories as well.&lt;/p&gt;

&lt;p&gt;The syntax for the command is&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rm [flag] [file]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;you can remove multiple files consecutively.&lt;/p&gt;

&lt;p&gt;To delete directories, you will need to use &lt;code&gt;rm -rf folder1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This is mostly helpful if the folder has nested folders and files in them.&lt;/p&gt;

&lt;h2&gt;
  
  
  &amp;lt; rmdir &amp;gt;
&lt;/h2&gt;

&lt;p&gt;rmdir is similar to &lt;code&gt;rm -rf&lt;/code&gt; however, it can only remove directories that are empty.&lt;/p&gt;

&lt;p&gt;The syntax for this command is&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rmdir folder1&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  &amp;lt; grep &amp;gt;
&lt;/h2&gt;

&lt;p&gt;grep is globar regular expression print, which is used to search for a particular string or pattern in files.&lt;/p&gt;

&lt;p&gt;The syntax for this command is&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;grep [flag] [pattern] [file]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Example: &lt;code&gt;grep Username Records.txt&lt;/code&gt;&lt;br&gt;
can help find the line containing "Username" from the "Records.txt" file and output the line.&lt;/p&gt;
&lt;h2&gt;
  
  
  &amp;lt; package managers &amp;gt;
&lt;/h2&gt;

&lt;p&gt;There are different package managers based on what distro of linux you are using. Debian based distros use the &lt;code&gt;apt&lt;/code&gt; package manager whereas the Arch based distros use &lt;code&gt;pacman&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;These package managers are important as they allow you to install, uninstall, reinstall and update packages and software.&lt;/p&gt;

&lt;p&gt;The syntax for apt is&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt [command] [package_name]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Commonly used commands are &lt;code&gt;update&lt;/code&gt; to update a package, &lt;code&gt;install&lt;/code&gt; to install a package, &lt;code&gt;remove&lt;/code&gt; to uninstall and &lt;code&gt;search&lt;/code&gt; to look for that package in the software repositories.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo&lt;/code&gt; is added to the beginning of the command because making changes to the packages requires root level permissions.&lt;/p&gt;

&lt;p&gt;Entering &lt;code&gt;sudo apt update&lt;/code&gt; gave the following result:&lt;br&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%2Fm21ndpxjz50t3lkg1xcb.png" 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%2Fm21ndpxjz50t3lkg1xcb.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, the syntax for pacman is&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo pacman [flag] [package_name]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Here the flags most commonly used are &lt;br&gt;
&lt;code&gt;-S&lt;/code&gt; to install a package, &lt;code&gt;-Rs&lt;/code&gt; or &lt;code&gt;-R&lt;/code&gt; to remove a package with and without its dependencies respectively. &lt;br&gt;
&lt;code&gt;-Ss&lt;/code&gt; to look for a package from the repositories.&lt;br&gt;
&lt;code&gt;-Suy&lt;/code&gt; is a flag that is used without the package_name, and it is used to upgrade all the packages in your system.&lt;/p&gt;

&lt;p&gt;You can also install local or remote packages using &lt;code&gt;-U&lt;/code&gt; flag and including the path to the file in &lt;code&gt;[package_name]&lt;/code&gt; section.&lt;br&gt;
Make sure the file ends in &lt;code&gt;.pkg.tar.xz&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  So this brings you to a conclusion on the most commonly used linux commands, although they might seem daunting at first - by using them over time will make them seem like second nature!
&lt;/h2&gt;

</description>
      <category>linux</category>
      <category>beginners</category>
      <category>bash</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How To Use Font Awesome Icons in HTML</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Tue, 06 Dec 2022 09:20:23 +0000</pubDate>
      <link>https://dev.to/acesif/how-to-use-font-awesome-icons-in-html-4h92</link>
      <guid>https://dev.to/acesif/how-to-use-font-awesome-icons-in-html-4h92</guid>
      <description>&lt;p&gt;&lt;strong&gt;Icons have become a crucial element in Web Development and adding the appropriate icons to your Website could make or break the design.&lt;br&gt;
Font Awesome is an icon library that you can implement into your website straight from their website.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use Font Awesome Icons?
&lt;/h2&gt;




&lt;h3&gt;
  
  
  1. CDN Method
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Locate the link to font-awesome CDN by going to &lt;a href="https://cdnjs.com/libraries/font-awesome" rel="noopener noreferrer"&gt;this&lt;/a&gt; site.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Press on &lt;code&gt;&amp;lt;/&amp;gt;&lt;/code&gt; button next to the link that ends with &lt;code&gt;all.min.css&lt;/code&gt;&lt;br&gt;
Which will copy something like this onto your clipboard&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

&amp;lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css" integrity="sha512-XXXXX+y+XXXXX/XXXX==" crossorigin="anonymous" referrerpolicy="no-referrer" /&amp;gt;


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

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to your .html file where you're designing your webpage and paste the copied code within the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag.&lt;br&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%2Fgvxv8tp4nghtcve27ohz.png" 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%2Fgvxv8tp4nghtcve27ohz.png" alt="font-awesome CDN"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Find your desired icons from fontawesome.com or by directly going &lt;a href="https://fontawesome.com/icons" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Click on the icon to show its panel, which would look something like this:&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%2F2nr22z2ya2enzz9uvy87.png" 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%2F2nr22z2ya2enzz9uvy87.png" alt="Font-awesome_icon_panel"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Step 6&lt;/strong&gt;&lt;br&gt;
Click on the code snippet to copy it and paste it on the desired location of your webpage.&lt;br&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%2F75m6j19acwd5w19yh7bp.png" 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%2F75m6j19acwd5w19yh7bp.png" alt="Icon added"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Downloading the Icon Pack
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Step 1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to the download section of fontawesome.com and click on icon pack of your choice. I'll be using "Free for Web" for this tutorial.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A .zip file will be downloaded, which you have to unzip and place it in the same folder as your website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use the link tag in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; tag and locate the &lt;code&gt;css&lt;/code&gt; file containing the icon data.&lt;br&gt;
The directory would look something like this:&lt;br&gt;
&lt;code&gt;/fontawesome-free-x.x.x-web/css/all.css&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Find your desired icons from fontawesome.com or by directly going &lt;a href="https://fontawesome.com/icons" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Click on the icon to show its panel, which would look something like this:&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%2F2nr22z2ya2enzz9uvy87.png" 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%2F2nr22z2ya2enzz9uvy87.png" alt="Font-awesome_icon_panel"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Step 6&lt;/strong&gt;&lt;br&gt;
Click on the code snippet to copy it and paste it on the desired location of your webpage.&lt;br&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%2F75m6j19acwd5w19yh7bp.png" 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%2F75m6j19acwd5w19yh7bp.png" alt="Icon added"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Troubleshooting
&lt;/h3&gt;

&lt;p&gt;In case you notice &lt;strong&gt;square boxes&lt;/strong&gt; in the places where you put the icons, there are two probable reasons (as far as I know).&lt;/p&gt;

&lt;p&gt;One is due to the font family set onto that element or its parent element. &lt;br&gt;
Since font-awesome icons are treated as fonts, declaring a different font family would override it and the font-awesome icon cannot be found.&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%2F7btrue9xt6vfkj0g3cpg.png" 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%2F7btrue9xt6vfkj0g3cpg.png" alt="box issue 1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another reason could be the class declaration issue. For example, in&lt;br&gt;
&lt;code&gt;&amp;lt;i class="fa-solid fa-circle-info"&amp;gt;&amp;lt;/i&amp;gt;&lt;/code&gt;&lt;br&gt;
no class of &lt;code&gt;fa-solid&lt;/code&gt; may be found in the CDN. &lt;br&gt;
In that case, you can remove the &lt;code&gt;-solid&lt;/code&gt; to use the default version of the icon. &lt;br&gt;
The code snippet would look something like:&lt;br&gt;
&lt;code&gt;&amp;lt;i class="fa fa-circle-info"&amp;gt;&amp;lt;/i&amp;gt;&lt;/code&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>tutorial</category>
      <category>html</category>
      <category>beginners</category>
    </item>
    <item>
      <title>All the JS Array methods you need to know</title>
      <dc:creator>Asif Zubayer Palak</dc:creator>
      <pubDate>Sun, 09 Oct 2022 15:22:24 +0000</pubDate>
      <link>https://dev.to/acesif/all-the-js-array-methods-you-need-to-know-3kp9</link>
      <guid>https://dev.to/acesif/all-the-js-array-methods-you-need-to-know-3kp9</guid>
      <description>&lt;h3&gt;
  
  
  A method can be referred to as a shortcut for achieving results that you would otherwise have to write extensive code for.
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Arrays have a set of methods as well which can manipulate the array or the data inside it to cater to your needs.
&lt;/h4&gt;




&lt;h4&gt;
  
  
  Below are the methods this article covers:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Array Length&lt;/li&gt;
&lt;li&gt;Changing Elements in the Array&lt;/li&gt;
&lt;li&gt;Merging Arrays&lt;/li&gt;
&lt;li&gt;Array to String Conversion&lt;/li&gt;
&lt;li&gt;Popping out &amp;amp; pushing in values&lt;/li&gt;
&lt;li&gt;Shifting &amp;amp; Unshifting&lt;/li&gt;
&lt;li&gt;Splice &amp;amp; Slice&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Array Length
&lt;/h3&gt;

&lt;p&gt;This method returns the length of an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const pets = ["cat", "hamster", "dog", "rabbit"];
print(pets.length); // 4
console.log(pets[pets.length]); // rabbit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the array.length can be also used to get the last element in the array&lt;/p&gt;

&lt;h3&gt;
  
  
  Changing Elements in the Array
&lt;/h3&gt;

&lt;p&gt;Index number of an array can be used to address an element in the array and can be used to change elements as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const cats = ["molly", "polly", "kolly", "jolly"];
cats[0] = "perry";
console.log(cats); // ["perry", "polly", "kolly", "jolly"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Merging Arrays
&lt;/h3&gt;

&lt;p&gt;The concat() method creates a new array by merging other arrays.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const list_1 = ["one", "two"];
const list_2 = ["three", "four", "five"];

const lists = list_1.concat(list_2);
console.log(lists); // ["one", "two", "three", "four", "five"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Array to String Conversion
&lt;/h3&gt;

&lt;p&gt;If you want to convert an array to string, there are two methods that can achieve this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbers = [1,2,3,4,5];
console.log(numbers.toString()); // 1,2,3,4,5
console.log(numbers.join()); // 1,2,3,4,5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The array.join() method can modify the separator as well, such as: if you want the separator to be something else instead of ",", you can pass that symbol as the argument.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const numbers = [1,2,3,4,5];
console.log(numbers.join("-")); // 1-2-3-4-5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Popping out &amp;amp; pushing in values
&lt;/h3&gt;

&lt;p&gt;If you wish to add new elements to the end of the array or remove the last element of the array - using the push and pop methods are the most useful.&lt;br&gt;
To push an element to the end of an array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const list = [1,2,3,4];
list.push(5); // here 5 is the value
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should also know that &lt;code&gt;array.push(value)&lt;/code&gt; also returns the length of the newly updated array, so you can store it in a variable if you wish to use it later.&lt;/p&gt;

&lt;p&gt;If you wish to remove the last element from an array:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const list = [1,2,3,4];
list.pop(); // 4 removed from the array
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should also know that &lt;code&gt;array.pop()&lt;/code&gt; also returns the element that has been removed, you can store it in a variable if you wish to use it later.&lt;/p&gt;

&lt;h3&gt;
  
  
  Shifting &amp;amp; Unshifting
&lt;/h3&gt;

&lt;p&gt;Shifting and Unshifting is similar push and pop but mirrored out.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const list = [1,2,3,4];
list.shift(); // [2,3,4]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should know that &lt;code&gt;array.shift()&lt;/code&gt; also returns the element that has been removed, you can store it in a variable if you wish to use it later.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const list = [1,2,3,4];
list.unshift(0); // [0,1,2,3,4] 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should know that &lt;code&gt;array.unshift()&lt;/code&gt; also returns the updated array length, you can store it in a variable if you wish to use it later.&lt;/p&gt;

&lt;h3&gt;
  
  
  Splice &amp;amp; Slice
&lt;/h3&gt;

&lt;h4&gt;
  
  
  &lt;em&gt;Splice&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Splice is one of the methods of array which can be used to add, remove, replace elements.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const list = [1,2,3,4];
list.splice(x, y, value_1, value_2,....,..);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;x&lt;/strong&gt; defines the position where new elements should be added&lt;br&gt;
&lt;strong&gt;y&lt;/strong&gt; defines how many elements should be removed - to remove an element using &lt;code&gt;array.splice(index of element to remove, number of elements to remove)&lt;/code&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  &lt;em&gt;Slice&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Slice creates a new array with the elements from an existing array starting from a target index&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const list = [1,2,3,4];
const newList = list.slice(2);
console.log(newList); // [3,4]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  That brings us to the end of the few methods most commonly used in JavaScript
&lt;/h3&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
