<?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: Akash Yadav</title>
    <description>The latest articles on DEV Community by Akash Yadav (@akash32755).</description>
    <link>https://dev.to/akash32755</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%2F1279297%2F6b97d021-9c7a-41a7-8c24-1c14b8cbe2c8.png</url>
      <title>DEV Community: Akash Yadav</title>
      <link>https://dev.to/akash32755</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akash32755"/>
    <language>en</language>
    <item>
      <title>Types of Scope in JavaScript</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Mon, 12 Aug 2024 05:29:25 +0000</pubDate>
      <link>https://dev.to/akash32755/types-of-scope-in-javascript-2dln</link>
      <guid>https://dev.to/akash32755/types-of-scope-in-javascript-2dln</guid>
      <description>&lt;p&gt;&lt;strong&gt;1. Global Scope:&lt;/strong&gt;&lt;br&gt;
-&amp;gt; Variables or functions declared outside of any function or block have global scope.&lt;br&gt;
-&amp;gt; They can be accessed from anywhere in the code, including inside -&amp;gt; functions or blocks.&lt;br&gt;
-&amp;gt; Global variables can create issues, especially in large programs, as they are accessible everywhere and can be overwritten.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var globalVar = "I'm a global variable";

function displayGlobalVar() {
  console.log(globalVar); // Accessible here
}

displayGlobalVar(); // Output: I'm a global variable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Function Scope:&lt;/strong&gt;&lt;br&gt;
-&amp;gt; Variables declared within a function are scoped to that function.&lt;br&gt;
They are not accessible outside the function in which they are defined&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function myFunction() {
  var functionVar = "I'm a function variable";
  console.log(functionVar); // Accessible here
}

myFunction();
console.log(functionVar); // Error: functionVar is not defined
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-&amp;gt; In the example above, functionVar is not accessible outside of myFunction().&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Block Scope (introduced in ES6):&lt;/strong&gt;&lt;br&gt;
-&amp;gt; Variables declared using let and const are block-scoped.&lt;br&gt;
They are only accessible within the block (e.g., { }) in which they are defined.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (true) {
  let blockVar = "I'm a block variable";
  console.log(blockVar); // Accessible here
}

console.log(blockVar); // Error: blockVar is not defined

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

&lt;/div&gt;



&lt;p&gt;-&amp;gt; Variables declared with var, however, are not block-scoped; they are function-scoped.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if (true) {
  var notBlockVar = "I'm not block-scoped";
}

console.log(notBlockVar); // Output: I'm not block-scoped
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Lexical Scope:&lt;/strong&gt;&lt;br&gt;
-&amp;gt; Lexical scope (also known as static scope) refers to the fact that a function's scope is determined by where it is defined in the code, not where it is called.&lt;br&gt;
-&amp;gt; Inner functions have access to variables of outer functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function outerFunction() {
  var outerVar = "I'm an outer variable";

  function innerFunction() {
    console.log(outerVar); // Accessible here
  }

  innerFunction(); // Output: I'm an outer variable
}

outerFunction();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5. Closures:&lt;/strong&gt;&lt;br&gt;
-&amp;gt; A closure is a function that retains access to its lexical scope, even when the function is executed outside that scope.&lt;br&gt;
-&amp;gt; Closures allow a function to access variables from an outer function even after the outer function has returned.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function outerFunction() {
  var outerVar = "I'm an outer variable";

  return function innerFunction() {
    console.log(outerVar); // Still accessible here
  };
}

var closureFunction = outerFunction();
closureFunction(); // Output: I'm an outer variable
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;-&amp;gt; In the example above, innerFunction forms a closure that allows it to access outerVar even after outerFunction has finished executing.&lt;/p&gt;

&lt;p&gt;Summary:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Global Scope:&lt;/strong&gt; Accessible from anywhere in the code.&lt;/li&gt;
&lt;li&gt;**Function Scope: **Accessible only within the function where defined.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Block Scope:&lt;/strong&gt; Accessible only within the block where defined (let, const).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lexical Scope:&lt;/strong&gt; Functions have access to variables in the scope where they were defined.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Closures:&lt;/strong&gt; Functions that "remember" their lexical scope even after the outer function has finished.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;-&amp;gt; Understanding scope is crucial for managing variable lifetimes and ensuring that your code behaves as expected.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Setting Up Toast Custom Notifications in React with Specific Types and Context API</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Tue, 23 Jul 2024 07:47:50 +0000</pubDate>
      <link>https://dev.to/akash32755/setting-up-toast-custom-notifications-in-react-with-specific-types-and-context-api-40kg</link>
      <guid>https://dev.to/akash32755/setting-up-toast-custom-notifications-in-react-with-specific-types-and-context-api-40kg</guid>
      <description>&lt;h2&gt;
  
  
  Context Setup
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;src/context/ToastContext.js&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { createContext, useCallback, useContext, useEffect, useState } from "react";

const CreateAlertBox = createContext();

export const useCreateAlert = () =&amp;gt; useContext(CreateAlertBox);

const AlertType = ['error', 'success', 'info', 'warning'];

export const CreateAlertBoxProvider = ({ children }) =&amp;gt; {
    const [alert, setAlert] = useState([]);

    const createAlert = useCallback((message, type = 'warning') =&amp;gt; {
        if (!AlertType.includes(type)) return;

        setAlert((prevAlert) =&amp;gt; [
            ...prevAlert,
            { id: Date.now(), message, type }
        ])
    }, [])

    const removeAlert = useCallback((id) =&amp;gt; {
        setAlert((prevAlert) =&amp;gt; prevAlert.filter((alert) =&amp;gt; alert.id !== id));
    }, [])
    return (
        &amp;lt;CreateAlertBox.Provider value={{ createAlert, removeAlert }}&amp;gt;
            {children}
            &amp;lt;div className="toast-container"&amp;gt;
                {
                    alert.map((alert) =&amp;gt; (
                        &amp;lt;div key={alert.id} className={`toast toast-${alert.type}`}&amp;gt;
                            {alert.message}
                            &amp;lt;button onClick={() =&amp;gt; removeAlert(alert.id)}&amp;gt;X&amp;lt;/button&amp;gt;
                        &amp;lt;/div&amp;gt;
                    ))
                }
            &amp;lt;/div&amp;gt;
        &amp;lt;/CreateAlertBox.Provider&amp;gt;
    )
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  CSS for Toast Notifications
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;/* src/styles/toast.css */&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toast-info {
    background-color: #007bff;
}

.toast-success {
    background-color: #28a745;
}

.toast-warning {
    background-color: #ffc107;
}

.toast-error {
    background-color: #dc3545;
}

.toast button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    margin-left: 1rem;
}

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Providing the Toast Context
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;// src/main.js&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.jsx'
import './index.css'
import { RouterProvider } from 'react-router-dom'
import { router } from './router.jsx'
import { CreateAlertBoxProvider } from './context/toastcontext.jsx'

ReactDOM.createRoot(document.getElementById('root')).render(
  &amp;lt;React.StrictMode&amp;gt;
    &amp;lt;CreateAlertBoxProvider&amp;gt;
        &amp;lt;RouterProvider router={router}&amp;gt;
          &amp;lt;App /&amp;gt;
        &amp;lt;/RouterProvider&amp;gt;
    &amp;lt;/CreateAlertBoxProvider&amp;gt;
  &amp;lt;/React.StrictMode&amp;gt;,
)

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Using the Toast Context in Components
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import React, { useContext, useEffect } from 'react'
import { UserContext } from '../context/usercontext'
import { useCreateAlert } from '../context/toastcontext'

const Profile = () =&amp;gt; {
    const { user } = useContext(UserContext)

    const { createAlert } = useCreateAlert();

    const showToast = () =&amp;gt; {
        try {
            createAlert("Deal created successfully", 'success')

        } catch (error) {
            createAlert('This is an info toast!', 'error');
        }
    };


    return (
        &amp;lt;div className="App"&amp;gt;
            &amp;lt;p&amp;gt;Hello Profile&amp;lt;/p&amp;gt;
            &amp;lt;button onClick={showToast}&amp;gt;Show Toast&amp;lt;/button&amp;gt;
        &amp;lt;/div&amp;gt;
    )
}

export default Profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>alert</category>
      <category>toast</category>
    </item>
    <item>
      <title>ExpandableText Components</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Thu, 18 Jul 2024 07:53:19 +0000</pubDate>
      <link>https://dev.to/akash32755/expandabletext-components-3kn2</link>
      <guid>https://dev.to/akash32755/expandabletext-components-3kn2</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Typography } from "@mui/material";
import { useEffect, useRef, useState } from "react";

interface ExpandableTextProps {
    text: string;
    extendedText: string;
    numberOfLine: number;
}

const ExpandableText: React.FC&amp;lt;ExpandableTextProps&amp;gt; = ({ text, extendedText = "Description", numberOfLine = 3 }) =&amp;gt; {
    const [expanded, setExpanded] = useState(false);
    const [maxHeight, setMaxHeight] = useState&amp;lt;string | number&amp;gt;('none');
    const contentRef = useRef&amp;lt;HTMLDivElement&amp;gt;(null);

    useEffect(() =&amp;gt; {
        if (contentRef.current) {
            setMaxHeight(expanded ? contentRef.current.scrollHeight : `${numberOfLine * 1.5}em`);
        }
    }, [expanded, numberOfLine])

    const toggleExpand = () =&amp;gt; {
        setExpanded((prev) =&amp;gt; !prev);
    };

    return (
        &amp;lt;&amp;gt;
            &amp;lt;div
                ref={contentRef}
                style={{
                    overflow: 'hidden',
                    maxHeight: maxHeight,
                    transition: 'max-height 0.3s ease-in-out',
                }}
            &amp;gt;
                &amp;lt;Typography
                    component="p"
                    sx={{
                        fontSize: 12,
                        fontWeight: 700,
                        letterSpacing: 0.5,
                        display: '-webkit-box',
                        WebkitBoxOrient: 'vertical',
                        WebkitLineClamp: expanded ? 'unset' : numberOfLine,
                        textOverflow: 'ellipsis',
                        mt: 1,
                    }}
                &amp;gt;
                    {text}
                &amp;lt;/Typography&amp;gt;
            &amp;lt;/div&amp;gt;
            &amp;lt;span style={{ color: "blue", cursor: "pointer" }} onClick={toggleExpand}&amp;gt;
                {expanded ? `Collapse ${extendedText}` : `Expand ${extendedText}`}
            &amp;lt;/span&amp;gt;
        &amp;lt;/&amp;gt;
    );
};


export default ExpandableText;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>components</category>
      <category>webdev</category>
      <category>reactjsdevelopment</category>
    </item>
    <item>
      <title>Basic Linux Command used in Pentesting and Other Cyber Security Domains</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Sun, 16 Jun 2024 10:40:07 +0000</pubDate>
      <link>https://dev.to/akash32755/basic-linux-command-used-in-pentesting-and-other-cyber-security-domains-1kll</link>
      <guid>https://dev.to/akash32755/basic-linux-command-used-in-pentesting-and-other-cyber-security-domains-1kll</guid>
      <description>&lt;h2&gt;
  
  
  File Commands
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;cd&lt;/code&gt; - change directory&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pwd&lt;/code&gt; - print working directory&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ls&lt;/code&gt; - list files and directory&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mkdir&lt;/code&gt; - make n directories&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rm&lt;/code&gt; - remove (delete) a file or directory&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rmdir&lt;/code&gt; - remove (delete) an empty directory&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cp&lt;/code&gt; - copy a file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mv&lt;/code&gt; - move or rename a file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;touch&lt;/code&gt; - create a new empty file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;echo&lt;/code&gt; - write to a file&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  SSH Commands
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;ssh&lt;/code&gt; - connect to a remote host&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ssh-keygen&lt;/code&gt; - generate a new SSH key pair&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ssh-copy-id&lt;/code&gt; - copy SSH keys to a remote host&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ssh-config&lt;/code&gt; - configure SSH client settings&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ssh-agent&lt;/code&gt; - manage SSH keys for authentication&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Network Commands
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;ping&lt;/code&gt; - test network connectivity&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ifconfig&lt;/code&gt; - configure network interface&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ip&lt;/code&gt; - manage network interface and addresses&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;netstat&lt;/code&gt; - display network socket statistics&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ssh-tunnel&lt;/code&gt; - create a secure tunnel for network traffic&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;curl&lt;/code&gt; - transfer data from a URL&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;wget&lt;/code&gt; - download file from URL&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dig&lt;/code&gt; - perform DNS lookups&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nslookup&lt;/code&gt; - perform DNS lookups&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;route&lt;/code&gt; - manage network routes&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>linux</category>
      <category>command</category>
      <category>learning</category>
    </item>
    <item>
      <title>React Native Skeleton Loader Componen</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Thu, 09 May 2024 08:05:22 +0000</pubDate>
      <link>https://dev.to/akash32755/react-native-skeleton-loader-componen-3dko</link>
      <guid>https://dev.to/akash32755/react-native-skeleton-loader-componen-3dko</guid>
      <description>&lt;p&gt;This is a reusable React Native component for rendering skeleton loaders with customizable dimensions and animations. Skeleton loaders are placeholders used to provide a better user experience while loading content in an application. The component supports both animated and static skeletons, and it can measure the dimensions of a child component to render skeletons with the same dimensions. This component can be useful for improving the perceived performance of your React Native application.&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%2F7bbksa2vj1pa8tiim5nj.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%2F7bbksa2vj1pa8tiim5nj.png" alt="Image description"&gt;&lt;/a&gt;&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%2Fmkmtk930zzcrm8vycc3p.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%2Fmkmtk930zzcrm8vycc3p.png" alt="Image description"&gt;&lt;/a&gt;&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%2F8fskspq67ohj8iu4yk2j.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%2F8fskspq67ohj8iu4yk2j.png" alt="Image description"&gt;&lt;/a&gt;&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%2F9rga6hr45cw8gcyzgq3o.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%2F9rga6hr45cw8gcyzgq3o.png" alt="Image description"&gt;&lt;/a&gt;&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%2Fpa2rst83go3zy8bz1urs.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%2Fpa2rst83go3zy8bz1urs.png" alt="Image description"&gt;&lt;/a&gt;&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%2Faqa8disdqwz3hmf3hp7l.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%2Faqa8disdqwz3hmf3hp7l.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

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

import { useState } from "react";
import { Dimensions, View, Text, Platform } from "react-native"
import LinearGradient from "react-native-linear-gradient";
import colors from "../utils/constant/colors";
import Animated, { useAnimatedProps, useFrameCallback, useSharedValue, withTiming } from "react-native-reanimated";

interface SkeltonContainerProps {
    child: any;
    childcount?: any;
    width?: any;
    height?: any;
}

interface SkeletonProps {
    width: number;
    height: number;
    marginTop?: number;
}

const AnimatedLinearGradient = Animated.createAnimatedComponent(LinearGradient);

const SkeletonAnimated = ({ width, height, marginTop }: SkeletonProps) =&amp;gt; {
    const locationY = useSharedValue(0);

    useFrameCallback(() =&amp;gt; {
        if (locationY.value == 1) locationY.value = withTiming(0, { duration: 1000 });
        if (locationY.value == 0) locationY.value = withTiming(1, { duration: 1000 });
    });

    const animatedProps = useAnimatedProps(() =&amp;gt; {
        return { locations: [0, locationY.value] }
    })

    return (
        &amp;lt;AnimatedLinearGradient colors={[colors.LightGray, colors.White]} animatedProps={animatedProps} style={{ width: width, height: height, marginTop: marginTop }} /&amp;gt;
    )
}

const SkeletonStatic = ({ width, height, marginTop }: SkeletonProps) =&amp;gt; {
    return (
        &amp;lt;LinearGradient colors={[colors.LightGray, colors.White]} style={{ width: width, height: height, marginTop: marginTop }} /&amp;gt;
    )
}

const Skeleton = ({ width = Dimensions.get('window').width, height = 200, marginTop = 0 }: SkeletonProps) =&amp;gt; {
    return (
        Platform.OS == 'ios' ?
            &amp;lt;SkeletonAnimated width={width} height={height} marginTop={marginTop} /&amp;gt; :
            &amp;lt;SkeletonStatic width={width} height={height} marginTop={marginTop} /&amp;gt;
    )
}


const SkeletonContainer = ({ child, childcount = 1, width = Dimensions.get('window').width, height = 64 }: SkeltonContainerProps) =&amp;gt; {
    const [dimensions, setDimensions] = useState({ width: 0, height: 0 })
    return (
        child ?
            &amp;lt;View&amp;gt;
                &amp;lt;View style={{ opacity: 0 }} onLayout={(event) =&amp;gt; setDimensions({ width: event.nativeEvent.layout.width, height: event.nativeEvent.layout.height })}&amp;gt;{child}&amp;lt;/View&amp;gt;
                &amp;lt;Skeleton width={dimensions.width} height={dimensions.height} marginTop={-dimensions.height} /&amp;gt;
                {[...Array(childcount - 1).keys()].map((index) =&amp;gt; &amp;lt;Skeleton key={index} width={dimensions.width} height={dimensions.height} /&amp;gt;)}
            &amp;lt;/View&amp;gt; :
            [...Array(childcount).keys()].map((index) =&amp;gt; &amp;lt;Skeleton key={index} width={width} height={height} /&amp;gt;)
    )
}

export default SkeletonContainer;


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

&lt;/div&gt;

</description>
      <category>javascript</category>
      <category>reactnative</category>
      <category>development</category>
      <category>learning</category>
    </item>
    <item>
      <title>Clean code Tips</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Fri, 03 May 2024 05:08:17 +0000</pubDate>
      <link>https://dev.to/akash32755/clean-code-tips-4b7e</link>
      <guid>https://dev.to/akash32755/clean-code-tips-4b7e</guid>
      <description>&lt;p&gt;This approach helps in writing cleaner and more readable code for conditional rendering without using curly braces directly.&lt;/p&gt;

&lt;p&gt;In this code, the Choice object provides two components: When and Then. The When component renders its children if the provided condition is true. On the other hand, the Then component renders its children if the condition is false. This approach helps in writing cleaner and more readable code for conditional rendering without using curly braces directly.&lt;/p&gt;

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

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

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

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>react</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Vim Navigation</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Sat, 30 Mar 2024 12:35:11 +0000</pubDate>
      <link>https://dev.to/akash32755/vim-navigation-5dbp</link>
      <guid>https://dev.to/akash32755/vim-navigation-5dbp</guid>
      <description>&lt;p&gt;Navigation:&lt;br&gt;
h: Move cursor left.&lt;br&gt;
j: Move cursor down.&lt;br&gt;
k: Move cursor up.&lt;br&gt;
l: Move cursor right.&lt;br&gt;
gg: Move to the first line of the file.&lt;br&gt;
G: Move to the last line of the file.&lt;br&gt;
Ctrl + b: Move one page up.&lt;br&gt;
Ctrl + f: Move one page down.&lt;br&gt;
0: Move to the beginning of the line.&lt;br&gt;
$: Move to the end of the line.&lt;br&gt;
w: Move forward one word.&lt;br&gt;
b: Move backward one word.&lt;br&gt;
Editing:&lt;br&gt;
i: Enter insert mode before the cursor.&lt;br&gt;
I: Enter insert mode at the beginning of the line.&lt;br&gt;
a: Enter insert mode after the cursor.&lt;br&gt;
A: Enter insert mode at the end of the line.&lt;br&gt;
o: Open a new line below the current line.&lt;br&gt;
O: Open a new line above the current line.&lt;br&gt;
x: Delete the character under the cursor.&lt;br&gt;
dd: Delete the current line.&lt;br&gt;
yy: Yank (copy) the current line.&lt;br&gt;
p: Paste the yanked or deleted text after the cursor.&lt;br&gt;
u: Undo the last change.&lt;br&gt;
Ctrl + r: Redo the last undone change.&lt;br&gt;
.: Repeat the last change.&lt;br&gt;
Saving and Exiting:&lt;br&gt;
:w: Write (save) the file.&lt;br&gt;
:q: Quit Vim.&lt;br&gt;
:q!: Quit Vim without saving changes.&lt;br&gt;
:wq: Write the file and quit Vim.&lt;br&gt;
:wq!: Write the file and quit Vim, overriding read-only mode if necessary.&lt;br&gt;
Searching and Replacing:&lt;br&gt;
/pattern: Search for a pattern.&lt;br&gt;
n: Move to the next occurrence of the search pattern.&lt;br&gt;
N: Move to the previous occurrence of the search pattern.&lt;br&gt;
:%s/old/new/g: Replace all occurrences of "old" with "new" in the entire file.&lt;br&gt;
Miscellaneous:&lt;br&gt;
:help: Open the help documentation.&lt;br&gt;
:set number: Display line numbers.&lt;br&gt;
:set nonumber: Hide line numbers.&lt;br&gt;
:syntax on: Enable syntax highlighting.&lt;br&gt;
:syntax off: Disable syntax highlighting.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>JS Trick Questtions</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Mon, 04 Mar 2024 17:54:28 +0000</pubDate>
      <link>https://dev.to/akash32755/js-trick-questtions-406c</link>
      <guid>https://dev.to/akash32755/js-trick-questtions-406c</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const obj = {a: 1, b: 2}
const val1 = obj.c;
const val2 = obj.c || "default"; // fallback
console.log(val1)
console.log(val2)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>javascript</category>
      <category>programming</category>
      <category>react</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Git Commands</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Sat, 02 Mar 2024 13:56:13 +0000</pubDate>
      <link>https://dev.to/akash32755/git-commands-40be</link>
      <guid>https://dev.to/akash32755/git-commands-40be</guid>
      <description>&lt;p&gt;&lt;strong&gt;Git Commands: Set Remote and Related Operations&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Setting Up a Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git remote add origin &amp;lt;remote_repository_url&amp;gt;&lt;/code&gt;: Sets up a remote repository with the specified URL as the origin.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Listing Remote Repositories&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git remote -v&lt;/code&gt;: Lists all remote repositories along with their URLs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Renaming a Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git remote rename &amp;lt;old_name&amp;gt; &amp;lt;new_name&amp;gt;&lt;/code&gt;: Renames a remote repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Changing the URL of a Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git remote set-url origin &amp;lt;new_repository_url&amp;gt;&lt;/code&gt;: Changes the URL of the remote repository named 'origin'.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Removing a Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git remote remove &amp;lt;remote_name&amp;gt;&lt;/code&gt;: Removes the remote repository specified by the name.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pushing Changes to a Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git push &amp;lt;remote_name&amp;gt; &amp;lt;branch_name&amp;gt;&lt;/code&gt;: Pushes changes from the local branch to the remote repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pushing Changes to a New Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git push -u origin &amp;lt;branch_name&amp;gt;&lt;/code&gt;: Pushes changes to a new remote repository and sets it as the default upstream.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Fetching Changes from a Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git fetch &amp;lt;remote_name&amp;gt;&lt;/code&gt;: Fetches changes from the remote repository without merging them into the local branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pulling Changes from a Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git pull &amp;lt;remote_name&amp;gt; &amp;lt;branch_name&amp;gt;&lt;/code&gt;: Fetches changes from the remote repository and merges them into the current branch.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cloning a Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git clone &amp;lt;remote_repository_url&amp;gt;&lt;/code&gt;: Clones a remote repository to the local machine.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Viewing Remote Details&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git remote show &amp;lt;remote_name&amp;gt;&lt;/code&gt;: Displays detailed information about the specified remote repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Verifying Remote Connectivity&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git remote -v&lt;/code&gt;: Verifies the connectivity with the remote repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Creating a New Branch on the Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git push &amp;lt;remote_name&amp;gt; &amp;lt;local_branch_name&amp;gt;:&amp;lt;remote_branch_name&amp;gt;&lt;/code&gt;: Creates a new branch on the remote repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Deleting a Branch on the Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git push &amp;lt;remote_name&amp;gt; --delete &amp;lt;branch_name&amp;gt;&lt;/code&gt;: Deletes the specified branch from the remote repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pushing Tags to the Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git push &amp;lt;remote_name&amp;gt; --tags&lt;/code&gt;: Pushes tags to the remote repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Pushing Changes with Force to Remote Repository&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git push --force &amp;lt;remote_name&amp;gt; &amp;lt;branch_name&amp;gt;&lt;/code&gt;: Forces the push of local changes to the remote repository, potentially overwriting changes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These commands allow you to manage remote repositories in Git, including setting up, renaming, removing, and interacting with remote repositories for collaboration and version control. Use them to effectively work with remote repositories in your Git projects.&lt;/p&gt;

</description>
      <category>git</category>
      <category>commands</category>
      <category>beginners</category>
      <category>programmers</category>
    </item>
    <item>
      <title>Nano commands for mac and other</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Sat, 02 Mar 2024 05:49:51 +0000</pubDate>
      <link>https://dev.to/akash32755/nano-commands-for-mac-and-other-3c6j</link>
      <guid>https://dev.to/akash32755/nano-commands-for-mac-and-other-3c6j</guid>
      <description>&lt;p&gt;Here are some common Nano commands used in the Nano text editor:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Open/Create a File&lt;/strong&gt;: &lt;code&gt;nano filename&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Opens an existing file or creates a new file with the specified filename.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Save File&lt;/strong&gt;: &lt;code&gt;Ctrl + O&lt;/code&gt; (WriteOut)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Saves the changes made to the current file.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Exit Nano&lt;/strong&gt;: &lt;code&gt;Ctrl + X&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exits the Nano editor. If there are unsaved changes, Nano will prompt to save before exiting.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cursor Movement&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arrow keys: Move the cursor up, down, left, or right.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + F&lt;/code&gt;: Move cursor forward one character.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + B&lt;/code&gt;: Move cursor backward one character.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + P&lt;/code&gt;: Move cursor to the previous line.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + N&lt;/code&gt;: Move cursor to the next line.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + A&lt;/code&gt;: Move cursor to the beginning of the current line.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + E&lt;/code&gt;: Move cursor to the end of the current line.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + \&lt;/code&gt;: Move cursor to a specific line number.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Search and Replace&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + W&lt;/code&gt;: Search for text.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Alt + W&lt;/code&gt;: Repeat search in the opposite direction.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + \&lt;/code&gt;: Replace text.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cut, Copy, and Paste&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + K&lt;/code&gt;: Cut the current line.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + U&lt;/code&gt;: Paste the cut text.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + Shift + 6&lt;/code&gt;: Copy the selected text.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + Shift + U&lt;/code&gt;: Paste the copied text.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Undo and Redo&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + _&lt;/code&gt; or &lt;code&gt;Ctrl + Shift + 6&lt;/code&gt;: Undo the last change.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Alt + _&lt;/code&gt;: Redo the last undone change.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Mark Text&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + ^&lt;/code&gt;: Start marking text.&lt;/li&gt;
&lt;li&gt;Arrow keys: Move the cursor to select text.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Alt + ^&lt;/code&gt;: End marking text.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Other Commands&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + G&lt;/code&gt;: Display Nano's help menu.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + C&lt;/code&gt;: Display current line and column number.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + R&lt;/code&gt;: Read another file into the current one.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Ctrl + T&lt;/code&gt;: Invoke spell checker.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These are some of the basic Nano commands. Nano also provides many other features and functionalities, which you can explore further in its documentation or help menu (&lt;code&gt;Ctrl + G&lt;/code&gt;).&lt;/p&gt;

</description>
    </item>
    <item>
      <title>React Native Assignment</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Sat, 02 Mar 2024 05:46:37 +0000</pubDate>
      <link>https://dev.to/akash32755/react-native-assignment-oc5</link>
      <guid>https://dev.to/akash32755/react-native-assignment-oc5</guid>
      <description>&lt;ol&gt;
&lt;li&gt;React Native Project: Recipe App Objective:
Develop a recipe application using React Native, allowing users to browse, search, and save recipes.
Task:
Build a mobile application that fetches recipes from a mock API and displays them to users. Users should be able to search for recipes by name or category, view recipe details, and save their favorite recipes for later reference.
Technology Stack:&lt;/li&gt;
&lt;li&gt;React Native for building the mobile application.&lt;/li&gt;
&lt;li&gt;Mock API or or data source for fetching recipe data.&lt;/li&gt;
&lt;li&gt;TheMealDb Api: &lt;a href="https://www.themealdb.com/api.php"&gt;https://www.themealdb.com/api.php&lt;/a&gt;
Requirements:&lt;/li&gt;
&lt;li&gt;User Interface:&lt;/li&gt;
&lt;li&gt;Design an attractive and user-friendly interface for browsing recipes.&lt;/li&gt;
&lt;li&gt;Include screens for displaying recipe categories, search results, and individual recipe details.&lt;/li&gt;
&lt;li&gt;Implement navigation between different screens using React Navigation. 2. Recipe Features:&lt;/li&gt;
&lt;li&gt;Fetch recipe data from a mock API or data source.&lt;/li&gt;
&lt;li&gt;Allow users to search for recipes by name or category.&lt;/li&gt;
&lt;li&gt;Display recipe details including ingredients, instructions, and images.&lt;/li&gt;
&lt;li&gt;Save Favorites:&lt;/li&gt;
&lt;li&gt;Enable users to save their favorite recipes for quick access. - Implement a feature to view and manage saved recipes.&lt;/li&gt;
&lt;li&gt;Documentation:&lt;/li&gt;
&lt;li&gt;Provide comprehensive documentation in the README file, explaining how to set up and run the application, and any additional information about the project structure or dependencies.
Submission:
Submit your code repository on GitHub, along with the README file containing setup instructions and project details.&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Axios Request Package</title>
      <dc:creator>Akash Yadav</dc:creator>
      <pubDate>Sat, 02 Mar 2024 03:08:00 +0000</pubDate>
      <link>https://dev.to/akash32755/axios-request-package-1pmf</link>
      <guid>https://dev.to/akash32755/axios-request-package-1pmf</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import AsyncStorage from '@react-native-async-storage/async-storage';
import NetInfo from "@react-native-community/netinfo";
import axios from "axios";
import { DeviceEventEmitter } from 'react-native';

const BASE_URL = {
    DEV: 'https://api.worldref.dev/dealx/rest/api/v1/',
    PROD: 'https://wr19dlx8r7nkmq1p6x.worldref.dev/dealx/rest/api/v1/'
}

const instance = axios.create({
    baseURL: BASE_URL.DEV,
    timeout: 60 * 1000,
});

instance.interceptors.response.use(async (response) =&amp;gt; {
    return response;
}, async (error) =&amp;gt; {
    if (error.status === 401 || error.response &amp;amp;&amp;amp; error.response.status === 401) {
        DeviceEventEmitter.emit('logout');
        return;
    }

    return Promise.reject(error.response ? error.response.data : error);
});

const SetHeader = (key, value) =&amp;gt; {
    instance.defaults.headers.common[key] = value;
}

const RemoveHeader = (key) =&amp;gt; {
    delete instance.defaults.headers.common[key];
}

const StoreCache = async (key, value) =&amp;gt; {
    try {
        await AsyncStorage.setItem(key, JSON.stringify(value));
    }
    catch (error) {
        return error;
    }
};

const GetCache = async key =&amp;gt; {
    try {
        const value = await AsyncStorage.getItem(key);
        const item = JSON.parse(value);

        if (!item) return null;

        return item;
    }
    catch (error) {
        return error;
    }
};

const ResponseEncodings = {
    JSON: 'json',
    Stream: 'blob',
}

const RequestContentType = {
    JSON: 'application/json',
    FormData: 'multipart/form-data',
}

const Request = async (method, url, body, nocache = false, responseType = ResponseEncodings.JSON, requestContentType = RequestContentType.JSON) =&amp;gt; {
    const requestOptions = {
        method: method,
        url: url,
        data: body,
        responseType: responseType,
        headers: { 'Content-Type': requestContentType }
    };

    try {
        const connected = await NetInfo.fetch();

        if (!connected.isConnected) {
            if (method === 'GET' &amp;amp;&amp;amp; !nocache) {
                const cached = await GetCache(url);
                if (cached) return cached;
            }

            throw new Error("Please check your internet connection");
        }

        const response = await instance.request(requestOptions);
        if (method === 'GET' &amp;amp;&amp;amp; !nocache) StoreCache(url, response);

        return response;
    }
    catch (error) {
        throw error;
    }
}

export { Request, ResponseEncodings, RequestContentType, SetHeader, RemoveHeader };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import AsyncStorage from '@react-native-async-storage/async-storage';
import NetInfo from "@react-native-community/netinfo";
import axios from "axios";
import { DeviceEventEmitter } from 'react-native';
import { RefreshToken } from './models/auth';

const BASE_URL = {
    DEV: 'https://api.worldref.dev/dealx/rest/api/v1/',
    PROD: 'https://wr19dlx8r7nkmq1p6x.worldref.dev/dealx/rest/api/v1/'
}

const instance = axios.create({
    baseURL: BASE_URL.DEV,
    timeout: 60 * 1000,
});

const shouldRefreshToken = (error) =&amp;gt; {
    return (error.status === 401 || error.response.status === 401)
        &amp;amp;&amp;amp; !error.config.url.includes('login');
}

const getErrorTextFromErrorObject = (error) =&amp;gt; {
    if (error.response) {
        if (typeof error.response.data === 'string') return error.response.data;
        if (typeof error.response.data.error === 'string') return error.response.data.error;
    }

    if (error.data) {
        if (typeof error.data === 'string') return error.data;
        if (typeof error.data.error === 'string') return error.data.error;
    }

    if (typeof error === 'string') return error;
    return 'Something went wrong';
}

instance.interceptors.response.use(async (response) =&amp;gt; {
    return response;
}, async (error) =&amp;gt; {
    if (shouldRefreshToken(error)) {
        try {
            if (error.config.url.includes('refreshtoken')) throw error;

            await RefreshToken();
            return instance.request(error.config);
        }
        catch (error) {
            DeviceEventEmitter.emit('logout');
            return;
        }
    }

    return Promise.reject(getErrorTextFromErrorObject(error));
});

const SetHeader = (key, value) =&amp;gt; {
    instance.defaults.headers.common[key] = value;
}

const RemoveHeader = (key) =&amp;gt; {
    delete instance.defaults.headers.common[key];
}

const StoreCache = async (key, value) =&amp;gt; {
    try {
        await AsyncStorage.setItem(key, JSON.stringify(value));
    }
    catch (error) {
        return error;
    }
};

const GetCache = async (key) =&amp;gt; {
    try {
        const value = await AsyncStorage.getItem(key);
        const item = JSON.parse(value);

        if (!item) return null;

        return item;
    }
    catch (error) {
        return error;
    }
};

const ResponseEncodings = {
    JSON: 'json',
    Stream: 'blob',
}

const RequestContentType = {
    JSON: 'application/json',
    FormData: 'multipart/form-data',
}

const Request = async (method, url, body, nocache = false, responseType = ResponseEncodings.JSON, requestContentType = RequestContentType.JSON) =&amp;gt; {
    const requestOptions = {
        method: method,
        url: url,
        data: body,
        responseType: responseType,
        headers: { 'Content-Type': requestContentType }
    };

    try {
        const connected = await NetInfo.fetch();

        if (!connected.isConnected) {
            if (method === 'GET' &amp;amp;&amp;amp; !nocache) {
                const cached = await GetCache(url);
                if (cached) return cached;
            }

            throw new Error("Please check your internet connection");
        }

        const response = await instance.request(requestOptions);
        if (method === 'GET' &amp;amp;&amp;amp; !nocache) StoreCache(url, response);

        return response;
    }
    catch (error) {
        throw error;
    }
}

export { Request, ResponseEncodings, RequestContentType, SetHeader, RemoveHeader };
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
