- npm init -y
- npm i express cors dotenv mongodb mongoose
- npm i ts-node typescript @types/node @types/express @types/cors nodemon --save-dev
- change the main and scripts in package.json
- npx tsc --init
- then tsconfig me u can make changes if needed
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
#include <iostream> | |
using namespace std; | |
//using structure | |
struct Node { | |
int data; | |
Node* next; | |
}; | |
//fn to insert element at tail |
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
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.8; | |
contract variables{ | |
uint var1; | |
bool var2; | |
string var3; | |
address var4; | |
function getFunction(uint _val1,bool _val2,string memory _val3,address _val4) public { | |
var1=(_val1); | |
var2=_val2; |
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
#include <bits/stdc++.h> | |
using namespace std; | |
int main() { | |
string str2= "lelo"; | |
string str1= "hello"; | |
int count=0; | |
for(int i =0;i<str2.size();i++){ | |
for(int j=0;j<str1.size();j++){ | |
if(str2[i] ==str1[j]) { |
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
interface CircularProgressProps { | |
value: number; | |
size: number; | |
strokeWidth: number; | |
children?: React.ReactNode; | |
} | |
export function CircularProgress({ | |
value, | |
size, |
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 { Text as RNText, TextProps } from "react-native"; | |
type TextElement = "h1" | "h2" | "h3" | "h4" | "p" | "span"; | |
type FontWeight = "regular" | "medium" | "semibold" | "bold"; | |
interface TextProperties extends TextProps { | |
as?: TextElement; | |
weight?: FontWeight; | |
className?: string; | |
children: React.ReactNode; |
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 useMousePosition = (global: boolean = true) => { | |
const [mouseCoords, setMouseCoords] = useState<{ | |
x: number; | |
y: number; | |
}>11 | |
х: 0, | |
y: 0, | |
}) ; | |
const handleMouseMovement = (event: | |
setMouseCoords ({ |
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 React, { createContext, useContext, useEffect, useState } from 'react'; | |
import { View, Text, Button, StyleSheet, Image } from 'react-native'; | |
import { Stack, Redirect, router } from 'expo-router'; | |
import AsyncStorage from '@react-native-async-storage/async-storage'; | |
import Onboarding from 'react-native-onboarding-swiper'; | |
// Auth Context to manage user session | |
interface AuthContextType { | |
session: string | null; | |
isLoading: boolean; |
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
class DisjointSet{ | |
public: | |
vector<int> rank,parent,size; | |
DisjointSet(int n){ | |
rank.resize(n+1,0); | |
parent.resize(n+1); | |
size.resize(n+1); | |
for(int i=0;i<=n;i++){ | |
parent[i]=i; | |
size[i]=1; |
OlderNewer