Skip to content

Instantly share code, notes, and snippets.

View suryanshsingh2001's full-sized avatar
Sipping Coffee

Suryansh Singh suryanshsingh2001

Sipping Coffee
View GitHub Profile
@suryanshsingh2001
suryanshsingh2001 / BookList-old.jsx
Last active October 7, 2023 09:42
Auth0 Workaround
import React, { useEffect, useState } from "react";
import axios from "axios";
import { useCart } from "../utils/CartContext"; // Import useCart hook
import { toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import { useAuth0 } from "@auth0/auth0-react"; // Import useAuth0 for user authentication
// Helper function to generate random integers
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
@suryanshsingh2001
suryanshsingh2001 / filter.js
Created October 1, 2023 19:35
30 Days of JS Leetcode in a nutshell
//2634. Filter Elements from Array
//filter function under the hood
/**
* @param {number[]} arr
* @param {Function} fn
* @return {number[]}
*/
var filter = function(arr, fn) {
var a = [];
for(let i = 0; i < arr.length; i++) {
@suryanshsingh2001
suryanshsingh2001 / index.css
Last active September 3, 2023 18:33
Tailwindcss Quick Start Guide
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer components {
.card {
@apply
m-10 rounded-lg bg-white px-6 py-8 shadow-xl ring-1 ring-slate-900/5 dark:bg-black
}