This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useRef } from "react"; | |
export default function InputCode({ length }: { length: number }) { | |
const inputRefs = Array.from({ length }, () => | |
useRef<HTMLInputElement>(null) | |
); | |
useEffect(() => { | |
const handleKeyPress = (index: number, event: KeyboardEvent) => { | |
setTimeout(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Grid System: | |
- Replace `.container` with `.container` in Tailwind. | |
- Replace `.row` with `.flex` in Tailwind. | |
- Replace `.col-*-*` with `.w-*` in Tailwind, where the asterisks represent the appropriate width classes. | |
- Update any additional grid-related classes to their respective Tailwind equivalents. | |
2. Typography: | |
- Replace heading classes like `.h1`, `.h2`, etc., with `.text-<size>` in Tailwind. | |
- Replace paragraph classes like `.lead` with `.text-lg` in Tailwind. | |
- Update text alignment classes, such as `.text-left`, `.text-right`, etc., to their Tailwind equivalents. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To deploy a Next.js project to a Windows Server running IIS using Docker, you can follow these steps: | |
Build a Docker image for your Next.js application using a Dockerfile. Here's an example Dockerfile: | |
bash | |
# Use the official Node.js runtime as a parent image | |
FROM node:14 | |
# Set the working directory to /app | |
WORKDIR /app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploying a Next.js project to a Windows Server running IIS involves several steps. Here are the high-level steps you can follow: | |
Build your Next.js project using the following command: | |
npm run build | |
This will create a production build of your project in the ./out directory. | |
Create a new website in IIS and configure it to use the ./out directory as the physical path. | |
Set up the Node.js IIS HTTP Module on your server if it's not already installed. You can download and install it from the official Microsoft website. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.sk-loading { | |
background: linear-gradient( 90deg, #f4f4f5, #e6e6e6, #f4f4f5, #e6e6e6, #f4f4f5); | |
background-size: 500% 500%; | |
animation: gradient 1s ease infinite; | |
color: transparent !important; | |
border-radius: .5rem; | |
-webkit-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
user-select: none; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def send_test_msg() { | |
url = "http://www.payamak.vip/api/v1/RestWebApi/SendBatchSms" | |
body = { | |
'userName': username, | |
'password': password, | |
'fromNumber': sender_number, | |
'toNumbers': number_list, # array | |
'messageContent': message, | |
'isFlash': False, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo systemctl restart gunicorn | |
sudo systemctl daemon-reload | |
sudo systemctl restart gunicorn.socket gunicorn.service | |
sudo nginx -t && sudo systemctl restart nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convertPersianNumberToEnglishNumbers(num) { | |
const persianNumberList = [/۱/g, /۲/g, /۳/g, /۴/g, /۵/g, /۶/g, /۷/g, /۸/g, /۹/g, /۰/g]; | |
const englishNumberList = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']; | |
persianNumberList.forEach((persianNumber, index) => { | |
num = num.replace(persianNumber, englishNumberList[index]); | |
}); | |
return num; | |
} |