Snippets Collections
Дано трехзначное число. Найдите сумму его цифр.
n = int(input())
a = n // 100
b = n // 10 % 10
c = n % 10
print(a + b + c)

Как найти число десятков в числе python
n = int(input())
print(n // 10 % 10)
      
      Последнее число
      a = int(input())
print(a % 10)

Парты
a = int(input())
b = int(input())
c = int(input())
print(a // 2 + b // 2 + c // 2 + a % 2 + b % 2 + c % 2)
      Дано положительное действительное число X. Выведите его дробную часть.

      x = float(input())
print(x - int(x))

X = float(input())
Y = int(X)
print(X - Y)

 Выведите его первую цифру после десятичной точки.
x = float(input())
print(int(x * 10) % 10)

print(str(float(input()) % 1)[2])
import React from "react";

function Pagination({ currentPage, totalPages, onPageChange }) {
  const getPageNumbers = () => {
    const pageNumbers = [];
    const visiblePages = 5; // Number of visible page links

    if (totalPages <= visiblePages) {
      // If the total number of pages is less than or equal to the visible pages,
      // show all page links
      for (let i = 1; i <= totalPages; i++) {
        pageNumbers.push(i);
      }
    } else {
      // If the total number of pages is greater than the visible pages,
      // calculate the range of page links to display based on the current page

      let startPage = currentPage - Math.floor(visiblePages / 2);
      let endPage = currentPage + Math.floor(visiblePages / 2);

      if (startPage < 1) {
        // Adjust the start and end page numbers if they go below 1 or above the total pages
        endPage += Math.abs(startPage) + 1;
        startPage = 1;
      }

      if (endPage > totalPages) {
        // Adjust the start and end page numbers if they go above the total pages
        startPage -= endPage - totalPages;
        endPage = totalPages;
      }

      for (let i = startPage; i <= endPage; i++) {
        pageNumbers.push(i);
      }
    }

    return pageNumbers;
  };

  return (
    <nav>
      <ul className="pagination">
        <li className={`page-item ${currentPage === 1 ? "disabled" : ""}`}>
          <span className="page-link" onClick={() => onPageChange(currentPage - 1)}>
            Previous
          </span>
        </li>
        {getPageNumbers().map((pageNumber) => (
          <li
            key={pageNumber}
            className={`page-item ${pageNumber === currentPage ? "active" : ""}`}
          >
            <span className="page-link" onClick={() => onPageChange(pageNumber)}>
              {pageNumber}
            </span>
          </li>
        ))}
        <li className={`page-item ${currentPage === totalPages ? "disabled" : ""}`}>
          <span className="page-link" onClick={() => onPageChange(currentPage + 1)}>
            Next
          </span>
        </li>
      </ul>
    </nav>
  );
}

export default Pagination;


import { useState, useEffect } from "react";
import axios from "axios";
import Headers from "./parcelView/Headers";
import Sidebar from "./parcelView/sidebar";
import { Helmet } from "react-helmet-async";
import "./parcelView/admin.css";
import { RiFileEditFill } from "react-icons/ri";
import { NavLink } from "react-router-dom";
import Pagination from "../component/Pagination";
import { API_URL } from "../API/config";

function Designation() {
  const [products, setProduct] = useState([0]);
  const [currentPage, setCurrentPage] = useState(1);
  const [perPage, setPerPage] = useState(10);

  const totalPages = Math.ceil(products.length / perPage);

  const startIndex = (currentPage - 1) * perPage;
  const endIndex = startIndex + perPage - 1;

  const handlePageChange = (pageNumber) => {
     if (pageNumber >= 1 && pageNumber <= totalPages) {
      setCurrentPage(pageNumber);
    }
  };

  const getProfile = async () => {
    await axios
      .get(`${API_URL.designation.get}`)
      .then(function (response) {
        // handle success
        console.log(response.data.data);
        setProduct(response.data.data);
      })
      .catch(function (error) {
        // handle error
        console.log(error);
      });
  };

  useEffect(() => {
    getProfile();
  }, []);

  return (
    <>
      <Helmet>
        <title> Designation</title>
      </Helmet>
      <div className="wrapper ">
        <Headers />

        <Sidebar />
        <div className="content-wrapper" style={{ backgroundColor: "white" }}>
          <section className="content-header">
            <div className="container-fluid">
              <div className="row mb-2">
                <div className="col-sm-6">
                  <h1>Designation</h1>
                </div>
              </div>
            </div>
          </section>

          <section className="content">
            <div className="container-fluid">
              <div className="row">
                <div className="col-12">
                  <div className="card">
                    <div className="card-header">
                      <NavLink
                        to="/designation/add"
                        className="btn btn-primary"
                      >
                        Add Designation
                      </NavLink>
                    </div>
                    {/* /.card-header */}
                    <div className="card-body">
                      <table
                        id="example2"
                        className="table table-bordered table-hover"
                      >
                        <thead>
                          <tr>
                            <th></th>
                            <th>DesignationName</th>
                          </tr>
                        </thead>
                        <tbody>
                          {products
                            .slice(startIndex, endIndex + 1)
                            .map((item, index) => (
                              <tr key={index}>
                                <td className="">
                                  <NavLink to="/designation/update">
                                    <RiFileEditFill />
                                  </NavLink>
                                </td>
                                <td className="">{item.DesignationName}</td>
                              </tr>
                            ))}
                        </tbody>
                      </table>
                      <div className="entries-range d-flex justify-content-between mt-2">
                        <div>
                          Showing {startIndex + 1} to{" "}
                          {Math.min(endIndex + 1, products.length)} of{" "}
                          {products.length} entries
                        </div>
                        <div>
                          <Pagination
                            currentPage={currentPage}
                            totalPages={totalPages}
                            onPageChange={handlePageChange}
                          />
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </section>
        </div>
      </div>
    </>
  );
}

export default Designation;



import { toast } from "react-toastify";

export const validatePassword = (password, NewPassword) => {
  if (!password) {
    toast.error("Password is required");
    // return;
  } else if (password.length < 8) {
    toast.error("Password must be at least 8 characters long");
    return false;
  } else if (!/(?=.*[a-z])/.test(password)) {
    toast.error("Password must contain at least one lowercase letter");
    return false;
  } else if (!/(?=.*[A-Z])/.test(password)) {
    toast.error("Password must contain at least one uppercase letter");
    return false;
  } else if (!/(?=.*\d)/.test(password)) {
    toast.error("Password must contain at least one digit");
    return false;
  } else if (!/(?=.*[!@#$%^&*])/.test(password)) {
    toast.error("Password must contain at least one special character");
    return false;
  } else if (/\s/.test(password)) {
    toast.error("Password cannot contain whitespace");
    return false;
  }
  if (!NewPassword) {
    toast.error("Confirmpassword is required");
    return false;
  } else if (password != NewPassword) {
    toast.error("Passwords do not match.");
    return false;
  }

  return true;
};

export const validateLogin = (credentials, password) => {
  if (credentials == "") {
    toast.error("UserName is required...........");
    return false;
  } else if (!password) {
    toast.error("Password is required");
    return false;
  } else if (!/(?=.*[a-z])/.test(password)) {
    toast.error("Password must contain at least one lowercase letter");
    return false;
  } else if (!/(?=.*[A-Z])/.test(password)) {
    toast.error("Password must contain at least one uppercase letter");
    return false;
  }
  else if (!/(?=.*\d)/.test(password)) {
    toast.error("Password must contain at least one digit");
    return false;
  } else if (!/(?=.*[!@#$%^&*])/.test(password)) {
    toast.error("Password must contain at least one special character");
    return false;
  } else if (password.length < 8) {
    toast.error("Password must be at least 8 characters long");
    return false;
  } else if (/\s/.test(password)) {
    toast.error("Password cannot contain whitespace");
    return false;
  }
  return true;
};

export const UserForm = (credentials, password) => {
  if (credentials == "") {
    toast.error("UserName is required...........");
    return false;
  } else if (!password) {
    toast.error("Password is required");
    return false;
  } else if (!/(?=.*[a-z])/.test(password)) {
    toast.error("Password must contain at least one lowercase letter");
    return false;
  } else if (!/(?=.*[A-Z])/.test(password)) {
    toast.error("Password must contain at least one uppercase letter");
    return false;
  }
  else if (!/(?=.*\d)/.test(password)) {
    toast.error("Password must contain at least one digit");
    return false;
  } else if (!/(?=.*[!@#$%^&*])/.test(password)) {
    toast.error("Password must contain at least one special character");
    return false;
  } else if (password.length < 8) {
    toast.error("Password must be at least 8 characters long");
    return false;
  } else if (/\s/.test(password)) {
    toast.error("Password cannot contain whitespace");
    return false;
  }
  return true;
};


import React, { useState, useEffect } from "react";
import Header from "./Header";
import "./login.css";
import { Link } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import { toast } from "react-toastify";
import axios from "axios";
import { API_URL } from "../../API/config";
import { validateLogin } from "../../component/Validation";

const Loginform = () => {
  const navigate = useNavigate();
  const [user, setUser] = useState({
    credentials: "",
    password: "",
  });

  let name, value;

  const handleinput = (e) => {
    name = e.target.name;
    value = e.target.value;
    setUser({ ...user, [name]: value });
  };

  const SubmitData = async (e) => {
    e.preventDefault();
    const isValidLogin = validateLogin(user.credentials, user.password);
    if (!isValidLogin) {
      toast.error(isValidLogin);
    } else {
      try {
        await axios
          .post(`${API_URL.auth.login}`, user)

          .then((response) => {
            console.log(response.data);
            toast.success(response.data.message);
            localStorage.setItem("Token", response.data.success[1]);

            navigate("/dashboard");
          });
      } catch (error) {
        if (error.response) {
          const { status, data } = error.response;
          console.log(status, data);

          if (data.error && data.error.length > 0) {
            data.error.forEach((errorMessage) => {
              toast.error(errorMessage);
            });
          } else {
            toast.error(error.response.data);
          }
        }
      }
    }
  };

  return (
    <>
      <div
        style={{
          width: "100%",
          backgroundColor: "hsl(0, 0%, 96%)",
          position: "absolute",
          zIndex: "1",
        }}
      >
        <Header />
      </div>

      <section className=" position-relative">
        <div className="px-4 py-5 px-md-5 text-center text-lg-start ">
          <div className="">
            <div
              className="row align-items-top "
              style={{
                marginLeft: "10px",
                marginRight: "10px",
                marginTop: "90px",
              }}
            >
              <div className="col-lg-6 col-md-6 mb-5 mb-lg-0">
                <h1 className="my-5 display-4 fw-bold ls-tight ">
                  The best offer <br />
                  <span className="text-primary">for your business</span>
                </h1>
                <p
                  style={{ color: "hsl(217, 10%, 50.8%)" }}
                  className="text-left"
                >
                  Lorem ipsum dolor sit amet consectetur adipisicing elit.
                  Eveniet, itaque accusantium odio, soluta, corrupti aliquam
                  quibusdam tempora at cupiditate quis eum maiores libero
                  veritatis? Dicta facilis sint aliquid ipsum atque?
                </p>
              </div>
              <div className="col-lg-6 col-md-6 mb-5 mb-lg-0 d-flex justify-content-center">
                <div className="card" style={{ width: "400px" }}>
                  <div className="card-body py-4 px-md-4">
                    <form method="POST">
                      <div className="form-outline mb-2">
                        <label
                          className="form-label  d-flex justify-content-start"
                          htmlFor="form3Example4"
                        >
                          User Name
                        </label>
                        <input
                          type="text"
                          id="credentials"
                          className="form-control"
                          name="credentials"
                          placeholder="enter your Username"
                          autoComplete="off"
                          value={user.credentials}
                          onChange={handleinput}
                        />
                      </div>

                      <div className="form-outline mb-4">
                        <label
                          className="form-label d-flex justify-content-start"
                          htmlFor="form3Example4"
                        >
                          Password
                        </label>
                        <input
                          type="password"
                          id="password"
                          className="form-control"
                          name="password"
                          minLength={8}
                          maxLength={15}
                          placeholder="enter your Password"
                          autoComplete="off"
                          value={user.password}
                          onChange={handleinput}
                        />{" "}
                      </div>
                      <div className="col text-start mb-3 mt-0 ">
                        <Link to="/forgotpassword">Forgot password?</Link>
                      </div>
                      <button
                        type="submit"
                        className="btn btn-primary  mb-2 d-flex justify-content-start"
                        onClick={SubmitData}
                      >
                        Sign in
                      </button>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
    </>
  );
};

export default Loginform;
require_once __DIR__ . '/vendor/autoload.php';

$klein = new \Klein\Klein();

$klein->respond('GET', 'name/[:name]', function ($request) {
    return 'Hello ' . $request->name;
});

$klein->dispatch();
int result = 0;
int num1, num2, num3, num4;
cout << "Please Type 5 Numbers In A Row\n";
cout << "Only Even Numbers Smaller Than 20 Will Be Counted\n";
cin >> num1 >> num2 >> num3 >> num4;

/*
  Test Case 1
  Numbers => 15, 16, 22, 8
  Result => 24

  "Explain"
  Starting Result Is 0
  [Number 1] 15 => Not Even Number
  [Number 2] 16 => Smaller Than 20 And Even Number
  0 + 16 = 16
  [Number 3] 22 => Not Smaller Than 20
  [Number 4] 8  => Smaller Than 20 And Even Number
  16 + 8 = 24

  =================================

  Test Case 2
  Numbers => 100, 11, 12, 18
  Result => 30

  "Explain"
  Starting Result Is 0
  [Number 1] 100 => Not Smaller Than 20
  [Number 2] 11  => Not Even Number
  [Number 3] 12  => Smaller Than 20 And Even Number
  0 + 12 = 12
  [Number 4] 18  => Smaller Than 20 And Even Number
  12 + 18 = 30
*/
#include <iostream>

using namespace std;

int main()
{
    int n1, n2, op;
    cout << "Type The First Number\n";
    cin >> n1;
    cout << "Type The Second Number\n";
    cin >> n2;
    cout << "Choose The Wanted Operation\n";
    cout << "[1] +\n";
    cout << "[2] -\n";
    cout << "[3] /\n";
    cout << "[4] *\n";
    cin >> op;
    
    switch (op)
    {
        case 1:
          cout << n1 << " + " << n2 << " = " << n1 + n2 << "\n";
          break;
        case 2:
          cout << n1 << " - " << n2 << " = " << n1 - n2 << "\n";
          break;
        case 3:
          cout << n1 << " / " << n2 << " = " << n1 / n2 << "\n";
          break;
        case 4:
          cout << n1 << " * " << n2 << " = " << n1 * n2 << "\n";
          break;
          default:
            cout << "Operation Is Not Valid";
    }
    
    return 0;
}
npx -p @angular/cli ng new your-project-name --skip-install
import requests

print("hello")
{"status":400,"message":"missing response type"}
<h2>Ingredients</h2>
<ol>
  <li>Artesian mineral water</li>
  <li>H+ Sport Multi-Vitamin Powder</li>
  <li>Natural raspberry flavor</li>
</ol>
<h2>Varieties</h2>
<ul>
  <li>Raspberry</li>
  <li>Strawberry</li>
  <li>Blueberry</li>
  <li>Lemon-Lime</li>
  <li>Peach</li>
  <li>Orange</li>
</ul>
h1>My Fine Website</h1>

<p>Often H1 is used for site identity. Do not be put off by its large size. That can be changed with CSS.</p>

<h2>H2 often starts a new section</h2>

<p>H2 might be used to start a new article on a web page.</p> 

<h3>H3 might be in an article</h3>

<p>H3 might be inside of an article.</p>
php artisan migrate --path=/database/migrations/fileName.php
vscode://file/{full path to file}

vscode://file/c:/myProject/package.json
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
sudo apt-get install apt-transport-https --yes
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="Media-Queries.css">
<title>Document</title>
</head>
<body>

<div class="Div" >
<div class="FDiv"></div>
<div class="SDiv"></div>
</div>

</body>
</html>

file style.css
.Div{
margin-top: 200px;
display: flex;
justify-content: center;
background-color: #999;
}
.FDiv{
width: 200px;
height: 200px;
background-color: chartreuse;
}
.SDiv{
width: 200px;
height: 200px;
background-color:yellow;
margin-left: 200px;
}


Media-Queries.css
<!-- حتما فاصله بین لغت ها و پرانتز و لغت ها حفظ شود-->
@media only screen and (max-width:600px){
.FDiv{
width: 250px;
height: 250px;
background-color: yellow;
.SDiv{
width: 250px;
height: 250px;
background-color: red;
margin-left: 200px;
}
}
@media only screen and (min-width:600px){
.FDiv{
width: 250px;
height: 250px;
background-color: blue;
.SDiv{
width: 250px;
height: 250px;
background-color: red;
margin-left: 200px;
}
}
@media only screen and (min-width:800px){
.FDiv{
width: 250px;
height: 250px;
background-color: yellow;
position: relative;
top:100px;
.SDiv{
width: 250px;
height: 250px;
background-color: purpul;
margin-left: 200px;
position: relative;
top:100px;
}
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
< link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<p>mamad</p>
<div></div>

</body>
</html>

file style.css
h1{
font-size:50px;
text-shadow: 10px 0px 20px blue;
}
div{
width: 250px;
height: 250px;
box-shadow: 0px 10px 5px black;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
< link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>

</body>
</html>

file style.css
p{
border : 3px solid yellowgreen;
width : 250px;
height: 145px;
<!-- حالت دیفالتشه و متن رو به صورت معمولی نشون میده-->
overflow: visible;
<!-- به متن استایل اسکرول میده-->
overflow: scroll;
<!-- اضافه متن رو از بردری که براش انتخاب کردی پاک میکنه-->
overflow: hidden;
<!-- اگر متن رو تشخیص بده زیاده به صورت اتومات بهش اسکرول میده-->
overflow: auto;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
< link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>

<div class="header">
<h1>Chania</h1>
</div>

<div class="clearfix">
<div class="column menu">
<ul>
<li>The Flight</li>
<li>The city</li>
<li>The Island</li>
<li>The Food</li>
</ul>
</div>
<div class="column content" >
<h1>The city</h1>
<p>china ,ndfldjgjlgjvklfdsjvkljdaklgvfdkljvklfdajgklvjdlgvjgfdlkjg</p>

</div>
</div>

<div class="Footer">
<p>Footer Text</p>
</div>

</body>
</html>

file style.css
*{
box-sizing: border-box;
}
.header, .Footer {
background-color: gray;
color:snow;
padding: 15px;
}
.column{
float:left;
padding:15px;
}
.clearfix::after{
content: "";
clear: both;
display: tablel;
}
.menu{
width :25%;
}
.content{
width :75%;
}
.menu ul{
List-style-type:none;
margin: 0;
padding: 0;
}
.menu li{
padding: 8px;
margin-bottom: 8px;
background-color:#33b5e5;
color:#ffffff;
}
.menu li:hover{
background-color: turquoise;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
< link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>

<div class="cont">
<div class="div1"></div>
<div class="div2">Lorem ipsum dolor sit amet.</div>
<div class="div3"></div>
</div>

</body>
</html>

file style.css
.cont{
width :1000px;
height:700px;
border: 1px solid black;
}
.div1{
width :200px;
height:200px;
background-color: red;
float: left;
}
.div2{
width: 200px;
height: 200px;
background-color:red;
clear: both;
}
.div3{
width: 200px;
height: 200px;
background-color:blue;
}
#include <iostream>

using namespace std;

int main()
{
    int day;
    cout << "Choose A Day From 1 To 25\n";
    cin >> day;
    
    /* if (day == 1)
    {
        cout << "Open From 08:00 To 14:00";
    }
    else if (day == 2)
    {
        cout << "Open From 08:00 To 14:00";
    }
    else if (day == 2)
    {
        cout << "Open From 10:00 To 16:00";
    }
    else
    {
        cout << "Sorry, Closed";
    }
    */
    
    switch (day)
    {
        case 1:
        case 2:
            cout << "Open From 08:00 To 14:00";
            break;
        case 3:
            cout << "Open From 10:00 To 16:00";
            break;
          default:
            cout << "Sorry, Closed";
        
    }
    return 0;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
< link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>

<h1>Lorem ipsum dolor sit amet.</hl>
<div class="sticky">
<nav>
<a href="">خانه</a>
<a href="">وبلاگ</a>
<a href="">دوره های اموزشی</a>
</nav>
</div>

</body>
</html>

file style.css
ul{
List-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color:dimgrey;
}
li{
float: right;
}
li a{
display: inline-block;
color:snow;
text-align: center;
padding: 15px 17px;
text-decoration: none;
font-size: 25px;
}
li a:hover{
background-color: rgb(255,145,0);
color: black;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
< link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>

<h1>Lorem ipsum dolor sit amet.</hl>
<div class="sticky">
<nav>
<a href="">خانه</a>
<a href="">وبلاگ</a>
<a href="">دوره های اموزشی</a>
</nav>
</div>

</body>
</html>

file style.css

div.sticky{
position: sticky;
top: 0;
padding: 5px;
background-color: steelblue;
border: 1px solid black;
}
a{
text-decoration :none;
padding: 15px;
font-size: 25px;
color:snow;
}
nav{
text-align: center;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
< link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>

<nav>
<a href="">خانه</a>
<a href="">وبلاگ</a>
<a href="">دوره های اموزشی</a>
</nav>

</body>
</html>

file style.css

nav{
background-color: black;
text-align: center;
position: fixed;
top: 0;
Left: 0;
right: 0;
}
a{
display: inline-block;
padding: 1em;
color:  #fff;
text-decoration :none;
}
a:hover{
color: yellowgreen;
}
Step-1
sudo apt-get update -y
sudo apt-get upgrade -y

Step-2
//Create New User//
sudo adduser [frappe-user]
usermod -aG sudo [frappe-user]
su [frappe-user] 
cd /home/[frappe-user]

Step-3
//Install GIT
sudo apt-get install git

Step-4
//Install Python
sudo apt-get install python3-dev python3.10-dev python3-setuptools python3-pip python3-distutils

Step-5
//Install Python Virtual Environment
sudo apt-get install python3.10-venv

Step-6
//Install Software Properties Common
sudo apt-get install software-properties-common

Step-7
//Install MariaDB
sudo apt install mariadb-server mariadb-client

Step-8
//Install Redis Server
sudo apt-get install redis-server

Step-9
//Install other packages, PDF
sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install libmysqlclient-dev

Step-10
//-Configure MYSQL Server-//
//Setup the server
sudo mysql_secure_installation

//When you run this command, the server will show the following prompts. Please follow the steps as shown below to complete the setup correctly.

//Enter current password for root: (Enter your SSH root user password)
//Switch to unix_socket authentication [Y/n]: Y
//Change the root password? [Y/n]: Y
//It will ask you to set new MySQL root password at this step. This can be different from the SSH root user password.
//Remove anonymous users? [Y/n] Y
//Disallow root login remotely? [Y/n]: N
//This is set as N because we might want to access the database from a remote server for using //business analytics software like Metabase / PowerBI / Tableau, etc.
//Remove test database and access to it? [Y/n]: Y
//Reload privilege tables now? [Y/n]: Y
--------------------

Step-11
//Edit MYSQL default config file
sudo nano /etc/mysql/my.cnf
---------------
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

[mysql]
default-character-set = utf8mb4
----------------

Step-12
//Restart Mysql Server
sudo service mysql restart

Step-13
//Install CURL//
sudo apt install curl

Step-14
//Install Node//
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile
nvm install 18

Step-15
//Install NPM//
sudo apt-get install npm

Step-16
//Install Yarn//
sudo npm install -g yarn

Step-17
//Install Frappe Bench//
sudo pip3 install frappe-bench

Step-18
//Initialize Frappe Bench//
bench init --frappe-branch version-14 frappe-bench
cd frappe-bench

Step-19
//Change user directory permissions.//
//This will give the bench user execution permission to the home directory.//
chmod -R o+rx /home/[frappe-user]

Step-20
//Install ERPNext and other Apps
//Download all the apps we want to install
//The first app we will download is the payments app. This app is required when setting up ERPNext.
bench get-app payments

Step-21
//Download ERPNext app
bench get-app --branch version-14 erpnext

Step-22
//Download HRMS
bench get-app hrms

Step-23
//Install ERPNEXT
bench --site site1.local install-app erpnext

Step-24
//Install HRMS
bench --site site1.local install-app hrms

Step-25
BENCH START
-----------------------

 Step-26
 //Enable Scheduler
bench --site site1.local enable-scheduler

Step-27
//Disable maintenance mode
bench --site site1.local set-maintenance-mode off

Step-28
//Setup production config
sudo bench setup production [frappe-user]

Step-29
// NGINX Install
bench setup nginx

Step-30
//Restart Supervisor and Launch Production Mode
sudo supervisorctl restart all
sudo bench setup production [frappe-user]
function bulk_modifier_page() {
    global $wpdb;

    if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) {
        // Check if a CSV file is uploaded successfully
        if ($_FILES['csv_file']['error'] == UPLOAD_ERR_OK) {
            $file = $_FILES['csv_file']['tmp_name'];

            // Read the CSV file
            $csv_data = array_map('str_getcsv', file($file));
            $csv_headers = array_shift($csv_data); // Get headers

            // Define the mapping of CSV columns to database columns for wp_za_groups table
            $group_column_mapping = array(
                'group_name' => 'title',
                'priority' => 'priority',
                'apply_to' => 'apply_to',
                'author_id' => 'admin_id',
                'created_at' => 'created_at',
                'created_at_gmt' => 'created_at_gmt',
                'updated_at' => 'updated_at',
                'updated_at_gmt' => 'updated_at_gmt'
            );

            // Define the mapping of CSV columns to database columns for wp_za_types table
            $type_column_mapping = array(
                'title_name' => 'title',
                'type' => 'type',
                'status' => 'status',
                'description' => 'description',
                'required' => 'required',
                'display_description_on_expansion' => 'display_description_on_expansion',
                'hide_description' => 'hide_description',
                'tooltip_description' => 'tooltip_description',
                'created_at' => 'created_at',
                'created_at_gmt' => 'created_at_gmt',
                'updated_at' => 'updated_at',
                'updated_at_gmt' => 'updated_at_gmt'
            );

            // Define the mapping of CSV columns to database columns for wp_za_values table
            $value_column_mapping = array(
                'addons_title' => 'title',
                'price' => 'price',
                'description_value' => 'description',
                'sku' => 'sku',
            );

            // Insert data into the wp_za_groups, wp_za_types, wp_za_values, wp_za_products_to_groups, and wp_za_categories_to_groups tables
            foreach ($csv_data as $row) {
                // Prepare data for wp_za_groups table
                $group_data = array();
                foreach ($csv_headers as $key => $header) {
                    if (isset($group_column_mapping[$header])) {
                        $group_data[$group_column_mapping[$header]] = $row[$key];
                    }
                }

                // Set default values for created_at, created_at_gmt, updated_at, updated_at_gmt
                $group_data['created_at'] = current_time('mysql');
                $group_data['created_at_gmt'] = current_time('mysql', true);
                $group_data['updated_at'] = current_time('mysql');
                $group_data['updated_at_gmt'] = current_time('mysql', true);

                // Insert data into the wp_za_groups table
                $wpdb->insert($wpdb->prefix . 'za_groups', $group_data);
                $group_id = $wpdb->insert_id; // Get the group ID

                // Prepare data for wp_za_types table
                $type_data = array(
                    'group_id' => $group_id,
                    'step' => 0, // Default value
                    'accordion' => 'open', // Default value
                );

                // Map CSV columns to database columns for wp_za_types table and set default values
                foreach ($csv_headers as $key => $header) {
                    if (isset($type_column_mapping[$header])) {
                        if ($header === 'status' && !isset($type_data['status'])) {
                            // Set default status if not present in CSV
                            $type_data['status'] = 'enable';
                        } elseif ($header === 'description' && !isset($type_data['description'])) {
                            // Set default description if not present in CSV
                            $type_data['description'] = 'none';
                        } elseif ($header === 'required' && !isset($type_data['required'])) {
                            // Set default required value if not present in CSV
                            $type_data['required'] = 0;
                        } elseif ($header === 'display_description_on_expansion' && !isset($type_data['display_description_on_expansion'])) {
                            // Set default display_description_on_expansion value if not present in CSV
                            $type_data['display_description_on_expansion'] = 0;
                        } elseif ($header === 'hide_description' && !isset($type_data['hide_description'])) {
                            // Set default hide_description value if not present in CSV
                            $type_data['hide_description'] = 0;
                        } elseif ($header === 'tooltip_description' && !isset($type_data['tooltip_description'])) {
                            // Set default tooltip_description value if not present in CSV
                            $type_data['tooltip_description'] = 0;
                        } else {
                            $type_data[$type_column_mapping[$header]] = $row[$key];
                        }
                    }
                }

                // Set default values for created_at, created_at_gmt, updated_at, updated_at_gmt
                $type_data['created_at'] = current_time('mysql');
                $type_data['created_at_gmt'] = current_time('mysql', true);
                $type_data['updated_at'] = current_time('mysql');
                $type_data['updated_at_gmt'] = current_time('mysql', true);

                // Insert data into the wp_za_types table
                $wpdb->insert($wpdb->prefix . 'za_types', $type_data);
                $type_id = $wpdb->insert_id; // Get the type ID

                // Prepare data for wp_za_values table
                $value_data = array(
                    'type_id' => $type_id,
                    'step' => $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "za_values WHERE type_id = $type_id") + 1, // Increment step
                );

                // Map CSV columns to database columns for wp_za_values table and set default values
                foreach ($csv_headers as $key => $header) {
                    if (isset($value_column_mapping[$header])) {
                        if ($header === 'description_value' && !isset($value_data['description'])) {
                            // Set default description if not present in CSV
                            $value_data['description'] = 'no value';
                        } elseif ($header === 'checked' && !isset($value_data['checked'])) {
                            // Set default checked value if not present in CSV
                            $value_data['checked'] = 0;
                        } elseif ($header === 'hide_description' && !isset($value_data['hide_description'])) {
                            // Set default hide_description value if not present in CSV
                            $value_data['hide_description'] = 0;
                        } else {
                            $value_data[$value_column_mapping[$header]] = $row[$key];
                        }
                    }
                }

                // Set default values for created_at, created_at_gmt, updated_at, updated_at_gmt
                $value_data['created_at'] = current_time('mysql');
                $value_data['created_at_gmt'] = current_time('mysql', true);
                $value_data['updated_at'] = current_time('mysql');
                $value_data['updated_at_gmt'] = current_time('mysql', true);

                // Insert data into the wp_za_values table
                $wpdb->insert($wpdb->prefix . 'za_values', $value_data);
                $value_id = $wpdb->insert_id; // Get the value ID

                // Prepare data for wp_za_products_to_groups table
                $product_names = explode(',', $row[array_search('products_name', $csv_headers)]);
                foreach ($product_names as $product_name) {
                    $product_id = $wpdb->get_var("SELECT ID FROM " . $wpdb->posts . " WHERE post_title = '$product_name' AND post_type = 'product'");

                    if ($product_id) {
                        $product_to_group_data = array(
                            'product_id' => $product_id,
                            'group_id' => $group_id,
                        );

                        // Insert data into the wp_za_products_to_groups table
                        $wpdb->insert($wpdb->prefix . 'za_products_to_groups', $product_to_group_data);
                    }
                }

                // Prepare data for wp_za_categories_to_groups table
                $category_names = explode(',', $row[array_search('category_names', $csv_headers)]);
                foreach ($category_names as $category_name) {
                    // Get the category ID based on the category name
                    $category_id = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms WHERE name = %s", $category_name));

                    if ($category_id) {
                        $category_to_group_data = array(
                            'category_id' => $category_id,
                            'group_id' => $group_id,
                        );

                        // Insert data into the wp_za_categories_to_groups table
                        $wpdb->insert($wpdb->prefix . 'za_categories_to_groups', $category_to_group_data);
                    }
                }
            }

            echo '<div class="updated"><p>Data imported successfully!</p></div>';
        } else {
            echo '<div class="error"><p>Error uploading CSV file.</p></div>';
        }
    }

    // Display the upload form
    ?>
   
    <div class="wrap">
        <h2>Bulk Modifier Upload</h2>
        <form method="post" action="" enctype="multipart/form-data">
            <input type="file" name="csv_file">
            <input type="submit" class="button button-primary" value="Upload CSV & Apply">
        </form>
    </div>
    
    <?php
}
//Omport React and ReactDOM libraries
import React from 'react';
import ReactDOM  from 'react-dom/client';

//Grab #root div and store it as a var
//Tie react to our root div aka let react control this div

const el = document.getElementById('root');
const root = ReactDOM.createRoot(el);

//create an app component
function App(){
  const name = 'Lan'
  const age = '28'

  let flip = Math.random()
  let coin ='tail'
  if (flip>0.5){
    coin='heads'
  }else{
    coin='tails'
  }

  const arr=[1,1,3];
  const myObj={name:'Lan'}




  return (
    <>
    {/* ---------- recipe ---------- */}
    <h1> Fried Garlic Water Spinach </h1>
    <img src="https://img.soundofhope.org/2020-07/88-1596049315262.jpg"
    style={{ width:'50%'}}></img>

    <h3>Ingredients</h3>
    <li>water spinach </li>
      <li>garlic</li>
      <li>chili</li>
      <li>salt</li>
    <ul> 
      
    </ul>

    <h3>step</h3>
    <ol> 


      <li>After applying a coat of oil to the pan, add sliced garlic and chili. Sauté until they become tender and fragrant. </li>
      <li>Once the garlic and chili are ready, introduce the vegetable stalks into the pan. Sprinkle with salt.</li>
      <li>Cover the pan with a lid and allow the vegetables to steam briefly. The leaves will release their moisture as they cook.</li>
      <li>When everything is cooked to perfection, it's time to plate up and enjoy!</li>
    </ol>



    <br/><br/><br/><br/><br/><br/>
   {/* ---------- what we learned in class ---------- */}
  <hr/>
    <h1> Hello React!</h1>
      <p> My name is {name} and I am {age} years old</p>
      <p> flip: {flip}</p>
      <p> Coins flip: <b>{coin}</b></p>
      <p> Coins flip by short hand: 
        <b>{  Math.random()>0.5 ? 'heads' : 'tails' }</b>
      </p>

      <hr/>

      <p> Print the array out: {arr} </p>

      { /* <p> {myObj} </p> */ }

      <button disable={false} style={{color:'red'}}> Click Me </button>
      <input type="number" min={5} />
      <br/><br/><br/><br/><br/><br/>



    </>
  )
}

//Render react root / root div from index.html
root.render(<App />);
<!DOCTYPE html>

<html lang="en">

<style>
.card-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    --x: 0;
    --y: 0;
    flex: 1;
    margin: 0 10px;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    font-family: Arial, Helvetica, sans-serif;
    background-image: url('https://media.discordapp.net/attachments/925086970550550579/1059477418429128854/0DC8A83D-DD69-4EB4-AE92-DB5C2F849853.jpg?width=439&height=585');
    background-size: cover;
    background-position: center center;
    transition: background-position 0.3s;
}

.card:hover {
    background-position: center 10%;
}

.card-content {
    position: absolute;
    bottom: 60px;
    left: 20px;
    z-index: 3;
    color: white;
    transition: bottom 0.3s, left 0.3s, transform 0.3s;
}

.card:hover .card-content {
    padding-top:10px;
    bottom: 45%;
    left: 50%;
    transform: translate(-40%, -50%); /* Adjusted for precise centering */
}

h2, p {
    margin: 0;
}

.social-icons {
    position: absolute;
    bottom: 10px;
    left: 20px;
    display: flex;
    gap: 10px;
    z-index: 3;
    transition: bottom 0.3s, left 0.3s, transform 0.3s;
}

.card:hover .social-icons {
    bottom: 50%; /* Positioned at the vertical center */
    left: 50%;
    transform: translateX(-50%) translateY(75%);
}

i {
    color: white;
    font-size: 24px;
}

/* Dark overlay */
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 2;
    transition: background 0.3s;
}

.card:hover::before {
    background: rgba(0, 0, 0, 0.3);
}

.card::after {
    /* ... (existing styles) ... */
    top: var(--y);
    left: var(--x);
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 70%);
    pointer-events: none; /* Ensure the pseudo-element doesn't interfere with other interactions */
    z-index: 4;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s, opacity 0.3s;
    opacity: 0;
}

.card:hover::after {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* ... (previous CSS) ... */

.tech-icons {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 3;
}

.tech-icon {
    color: white;
    font-size: 24px;
}

/* Facebook Icon Glow */
.card .fab.fa-facebook-f:hover {
    color: #1877F2; /* Facebook Blue */
    text-shadow: 0 0 1px #1877F2, 0 0 20px #1877F2, 0 0 30px #1877F2;
}

/* Instagram Icon Glow */
.card .fab.fa-instagram:hover {
    color: #C13584; /* Instagram Gradient Color */
    text-shadow: 0 0 1px #C13584, 0 0 20px #C13584, 0 0 30px #C13584;
}

/* Twitter Icon Glow */
.card .fab.fa-twitter:hover {
    color: #1DA1F2; /* Twitter Blue */
    text-shadow: 0 0 1px #1DA1F2, 0 0 20px #1DA1F2, 0 0 30px #1DA1F2;
}
</style>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3-Column Card Section</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
    <link rel="stylesheet" href="styles.css"> <!-- Assuming you have an external CSS file named styles.css -->
</head>

<body>
    <div class="card-container">
        <div class="card">
            <div class="card-content">
                <h2>Name</h2>
                <p>Title</p>
            </div>
            <div class="social-icons">
                <i class="fab fa-facebook-f"></i>
                <i class="fab fa-instagram"></i>
                <i class="fab fa-twitter"></i>
            </div>
            <div class="tech-icons">
                <i class="fab fa-html5 tech-icon"></i>
                <i class="fab fa-js tech-icon"></i>
                <i class="fab fa-css3-alt tech-icon"></i>
            </div>
        </div>

        <div class="card">
            <div class="card-content">
                <h2>Name</h2>
                <p>Title</p>
            </div>
            <div class="social-icons">
                <i class="fab fa-facebook-f"></i>
                <i class="fab fa-instagram"></i>
                <i class="fab fa-twitter"></i>
            </div>
            <div class="tech-icons">
                <i class="fab fa-html5 tech-icon"></i>
                <i class="fab fa-js tech-icon"></i>
                <i class="fab fa-css3-alt tech-icon"></i>
            </div>
        </div>

        <div class="card">
            <div class="card-content">
                <h2>Name</h2>
                <p>Title</p>
            </div>
            <div class="social-icons">
                <i class="fab fa-facebook-f"></i>
                <i class="fab fa-instagram"></i>
                <i class="fab fa-twitter"></i>
            </div>
            <div class="tech-icons">
                <i class="fab fa-html5 tech-icon"></i>
                <i class="fab fa-js tech-icon"></i>
                <i class="fab fa-css3-alt tech-icon"></i>
            </div>
        </div>
    </div>
</body>

</html>
import {
	ERepaymentReason,
	ESaleStatus,
	ESaleType,
	ESaleVersion,
} from "@lendtable/common/dtos/SaleDto";
import { TTransaction, withTransaction } from "../utils/mysql";

import {
	calculatePayPeriodBalanceEspp,
	calculatePayPeriodBalanceK401,
} from "@lendtable/common/config/dynamic-payouts";
import { isPaidOut } from "@lendtable/common/config/sale";
import { EBalanceContributionStatus } from "@lendtable/common/dtos/BalanceContributionDto";
import { EBalanceSnapshotType } from "@lendtable/common/dtos/BalanceSnapshotDto";
import { EPayoutTransactionStatus } from "@lendtable/common/dtos/PayoutDto";
import { EPlaidConnectionType } from "@lendtable/common/dtos/PlaidConnectionDto";
import { EStatusUpdateType } from "@lendtable/common/dtos/StatusUpdateDto";
import { PayPeriodStatus } from "@prisma/client";
import { Customer } from "../entities/Customer";
import { prisma } from "../prisma/prisma";
import BalanceContributionRepository from "../repositories/BalanceContributionRepository";
import BalanceSnapshotRepository from "../repositories/BalanceSnapshotRepository";
import CustomerRepository from "../repositories/CustomerRepository";
import PayoutRepository from "../repositories/PayoutRepository";
import PlaidConnectionRepository from "../repositories/PlaidConnectionRepository";
import SaleRepository from "../repositories/SaleRepository";
import HotShot from "../utils/hot-shot";
import { logger } from "../utils/logger";
import { REPAYMENTS_PRODUCT_ID, REPAYMENT_PLAN } from "../utils/stripe";
import { isClonedCustomer } from "../utils/user";
import PlaidService from "./PlaidService";
import SaleStatusService from "./SaleStatusService";
import SlackService from "./SlackService";
import StripeService from "./StripeService";

class BalancesService {
	// Recalculates the customer's lendtable balance
	public static async updateLendtableBalance(
		customer: Customer,
		t?: TTransaction
	) {
		// Lendtable balance goes UP as customers get payouts, multiplied by the interest rate for each sale
		// Lendtable balance goes DOWN when the customer pays us back, or gets credit for special actions, i.e. we subtract the total (confirmed) balance contributions, in the order which they were confirmed (updated)

		// Combine the customer's sales and payouts, only choosing sales for which the contract is accepted and payouts that have not failed
		const sales = await SaleRepository.getAllByCustomerId(
			customer.id,
			"ASC",
			undefined,
			t
		);
		const payouts = await PayoutRepository.getAllByCustomerId(
			customer.id,
			"ASC",
			undefined,
			t
		);
		const payoutNonDynamic = payouts.filter((p) => {
			return p.payPeriodId === null;
		});
		const payoutsNotFailed = payoutNonDynamic.filter((p) => {
			return (
				p.payoutTransactionStatus === EPayoutTransactionStatus.Pending ||
				p.payoutTransactionStatus === EPayoutTransactionStatus.Successful
			);
		});
		const payPeriods = await prisma.payPeriod.findMany({
			// OK that this isn't in the same transaction,
			// because we never create payPeriods in this transaction
			// payPeriods are only created in Prisma
			where: {
				customerId: customer.id,
				status: PayPeriodStatus.APPROVED,
			},
			orderBy: {
				payDateProjected: "desc",
			},
		});
		const salesWithPayoutsAndPayPeriods = sales.map((sale) => ({
			sale,
			payouts: payoutsNotFailed.filter((p) => p.saleId === sale.id),
			payPeriods: payPeriods.filter((pp) => {
				return pp.esppSaleId === sale.id || pp.k401SaleId === sale.id;
			}),
			balanceContributions: [],
		}));

		// Go over the combined sales and sum the payouts
		const salesWithPayoutsSum = salesWithPayoutsAndPayPeriods.map((sp) => ({
			...sp,
			payoutsSumCents: sp.payouts.reduce(
				(acc, p) => acc + p.amountCents + p.subscriptionFromPayoutCents,
				0
			),
			dynamicPayoutsSumCents: sp.payPeriods.reduce((acc, pp) => {
				if (sp.sale.saleType === ESaleType.K401) {
					return acc + (pp.k401PayoutAmount ?? 0);
				} else if (sp.sale.saleType === ESaleType.Espp) {
					return acc + (pp.esppPayoutAmount ?? 0);
				} else {
					throw new Error(`Invalid saleType ${sp.sale.id}`);
				}
			}, 0),
		}));

		// Apply the interest rate to the sum of the payouts
		const salesWithPayoutsSumInterest = salesWithPayoutsSum.map((sp) => ({
			...sp,
			payoutsSumWithInterestCents: Math.floor(
				sp.payoutsSumCents * (sp.sale.interestRatio() ?? 1)
			),
			payPeriodSumWithOurShareCents: sp.payPeriods.reduce((acc, pp) => {
				const payoutSumForPeriod = payouts
					.filter((p) => {
						// conditional is different than above because we include scheduled payouts
						return (
							p.payPeriodId === pp.id &&
							p.payoutTransactionStatus !== EPayoutTransactionStatus.Failed
						);
					})
					.reduce((acc, p) => acc + p.amountCents, 0);
				if (payoutSumForPeriod === 0) {
					// If all payouts for this payPeriod have failed, then the payPeriod will not count towards balance
					return acc;
				}
				const shouldBePaidAmount =
					(pp.esppPayoutAmount ?? 0) +
					(pp.k401PayoutAmount ?? 0) -
					(pp.subscriptionFee ?? 0);
				if (payoutSumForPeriod !== shouldBePaidAmount) {
					// Edge case where the payPeriod has multiple payouts, and there is both succesful and failed payouts and we have not resent the failed payouts
					// We need to manually reduce the values on the payPeriod
					if (!isClonedCustomer(customer)) {
						void SlackService.postMessage({
							text:
								`Pay Period ${pp.payDateProjectedStr} for customer ${customer.id} has multiple payouts, and there are both succesful and failed payouts.\n` +
								`The sum of payouts sent doesn't not match payoutAmounts stored on the payPeriod. We need to manually adjust.\n` +
								`Should be paid: $${shouldBePaidAmount / 100}, actual paid: $${
									payoutSumForPeriod / 100
								}.`,
							channel: SlackService.DYNAMIC_CHANNEL,
						});
					}
				}

				if (sp.sale.saleType === ESaleType.K401) {
					// Use pp.k401OurShare once backfilled
					const taxRate = sp.payPeriods[0].taxRate; // use the taxRate from the most recent approved payPeriod
					return (
						acc +
						calculatePayPeriodBalanceK401({ payPeriod: pp, taxRate }).balance
					);
				}
				if (sp.sale.saleType === ESaleType.Espp) {
					// Use pp.esppOurShare once backfilled
					return acc + calculatePayPeriodBalanceEspp(pp).balance;
				}
				throw new Error("Invalid saleType");
			}, 0),
		}));

		// Mark the payouts as being completed when enough money is sent to cover the loan amount, with a leeway of 10 USD
		for (const { sale, payoutsSumCents } of salesWithPayoutsSumInterest) {
			if (
				sale.saleStatus !== ESaleStatus.PayoutScheduled &&
				sale.saleStatus !== ESaleStatus.PayoutPaused
			) {
				continue;
			}
			// Only legacy sales can move to PayoutComplete in this way
			if (
				sale.saleVersion !== ESaleVersion._20220428 &&
				sale.saleVersion !== ESaleVersion._20220505
			) {
				continue;
			}
			if (
				payoutsSumCents > 0 &&
				payoutsSumCents >= (sale.loanCents() ?? 0) - 10 * 100
			) {
				// Update SaleStatus
				const oldStatus = sale.saleStatus;
				sale.saleStatus = ESaleStatus.PayoutComplete;
				await SaleRepository.updateSaleStatus(sale.id, sale.saleStatus, t);
				await SaleStatusService.onStatusChanged(
					sale,
					customer,
					{
						oldStatus,
						statusUpdateType: EStatusUpdateType.PayoutsCompleted,
						recursionDepth: 0,
					},
					t
				);
				sale.repaymentReason = ERepaymentReason.ContractTermEnded;
				await SaleRepository.updateRepaymentReason(
					sale.id,
					sale.repaymentReason,
					t
				);
			}
		}

		// To start off, make the balances equal to the payouts sum with interest
		const salesWithBalances = salesWithPayoutsSumInterest.map((sp) => ({
			...sp,
			balanceCents:
				sp.payoutsSumWithInterestCents + sp.payPeriodSumWithOurShareCents,
		}));

		// Apply balance contributions, draining the balances
		const balanceContributions =
			await BalanceContributionRepository.getAllByCustomerIdStatusOrderUpdated(
				customer.id,
				EBalanceContributionStatus.Confirmed,
				"ASC",
				undefined,
				t
			);
		// Apply BalanceContributions that have a SaleId first
		// Refunds and disputes all have saleId set
		for (const balanceContribution of balanceContributions.filter(
			(b) => b.saleId !== null
		)) {
			const sb = salesWithBalances.find(
				(s) => s.sale.id === balanceContribution.saleId
			);
			// TODO how should we handle the case where the sale is missing?
			if (!sb) {
				continue;
			}
			sb.balanceCents -= balanceContribution.amountCents;
		}
		// Apply BalanceContributions without a SaleId second
		for (const balanceContribution of balanceContributions.filter(
			(b) => b.saleId === null
		)) {
			const sb = salesWithBalances.find((sb) => sb.balanceCents > 0);
			if (!sb) {
				continue;
			}
			sb.balanceCents -= balanceContribution.amountCents;
			// Update the BalanceContribution's SaleId
			balanceContribution.saleId = sb.sale.id;
			await BalanceContributionRepository.updateSaleId(
				balanceContribution.id,
				balanceContribution.saleId,
				t
			);
		}

		// Sum the total lendtable balance
		const lendtableBalanceCents = salesWithBalances.reduce(
			(acc, sb) => acc + sb.balanceCents,
			0
		);
		// Sum total 401(k) and ESPP balances
		const lendtableBalanceK401Cents = salesWithBalances
			.filter((sb) => sb.sale.saleType === ESaleType.K401)
			.reduce((acc, sb) => acc + sb.balanceCents, 0);
		const lendtableBalanceEsppCents = salesWithBalances
			.filter((sb) => sb.sale.saleType === ESaleType.Espp)
			.reduce((acc, sb) => acc + sb.balanceCents, 0);

		// Save overall Customer balances
		customer.lendtableBalanceCents = lendtableBalanceCents;
		customer.lendtableBalanceK401Cents = lendtableBalanceK401Cents;
		customer.lendtableBalanceEsppCents = lendtableBalanceEsppCents;
		await CustomerRepository.updateLendtableBalances(
			customer.id,
			{
				lendtableBalanceCents,
				lendtableBalanceK401Cents,
				lendtableBalanceEsppCents,
			},
			t
		);

		// Save individual Sale balances
		for (const {
			sale,
			balanceCents,
			payoutsSumCents,
			dynamicPayoutsSumCents,
		} of salesWithBalances) {
			sale.balanceCents = balanceCents;
			sale.payoutSumCents = payoutsSumCents + dynamicPayoutsSumCents;
		}
		await Promise.all([
			...salesWithBalances.map((sb) =>
				SaleRepository.updateBalanceCents(sb.sale.id, sb.sale.balanceCents, t)
			),
			...salesWithBalances.map((sb) =>
				SaleRepository.updatePayoutSumCents(
					sb.sale.id,
					sb.sale.payoutSumCents,
					t
				)
			),
		]);

		// Sales that have had been paid out and were drained to a balance of zero are changed to RepaymentComplete
		const salesToComplete = salesWithBalances.filter(
			(sb) => isPaidOut(sb.sale) && sb.balanceCents <= 10
		);
		for (const { sale } of salesToComplete) {
			if (sale.saleStatus === ESaleStatus.RepaymentComplete) {
				continue;
			}

			const customerRepaymentPlans =
				await StripeService.getCustomerRepaymentSubscriptions(customer);

			if (customerRepaymentPlans) {
				const saleRepaymentPlan = customerRepaymentPlans?.find(
					(rp) => rp.saleId === sale.id
				);
				if (saleRepaymentPlan && saleRepaymentPlan.planStatus !== "canceled") {
					await StripeService.cancelSubscription({
						subscriptionId: saleRepaymentPlan.id,
						stripeSubscriptionProductId: REPAYMENTS_PRODUCT_ID,
						stripeSubscriptionTypeMedata: REPAYMENT_PLAN,
						stripeSubscriptionSaleIdMetadata: sale.id,
					});
				}
			}

			// Update SaleStatus
			const oldStatus = sale.saleStatus;
			sale.saleStatus = ESaleStatus.RepaymentComplete;
			await SaleRepository.updateSaleStatus(sale.id, sale.saleStatus, t);
			await SaleStatusService.onStatusChanged(
				sale,
				customer,
				{
					oldStatus,
					statusUpdateType: EStatusUpdateType.Repaid,
					recursionDepth: 0,
				},
				t
			);
		}

		// Remove preapproved status from sales with repaid parents.
		if (salesToComplete) {
			await this.removePreapprovedFromEsppSaleIfParentAndSiblingsRepaid(
				customer.id,
				t
			);
		}
	}

	// Remove preapproved status from child sales if parent sale and sibling sales have been repaid
	// Call after some sales are repaid
	public static async removePreapprovedFromEsppSaleIfParentAndSiblingsRepaid(
		customerId: string,
		t?: TTransaction
	) {
		const sales = await SaleRepository.getAllByCustomerId(
			customerId,
			undefined,
			undefined,
			t
		);
		const preapprovedSales = sales.filter(
			(sale) => sale.saleType === ESaleType.Espp && sale.preapproved
		);

		for (const childSale of preapprovedSales) {
			// check the parent sale and sibling sales
			if (!childSale.parentId) {
				continue;
			}
			const targetSales = await SaleRepository.getAllByParentId(
				childSale.parentId,
				undefined,
				undefined,
				t
			);
			const allRepaid = targetSales.every((sale) => {
				return (
					sale.preapproved || sale.saleStatus === ESaleStatus.RepaymentComplete
				);
			});
			if (allRepaid) {
				await SaleRepository.updatePreapproved(childSale.id, false, t);
			}
		}
	}

	// Recalculates the customer's 401(k) balance
	public static async updateK401Balance(customer: Customer, t?: TTransaction) {
		// The 401(k) balance is equal to what's in the customer's 401(k) account(s), we use Plaid to get that info
		const balance = await PlaidService.getCustomerBalance(
			customer,
			EPlaidConnectionType.K401,
			t
		);
		if (balance === null) {
			return;
		}
		const balanceCents = Math.round(balance * 100);
		// Save balance snapshot to DB but only if it's changed since the last time we got the info
		await BalanceSnapshotRepository.createIfChanged(
			{
				customerId: customer.id,
				balanceSnapshotType: EBalanceSnapshotType.K401,
				amountCents: balanceCents,
			},
			t
		);
	}

	// Recalculates the customer's ESPP balance
	public static async updateEsppBalance(customer: Customer, t?: TTransaction) {
		// The ESPP balance is equal to what's in the customer's ESPP account(s), we use Plaid to get that info
		const balance = await PlaidService.getCustomerBalance(
			customer,
			EPlaidConnectionType.Espp,
			t
		);
		if (balance === null) {
			return;
		}
		const balanceCents = Math.round(balance * 100);
		// Save balance snapshot to DB but only if it's changed since the last time we got the info
		await BalanceSnapshotRepository.createIfChanged(
			{
				customerId: customer.id,
				balanceSnapshotType: EBalanceSnapshotType.Espp,
				amountCents: balanceCents,
			},
			t
		);
	}

	// Recalculates the customer's checking account balance
	public static async updateCheckingBalance(
		customer: Customer,
		t?: TTransaction
	) {
		// The ESPP balance is equal to what's in the customer's checking account(s), we use Plaid to get that info
		const balance = await PlaidService.getCustomerBalance(
			customer,
			EPlaidConnectionType.Checking,
			t
		);
		if (balance === null) {
			return;
		}
		const balanceCents = Math.round(balance * 100);
		// Save balance snapshot to DB but only if it's changed since the last time we got the info
		await BalanceSnapshotRepository.createIfChanged(
			{
				customerId: customer.id,
				balanceSnapshotType: EBalanceSnapshotType.Checking,
				amountCents: balanceCents,
			},
			t
		);
	}

	public static async updateAllLendtableBalances() {
		logger.warn("updateAllLendtableBalances - started");
		const customers = await CustomerRepository.getAllSignedUp();
		for (const { id } of customers) {
			try {
				await withTransaction(async (t) => {
					const customer = await CustomerRepository.getById(id, t);
					if (!customer) {
						return;
					}
					await this.updateLendtableBalance(customer, t);
				});
			} catch (err) {
				logger.error("BalancesService.updateAllLendtableBalances", err);
			}
		}
		logger.warn("updateAllLendtableBalances - complete");
	}

	public static async updateAllK401Balances() {
		logger.info("updateAllK401Balances - started");
		const connectionsK401 = await PlaidConnectionRepository.getAllByType(
			EPlaidConnectionType.K401
		);
		for (const { id } of connectionsK401) {
			HotShot.increment("BalancesService.updateAllK4O1Balances", {
				service: "cronjob",
				api: "plaid",
			});
			try {
				await withTransaction(async (t) => {
					const connection = await PlaidConnectionRepository.getById(id, t);
					if (!connection) {
						return;
					}
					const customer = await CustomerRepository.getById(
						connection.customerId,
						t
					);
					if (!customer) {
						return;
					}
					await this.updateK401Balance(customer, t);
				});
			} catch (err) {
				logger.warn("BalancesService.updateAllK401Balances", err);
				HotShot.increment("BalancesService.updateAllK4O1Balances_error", {
					service: "cronjob",
					api: "plaid",
				});
				HotShot.event(
					"BalancesService.updateAllK401Balances_error",
					`Error updating 401K balances for Plaid Connection: ${id}`,
					{
						aggregation_key: "cronjob",
						date_happened: new Date(),
						alert_type: "error",
					}
				);
			}
		}
		logger.info("updateAllK401Balances - complete");
	}

	public static async updateAllEsppBalances() {
		logger.info("updateAllEsppBalances - started");
		const connectionsEspp = await PlaidConnectionRepository.getAllByType(
			EPlaidConnectionType.Espp
		);
		for (const { id } of connectionsEspp) {
			HotShot.increment("BalancesService.updateAllEsppBalances", {
				service: "cronjob",
				api: "plaid",
			});
			try {
				await withTransaction(async (t) => {
					const connection = await PlaidConnectionRepository.getById(id, t);
					if (!connection) {
						return;
					}
					const customer = await CustomerRepository.getById(
						connection.customerId,
						t
					);
					if (!customer) {
						return;
					}
					await this.updateEsppBalance(customer, t);
				});
			} catch (err) {
				logger.warn("BalancesService.updateAllEsppBalances", err);
				HotShot.increment("BalancesService.updateAllEsppBalances_error", {
					service: "cronjob",
					api: "plaid",
				});
				HotShot.event(
					"BalancesService.updateAllEsppBalances_error",
					`Error updating ESPP balances for Plaid Connection: ${id}`,
					{
						aggregation_key: "cronjob",
						date_happened: new Date(),
						alert_type: "error",
					}
				);
			}
		}
		logger.info("updateAllEsppBalances - complete");
	}

	public static async updateAllCheckingBalances() {
		logger.info("updateAllCheckingBalances - started");
		const connectionsChecking = await PlaidConnectionRepository.getAllByType(
			EPlaidConnectionType.Checking
		);
		for (const { id } of connectionsChecking) {
			HotShot.increment("BalancesService.updateAllCheckingBalances", {
				service: "cronjob",
				api: "plaid",
			});
			try {
				await withTransaction(async (t) => {
					const connection = await PlaidConnectionRepository.getById(id, t);
					if (!connection) {
						return;
					}
					const customer = await CustomerRepository.getById(
						connection.customerId,
						t
					);
					if (!customer) {
						return;
					}
					await this.updateCheckingBalance(customer, t);
				});
			} catch (err) {
				logger.warn("BalancesService.updateAllCheckingBalances", err);
				HotShot.increment("BalancesService.updateAllCheckingBalances_error", {
					service: "cronjob",
					api: "plaid",
				});
				HotShot.event(
					"BalancesService.updateAllCheckingBalances_error",
					`Error updating checking balances for Plaid Connection: ${id}`,
					{
						aggregation_key: "cronjob",
						date_happened: new Date(),
						alert_type: "error",
					}
				);
			}
		}
		logger.info("updateAllCheckingBalances - complete");
	}
}

export default BalancesService;
new BrowserCheck('homepage-browser-check-1', {
  name: 'Browser Check #1',
  frequency: 10,
  regions: ['us-east-1', 'eu-west-1'],
  code: {
    entrypoint: './home.spec.js'
  }
})

new ApiCheck('product-api-check-1', {
  name: 'Product API - fetch products',
  degradedResponseTime: 10000,
  maxResponseTime: 20000,
  requests: {
    url: "https://api.acme.com/v1/products",
    method: "GET",
    assertions: [AssertionBuilder.statusCode().equals(200)]
  }
})
aptitude search bash-completion
           //   bash sh-sequence-bash-completion
Ejecutamos este comando -basta con copy&paste- en la consola "sudo gedit /etc/bash.bashrc".
Descomentamos las tres últimas líneas de ese fichero que se ha abierto, quedando así:
if [ -f /etc/bashcompletion ]; then
. /etc/bashcompletion
fi

Una vez esté todo como el código que os mostramos podremos guardar de nuevo el fichero. Un apunte: antes de la primera línea hay un comentario que podéis dejar o eliminar. Yo personalmente os diría que no lo eliminéis para que sepáis para que sirve ese fichero en un futuro. Probad a comenzar a escribir un comando y pulsad TAB, veréis como se completa el comando automáticamente.

Un ejemplo muy básico para probar esta función es escribir "cd /h" y pulsar el tabulador, automáticamente debería aparecer "cd /home" en pantalla. Le dais a enter y ya tendréis el comando ejecutado.
#include <iostream>

using namespace std;

int main()
{
    // App 4 => Simple Calculator
    
    int num_one, num_two, op;
    cout << "[1] +\n";
    cout << "[2] -\n";
    cout << "[3] /\n";
    cout << "[4] *\n\n";
    
    cout << "Type The First Number\n";
    cin >> num_one;
    cout << "Type The Second Number\n";
    cin >> num_two;
    cout << "Type The Wanted Operation\n";
    cin >> op;
    
    if (op == 1)
    {
        cout << num_one + num_two;
    }
    else if (op == 2)
    {
        cout << num_one - num_two;
    }
    else if (op == 3)
    {
        cout << num_one / num_two;
    }
    else if (op == 4)
    {
        cout << num_one * num_two;
    }
    else 
    {
        cout << "==Your Operation Is Not Valid==";
    }
    return 0;
}
import React, { useState } from 'react';

// Create a small, reusable component for an individual item
function ListItem({ title, description }) {
  const [isExpanded, setIsExpanded] = useState(false);

  return (
    <div>
      <div onClick={() => setIsExpanded(!isExpanded)}>
        <strong>{title}</strong>
      </div>
      {isExpanded && <div>{description}</div>}
    </div>
  );
}

// Create a larger component to manage a list of items
function ItemList({ items }) {
  return (
    <div>
      {items.map((item, index) => (
        <ListItem key={index} title={item.title} description={item.description} />
      ))}
    </div>
  );
}

// Render the ItemList component in the parent component
function App() {
  const sampleItems = [
    { title: 'Item 1', description: 'Description for Item 1' },
    { title: 'Item 2', description: 'Description for Item 2' },
    { title: 'Item 3', description: 'Description for Item 3' },
  ];

  return (
    <div>
      <h1>Dynamic Item List</h1>
      <ItemList items={sampleItems} />
    </div>
  );
}

export default App;
# mv /etc/pve/nodes/A/qemu-server/100.conf /etc/pve/nodes/B/qemu-server/100.conf
# mv /etc/pve/nodes/A/lxc/200.conf /etc/pve/nodes/B/lxc/200.conf
h1 {
  font-size: 12px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
< link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>

<!-- الان پرنت چایلد شد-->
<div class="div1">
<div class="div2"></div>
</div>
</body>
</html>

file style.css

.div1{
background-color: blue;
width: 400px;
height: 400px;
position: relative;
top:250px;
}
.div2{
background-color: yellow;
width: 200px;
height: 200px;
position: absolute;
left:500px;
}
example picture:https://i.stack.imgur.com/gz265.png
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
< link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>

<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo, mollitia.</p>
<div></div>

</body>
</html>

file style.css

background-color: yellowgreen;
width: 500px;
height: 200px;
position: relative;
top: 20px;
}
div{
background-color: turquoise;
width: 150px;
height: 150px;
position: relative;
bottom: 20px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatib1e" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
< link rel="stylesheet" href="style.css">
<title>Document</title>
</head>
<body>


<!-- block -->
<div class="div1"></div>

<!-- inline -->
<!-- inline ها طول و عرض نمیگیرند-->
<!-- inline مارجین top نمی گیرند-->
<span class="span1"></span>

<!-- inline-block -->
<!-- inline-block جفت خصوصیات هم رو دارند -->
<span class="span2"></span>

</body>
</html>

file style.css

.div1{
background-color: blue;
width: 200px;
height: 200px;
}

.span1{
color:snow;
background-color: red;
padding:5px;
}

.span2{
color:purple;
background-color: black;
padding:5px;
display:inline-block;
margin-top:50px;
}

Here are the block display elements in HTML:
<address><article><aside><blockquote><canvas><dd><div><dl><dt><fieldset><figcaption><figure><footer><form><h1>-<h6><header><hr><li><main><nav><noscript><ol><p><pre><section><table><tfoot><ul><video>

Here are the inline display elements in HTML:
<a><abbr><acronym><b><bdo><big><br><button><cite><code><dfn><em><i><img><input><kbd><label><map><object><output><q><samp><script><select><small><span><strong><sub><sup><textarea><time><tt><var>
#include<stdio.h>
#include<stdlib.h>
#include<conio.h>
int num=1;
struct node{
	int val;
	struct node* left;
	struct node* right;
};
void inorder(struct node* root){
	if(root==NULL){
		return;
	}
	inorder(root->left);
	printf("%d -> ",root->val);
	inorder(root->right);
}
struct node* createnode(int val){
	struct node* nnode=(struct node*)malloc(sizeof(struct node));
	nnode->val=val;
	nnode->left=NULL;
	nnode->right=NULL;
	return nnode;
}
struct node* buildtree(struct node* node1,int val){
	//node1=createnode(num);
	if(num<=5){
	node1->left=buildtree(node1->left,(node1->val)*2);
	}
	if(num<=5){
	node1->right=buildtree(node1->right,(node1->val)*2 +1);
	}
	num++;
	return node1;
}
int main(){
	int n;
	struct node* root=createnode(1);
	clrscr();
	printf("Enter n:- ");
	scanf("%d",&n);
	root=buildtree(root,n);
	inorder(root);
	getch();
	return 0;
}
// Iterate over each element with the '.group' class
document.querySelectorAll('.markdown').forEach(function(group) {
    // Create the copy button
    let copyBtn = document.createElement('button');
    copyBtn.innerText = 'Copy';
    
    // Add click event to the copy button
    copyBtn.addEventListener('click', function() {
        // Clone the group element to avoid modifying the original content
        let clonedGroup = group.cloneNode(true);
        
        // Remove all button elements from the cloned group
        clonedGroup.querySelectorAll('button').forEach(function(button) {
            button.remove();
        });

        // Copy the innerHTML of the cloned group (without buttons) to the clipboard
        let textArea = document.createElement('textarea');
        textArea.value = clonedGroup.innerHTML;
        document.body.appendChild(textArea);
        textArea.select();
        document.execCommand('copy');
        document.body.removeChild(textArea);
    });
    
    // Append the copy button to the '.group' class
    group.appendChild(copyBtn);
});
using ZendaXArmory.Data;
using ZendaXArmory.Data.Entities;
using ZendaXArmory.Enums;

namespace ZendaXArmory.Data.Entities
{
    public class Caliber
    {

        public int Id { get; set; }

        public string Name { get; set; }
        
        public string Description { get; set; }

        public Country Country { get; set; }

        public int? ManufacturerId { get; set; }
        public Manufacturer? Manufacturers { get; set; }

        public double Price { get; set; }


    }
}
using ZendaXArmory.Data;
using ZendaXArmory.Data.Entities;
using ZendaXArmory.Enums;

namespace ZendaXArmory.Data.Entities
{
    public class Caliber
    {

        public int Id { get; set; }

        public string Name { get; set; }
        
        public string Description { get; set; }

        public Country Country { get; set; }

        public int? ManufacturerId { get; set; }
        public Manufacturer? Manufacturers { get; set; }

        public double Price { get; set; }


    }
}
Update Your Ubuntu Operating System:
------------------------------------
Step-1  //Install GIT//
sudo apt-get install git
 
Step-2 //Install Python//
sudo apt-get install python3-dev
 
Step-3
sudo apt-get install python3-setuptools python3-pip
 
Step-4 //Install Python Virtual Enviroment//
sudo apt-get install virtualenv
sudo apt install python3.10-venv
 
Step-5 //Install Software Properties Common//
sudo apt-get install software-properties-common

Step-6 // Install MYSQL Server//
sudo apt install mariadb-server
sudo mysql_secure_installation
 
Step-7 //Install Other Package//
sudo apt-get install libmysqlclient-dev
---------------------------
 
Step-8 // Setup the Server//
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

//--Empty or Clear Completly the CNF File and Copy the bellow Code and Paste it.....//
//Ctrl+s --- To Save file.
//Ctrl+x --- To Exit/Close the file.
=================================================
-------------------------------------------------

[server]
user = mysql
pid-file = /run/mysqld/mysqld.pid
socket = /run/mysqld/mysqld.sock
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
lc-messages-dir = /usr/share/mysql
bind-address = 127.0.0.1
query_cache_size = 16M
log_error = /var/log/mysql/error.log


[mysqld]
innodb-file-format=barracuda
innodb-file-per-table=1
innodb-large-prefix=1
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci


[mysql]
default-character-set = utf8mb4

-------------------------------------------------
=================================================
-------------------------------------------------
 
Step-9 //Restart SQL//
sudo service mysql restart
 
Step-10 // Install Redis Server//
sudo apt-get install redis-server
 
Step-11 // Install Curl//
sudo apt install curl 
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.profile

Step-12
// Install Node//
nvm install 18
nvm install 20
nvm install 21

Step-13 // Install NPM//
sudo apt-get install npm

Step-14 // Install Yarn//
sudo npm install -g yarn
 
Step-15 // Install PDF//
sudo apt-get install xvfb libfontconfig wkhtmltopdf
 
Step-16 // Install Frappe-Bench//
sudo -H pip3 install frappe-bench
bench --version

Step-17 // Initialize/Install Frappe-Bench//

bench init frappe-bench --frappe-branch version-15
or
bench init frappe-bench
or (For Beta Installation)
bench init frappe-bench --frappe-branch version-15-beta
or
cd frappe-bench/
bench start
 
Step-18 // create a site in frappe bench//
bench new-site site1.local
bench use site1.local
 
Step-19 //Install Payment Module//
bench get-app payments
bench --site site1.local install-app payments

Step-20 //Download ERPNExt//
bench get-app erpnext --branch version-15
or (For Beta Installation)
bench get-app erpnext --branch version-15-beta
//---OR----//
bench get-app https://github.com/frappe/erpnext --branch version-15
bench get-app https://github.com/frappe/erpnext --branch version-15-beta

Step-21 //Install ERPNExt//
bench --site site1.local install-app erpnext

Step-22 //BENCH START//
bench start
-------------------------------------------------
-------------------------------------------------
  
INSTALL HRMS
-------------
Step-22 //Download & Install HRMS //
To Install the Latest Version:
Latest Vesion is Version-16.xxx
bench get-app hrms
or
To Install Version-15
bench get-app hrms --branch version-15
bench --site site1.local install-app hrms
-----------------------------------------

INSTALL LOAN / LENDING
----------------------
Step-23 //Download Lending/Loan App//
bench get-app lending
bench --site site1.local install-app lending
--------------------------------------------
// IF ERROR AFTER HRM INSTALLATION//
bench update --reset

//IF ERROR Updating...//
//Disable maintenance mode
bench --site site1.local set-maintenance-mode off


INSTALL EDUCATION MODULE
------------------------
Step-24 //Install Education Module//
bench get-app education
bench --site site1.local install-app education
----------------------------------------------

INSTALL CHAT APP
---------------
Step-25
bench get-app chat
bench --site site1.local install-app chat
-----------------------------------------

INSTALL Print Designer
----------------------
//Please note that print designer is only compatible with develop and V15 version.//
bench start
bench new-site print-designer.test
bench --site print-designer.test add-to-hosts
bench get-app https://github.com/frappe/print_designer
bench --site print-designer.test install-app print_designer
-------
http://print-designer.test:8000/
http://print-designer.test:8000/app/print-designer/

-----------------------
INSTALL INSIGHTS
----------------
bench start
bench new-site insights.test
bench --site insights.test add-to-hosts
bench get-app https://github.com/frappe/insights
bench --site insights.test install-app insights
-------
http://insights.test:8000/insights
-----------------------------------------------

// IF ERROR//
bench update --reset

Step
//Disable maintenance mode
bench --site site1.local set-maintenance-mode off
_________________________________________________

//WARN: restart failed: couldnot find supervisorctl in PATH//

sudo apt-get install supervisor
sudo nano /etc/supervisor/supervisord.conf

     [inet_http_server]
     port = 127.0.0.1:9001
     username = your_username
     password = your_password

sudo nano /etc/supervisor/supervisord.conf


[program:supervisord]
command=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
autostart=true
autorestart=true
redirect_stderr=true
environment=PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/path/to/your/virtualenv/bin"

sudo service supervisor restart

//Check Supervisor Status://
sudo service supervisor status
sudo service supervisor start
which supervisorctl

//Check Permissions://
sudo usermod -aG sudo your_username
supervisorctl status

//Activate Virtual Environment//
source /path/to/your/virtualenv/bin/activate

//supervisorctl status//
sudo supervisorctl status

cd ~/frappe-bench
bench restart





  
javascript:window.onbeforeunload = function() { return false; }
google_tag_manager["GTM-WVQFPXJ"].dataLayer.get("gtm.element").mathes("a")
google_tag_manager["GTM-WVQFPXJ"].dataLayer.get("gtm.element")
$ fnm ls-remote # list remote Node.js versions
$ fnm install 16.5.0 # install a specific version
$ fnm use 14.17.5 # switch Node.js version
$ fnm ls # list installed versions
$ fnm default <version> # set a default version
Cannot GET /1fexd/LinkSheetNightly/releases/download/LinkSheet-2023-09-14T20_41_39-master-03e6f91-foss-nightly/LinkSheet-2023-09-14T20_41_39-master-03e6f91-foss-nightly.apk
npm install --save-dev webpack
star

Sun Sep 17 2023 15:15:24 GMT+0000 (Coordinated Universal Time) https://snakify.org/ru/lessons/integer_float_numbers/problems/sum_of_digits/

@nedimaon

star

Sun Sep 17 2023 14:07:00 GMT+0000 (Coordinated Universal Time)

@Ajay1212

star

Sun Sep 17 2023 14:04:49 GMT+0000 (Coordinated Universal Time)

@Ajay1212

star

Sun Sep 17 2023 13:09:11 GMT+0000 (Coordinated Universal Time)

@onlinecesaref #php

star

Sun Sep 17 2023 07:34:43 GMT+0000 (Coordinated Universal Time)

@akaeyad

star

Sun Sep 17 2023 07:29:01 GMT+0000 (Coordinated Universal Time)

@akaeyad

star

Sun Sep 17 2023 07:28:09 GMT+0000 (Coordinated Universal Time)

@kimthanh1511

star

Sun Sep 17 2023 06:30:28 GMT+0000 (Coordinated Universal Time)

@ldg471

star

Sun Sep 17 2023 04:46:17 GMT+0000 (Coordinated Universal Time) https://id.twitch.tv/oauth2/authorize

@Love_Code

star

Sat Sep 16 2023 20:50:58 GMT+0000 (Coordinated Universal Time)

@Victoria

star

Sat Sep 16 2023 20:15:16 GMT+0000 (Coordinated Universal Time)

@Victoria

star

Sat Sep 16 2023 18:52:18 GMT+0000 (Coordinated Universal Time) https://medium.com/@tobidsn/laravel-specific-table-migration-3b983a31bfd3

@oday

star

Sat Sep 16 2023 16:55:18 GMT+0000 (Coordinated Universal Time) https://code.visualstudio.com/docs/editor/command-line#_launching-from-command-line

@Anzelmo

star

Sat Sep 16 2023 12:18:22 GMT+0000 (Coordinated Universal Time)

@Shuhab #bash

star

Sat Sep 16 2023 11:00:57 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Sat Sep 16 2023 10:31:14 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Sat Sep 16 2023 10:21:39 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Sat Sep 16 2023 09:47:42 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Sat Sep 16 2023 09:28:49 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Sat Sep 16 2023 07:37:36 GMT+0000 (Coordinated Universal Time)

@akaeyad

star

Sat Sep 16 2023 06:53:16 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Sat Sep 16 2023 06:39:47 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Sat Sep 16 2023 06:30:29 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Sat Sep 16 2023 05:44:56 GMT+0000 (Coordinated Universal Time)

@Taimoor #terminal

star

Sat Sep 16 2023 05:16:29 GMT+0000 (Coordinated Universal Time)

@Alihaan #php

star

Fri Sep 15 2023 21:41:01 GMT+0000 (Coordinated Universal Time)

@yc_lan

star

Fri Sep 15 2023 20:43:56 GMT+0000 (Coordinated Universal Time) https://codepen.io/John-Davis-the-scripter/pen/oNJeQzK

@HumbleVibe #undefined

star

Fri Sep 15 2023 20:15:01 GMT+0000 (Coordinated Universal Time)

@anirudhnair42 #typescript

star

Fri Sep 15 2023 17:48:43 GMT+0000 (Coordinated Universal Time) https://www.checklyhq.com/product/monitoring-as-code/?utm_term

@Anzelmo

star

Fri Sep 15 2023 17:17:27 GMT+0000 (Coordinated Universal Time)

@jrg_300i #php #poo #mvc #jquery #postgresql

star

Fri Sep 15 2023 15:10:27 GMT+0000 (Coordinated Universal Time)

@akaeyad

star

Fri Sep 15 2023 15:10:07 GMT+0000 (Coordinated Universal Time)

@MohamedZhioua

star

Fri Sep 15 2023 12:13:35 GMT+0000 (Coordinated Universal Time) https://pve.proxmox.com/pve-docs/chapter-pvesr.html#_migrating_a_guest_in_case_of_error

@beerygaz #proxmox

star

Fri Sep 15 2023 11:43:30 GMT+0000 (Coordinated Universal Time) https://www.thiscodeworks.com/new

@henely

star

Fri Sep 15 2023 10:18:30 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Fri Sep 15 2023 10:07:22 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Fri Sep 15 2023 09:49:51 GMT+0000 (Coordinated Universal Time)

@Mohammadrezasmz

star

Fri Sep 15 2023 06:33:00 GMT+0000 (Coordinated Universal Time) https://codepen.io/andrewvink/pen/OgGeGr

@gshailesh27 ##multiselect ##jqueryfilter ##jquerycardfilter

star

Fri Sep 15 2023 06:27:24 GMT+0000 (Coordinated Universal Time)

@Astik

star

Fri Sep 15 2023 06:15:59 GMT+0000 (Coordinated Universal Time)

@harshvasu #javascript

star

Fri Sep 15 2023 06:01:03 GMT+0000 (Coordinated Universal Time)

@Ismaielov

star

Fri Sep 15 2023 06:00:38 GMT+0000 (Coordinated Universal Time)

@Ismaielov

star

Fri Sep 15 2023 03:27:52 GMT+0000 (Coordinated Universal Time)

@Taimoor #terminal

star

Thu Sep 14 2023 22:10:54 GMT+0000 (Coordinated Universal Time)

@clytie

star

Thu Sep 14 2023 22:10:16 GMT+0000 (Coordinated Universal Time)

@clytie

star

Thu Sep 14 2023 22:09:23 GMT+0000 (Coordinated Universal Time)

@clytie

star

Thu Sep 14 2023 21:45:27 GMT+0000 (Coordinated Universal Time) https://www.honeybadger.io/blog/node-environment-managers/

@bcjacob #nodejs

star

Thu Sep 14 2023 21:39:48 GMT+0000 (Coordinated Universal Time) https://gothub.frontendfriendly.xyz/1fexd/LinkSheetNightly/releases/download/LinkSheet-2023-09-14T20_41_39-master-03e6f91-foss-nightly/LinkSheet-2023-09-14T20_41_39-master-03e6f91-foss-nightly.apk?null

@Ivan5497

star

Thu Sep 14 2023 21:37:53 GMT+0000 (Coordinated Universal Time) https://gh.bloatcat.tk/webpack/webpack

@Ivan5497

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension