Skip to content

Instantly share code, notes, and snippets.

View harsh317's full-sized avatar
🎯
Focusing

HarshVardhan Jain harsh317

🎯
Focusing
View GitHub Profile
@harsh317
harsh317 / UserAuthContext.js
Last active June 25, 2022 06:29
Complete file
import React, { useContext, useState, useEffect } from "react";
import {
createUserWithEmailAndPassword,
signInWithEmailAndPassword,
onAuthStateChanged,
signOut,
GoogleAuthProvider,
signInWithPopup,
sendPasswordResetEmail,
confirmPasswordReset,
@harsh317
harsh317 / UserAuthContext.js
Created June 25, 2022 05:08
Our Context API file with basic Functions
import React, { useContext, useState, useEffect } from "react";
import {
createUserWithEmailAndPassword,
signInWithEmailAndPassword,
onAuthStateChanged,
signOut,
GoogleAuthProvider,
signInWithPopup,
} from "firebase/auth";
import { doc, setDoc } from "firebase/firestore";
@harsh317
harsh317 / App.js
Last active June 20, 2022 00:19
App.js but with add Routes in App ;)
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import "react-notifications/lib/notifications.css";
import { NotificationContainer } from "react-notifications";
import { createStore, combineReducers, applyMiddleware } from "redux";
import { Provider } from "react-redux";
import ReduxThunk from "redux-thunk";
import Homescreen from "./Screens/Homescreen/Homescreen"; // |
import PagenotFound from "./Screens/PageNotFound/PagenotFound"; // |
import ForgotPassword from "./Screens/ForgotPassword/ForgotPassword"; // |
@harsh317
harsh317 / BasicScreen.js
Last active June 19, 2022 12:25
A basic screen code which you will copy to all the screens
import React from "react";
const PagenotFound = () => { // Change here the Name accordingly
return (
<div>
<h1>Page Not Found</h1>
{/* Chnage here accordingly too */}
</div>
);
};
@harsh317
harsh317 / App.js
Last active June 18, 2022 09:09
Basic App.js file (Adding redux)
import { createStore, combineReducers, applyMiddleware } from "redux";
import { Provider } from "react-redux";
import ReduxThunk from "redux-thunk";
import Homescreen from "./Screens/Homescreen/Homescreen";// |
import PagenotFound from "./Screens/PageNotFound/PagenotFound";// |
import ForgotPassword from "./Screens/ForgotPassword/ForgotPassword";// |
import UserActions from "./Screens/UserActions/UserActions";// |
import Upload from "./Screens/Upload/Uplaod";// | Some screens with dummy data (FOR NOW)
import WatchScreen from "./Screens/WatchScreen/WatchScreen";// |
@harsh317
harsh317 / Auth.js
Created June 18, 2022 05:06
these will be the initial state of our Auth.js reducer
import { SET_UserDetails } from "../actions/Auth";
const initialState = {
userInfo: null,
};
export default (state = initialState, action) => {
switch (action.type) {
default:
return state;
@harsh317
harsh317 / Inconsolata-dz-Powerline.otf
Created October 31, 2021 16:56 — forked from qrush/Inconsolata-dz-Powerline.otf
vim-powerline patched fonts
@harsh317
harsh317 / A simple file to get distance result using beautifulsoup
Last active December 19, 2020 08:42
A simple file to get distance result from google using beautifulsoup
import requests
import re
from bs4 import BeautifulSoup
headers = {
"User-Agent":'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36'}
st = input("enter from:")
sto = input("enter to:")
base = 'https://www.google.com/search?safe=active&rlz=1C1YQLS_enIN897IN897&biw=1366&bih=657&sxsrf=ALeKk02Y8GEcD4XWh64yCvecTCetld-HZQ%3A1608364202503&ei=qrDdX5WVHtSprtoPmu6HiA0&q=distance+between+'
url = (base+st+'+and+'+sto)