See Examples: -url: https://www.prisma.io/docs/prisma-orm/quickstart/postgresql
DIRECT_URL="postgres://USER:PASSWORD@db.prisma.io:5432/postgres?sslmode=require"
DATABASE_URL="postgres://USER:PASSWORD@pooled.db.prisma.io:5432/postgres?sslmode=require"
This file contains hidden or 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. Open CMD as administrator | |
| 2. taskkill /F /IM mysqld.exe >> ERROR: The process "mysqld.exe" not found. | |
| Step_1 >> cd "C:\Program Files\MySQL\MySQL Server 8.0\bin" | |
| Step_2 >> mysqld --initialize-insecure // Initialize(fresh setup) | |
| Step_3 >> mysqld --install MySQL80 // service installed | |
| Step_4 >> net start MySQL80 // start services | |
| Step_5 >> mysql -u root // login to mysql | |
| Step_6 >> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123'; // Password set karo | |
| Step_7 >> |
This file contains hidden or 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. converts the incoming data into a JavaScript object and makes it accessible through req.body | |
| // 2. { extended: true } is set, it supports >> nested objects and arrays << using the qs library. | |
| // 3. It only parses requests with Content-Type: application/x-www-form-urlencoded, ignoring other data formats. | |
| app.use(express.urlencoded({ extended: true })) | |
| app.get('/login', (req, res) => { | |
| res.send('<form method=POST action=/login><input type=text name=username><input type=number name=age><input type=submit></form>') | |
| }) | |
| express.raw() function: It parses incoming request payloads into a >> Buffer << and is based on body-parser. |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| <style> | |
| .container .slide .item { | |
| width: 200px; |
This file contains hidden or 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
| <html> | |
| <head></head> | |
| <body></body> | |
| </html> | |
| // js file | |
| function getColors(){ | |
| //rgb 0 - 255; | |
| let R = Math.floor(Math.random() * 255); | |
| let G = Math.floor(Math.random() * 255); |
This file contains hidden or 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
| // Callbacks | |
| function user(callback1){ | |
| let name = 'Gaurav'; | |
| setTimeout(()=> { | |
| callback1(name); // if callback not take argument give undefined | |
| }, 2000); | |
| } | |
| function userAge(name, callback2){ | |
| let age = name + ' age is 24.'; |
This file contains hidden or 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
| // Child Component (Custom Input + Auto Focus) | |
| // “forwardRef lets a parent component directly access a child’s DOM element or method through a ref, | |
| // which is not possible with normal props.” | |
| import React, { forwardRef } from "react"; | |
| const TextInput = forwardRef((props, ref) => { | |
| return <input ref={ref} {...props} />; | |
| }); |
This file contains hidden or 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
| export const regexValidators = { | |
| fullName: z | |
| .string() | |
| .regex(/^[a-zA-Z0-9_]{3,16}$/, "Only letters, numbers & underscore"), | |
| phone: z | |
| .string() | |
| .regex(/^\+91\d{10}$/, "Phone must be +91XXXXXXXXXX"), | |
| strongPassword: z |
This file contains hidden or 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 api from "./api"; // your axios instance | |
| export const checkEmailExists = async (email) => { | |
| try { | |
| const res = await api.post("/auth/check-email", { email }); | |
| return res.data.exists; // true / false | |
| } catch (e) { | |
| return false; | |
| } | |
| }; |
NewerOlder