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
// ==UserScript== | |
// @name Stem's Infra Template | |
// @namespace http://tampermonkey.net/ | |
// @source https://gist.github.com/NaveenDA/64c8ce07461e0c2f9feb6dabd1dcf00a | |
// @updateURL https://gist.githubusercontent.com/raw/64c8ce07461e0c2f9feb6dabd1dcf00a/main.js | |
// @downloadURL https://gist.githubusercontent.com/raw/64c8ce07461e0c2f9feb6dabd1dcf00a/main.js | |
// @version 2024-07-12 | |
// @description try to take over the world! | |
// @author naveenda | |
// @match https://web.whatsapp.com/* |
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,{useState} from "react"; | |
import ReactDOM from "react-dom"; | |
import { QueryClient, QueryClientProvider, useQuery } from "react-query"; | |
import { ReactQueryDevtools } from "react-query/devtools"; | |
const queryClient = new QueryClient(); | |
export default function App() { | |
return ( | |
<QueryClientProvider client={queryClient}> |
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 { QueryClient, QueryClientProvider, useQuery } from 'react-query' | |
const queryClient = new QueryClient() | |
export default function App() { | |
return ( | |
<QueryClientProvider client={queryClient}> | |
<Example /> | |
</QueryClientProvider> | |
) |
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 from "react"; | |
import { SWRConfig } from "swr"; | |
const App = () => { | |
return ( | |
<SWRConfig | |
value={{ | |
onError: (error, key) => { | |
if (error.status !== 403 && error.status !== 404) { | |
// We can send the error to Sentry, |
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 { mutate } from 'swr' | |
function prefetch () { | |
mutate('/api/data', fetch('/api/data').then(res => res.json())) | |
// the second parameter is a Promise | |
// SWR will use the result when it resolves | |
} |
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 useSWR from 'swr' | |
function Profile() { | |
const { data, error } = useSWR('/api/user', fetcher) | |
if (error) return <div>failed to load</div> | |
if (!data) return <div>loading...</div> | |
return <div>hello {data.name}!</div> | |
} |
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 } from "react"; | |
const SimpleComponent = () => { | |
useEffect(() => { | |
console.count("Component Rendered "); | |
}, []); | |
return <div></div>; | |
}; | |
export default SimpleComponent; |
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
[{ | |
"name": "Root", | |
"children": [ | |
{ | |
"name": "Child 1", | |
"children": [ | |
{ | |
"name": "Grand Child" | |
} | |
] |
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, { useState } from "react"; | |
import data from "./data.json"; | |
import Item from "./item"; | |
const SettingsPage = () => { | |
const [searchData, setSearchData] = useState(data); | |
const searchItem = (query) => { | |
if (!query) { | |
setSearchData(data); | |
return; |
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
Company | Valuation (US $billion) | Valution Date | Industry | |
---|---|---|---|---|
Paytm | 18 | March 2019 | E-commerce | |
OYO | 10 | June 2019 | Hospitality | |
Byju's | 10 | May 2020 | Education | |
Ola Cabs | 10 | October 2019 | Transportation | |
Swiggy | 3.3 | December 2018 | Online food delivery | |
Zomato | 3.25 | Apr 2020 | Online food delivery | |
Zerodha | 3 | August 2020 | Financial service | |
Udaan | 2.8 | August 2019 | B2B trade platform | |
ReNew Power | 2 | February 2017 | Renewable energy |
NewerOlder