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 Image from "next/image"; | |
import Link from "next/link"; | |
import { Button } from "../ui/button"; | |
interface Props { | |
id: string; | |
name: string; | |
username: string; | |
imgUrl: string; |
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
/** | |
* Returns the data type based on the base64 string | |
* @param {String} base64String | |
* @param {String} fileName | |
* @returns {String} | |
*/ | |
detectMimeType(base64String, fileName) { | |
var ext = fileName.substring(fileName.lastIndexOf(".") + 1); | |
if (ext === undefined || ext === null || ext === "") ext = "bin"; | |
ext = ext.toLowerCase(); |
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
# KEYCLOAK BASE URL | |
KEYCLOAK_BASE_URL= | |
# KEYCLOAK CLIENT SECRET | |
KEYCLOAK_CLIENT_SECRET= | |
# KEYCLOAK CLIENT ID | |
KEYCLOAK_CLIENT_ID= | |
# BASE URL FOR NEXT AUTH |
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 * as z from 'zod'; | |
type isAny<T> = [any extends T ? 'true' : 'false'] extends ['true'] | |
? true | |
: false; | |
type nonoptional<T> = T extends undefined ? never : T; | |
type nonnullable<T> = T extends null ? never : T; | |
type equals<X, Y> = [X] extends [Y] ? ([Y] extends [X] ? true : false) : false; | |
export type toZod<T> = { |
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
Note: I don't know where does this thread belongs. If I'm on the incorrect section, move it to the correct one. | |
Many people are literally just selling this method and I feel like sharing this out so that you don't have to pay because the seller just don't do a minute of work to get you the drive. | |
So moving straight towards the method: | |
Step I: | |
Go to this link: https://td.fastio.me/ (mirrors to be left at the last) | |
Step II: | |
Type your desired drive's name at the first field and your Gmail on the bottom field. |
This Gist works for CRA 3. For CRA 4, you can try community maintained craco plugin for converting to a single-spa application at https://github.com/hasanayan/craco-plugin-single-spa-application (thanks @hasanayan):
- Install react-app-rewired, as explained in https://github.com/timarney/react-app-rewired.
- Create a file in src called
single-spa-entry.js
(or tsx for typescript) - Modify config-overrides.js, as shown in the config-overrides.js file provided in this gist.
- (Optional) remove src/main.js, since single-spa-entry is the new entry
- (Optional) remove public/index.html, since single-spa applications share a single html file, instead of one html file per project.
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
// Providing Context | |
// ================== | |
import React, {useState, useEffect} from "react" | |
const Context = React.createContext() | |
function ContextProvider({children}) { | |
const [allPhotos, setAllPhotos] = useState([]) | |
const [cartItems, setCartItems] = useState([]) |
NewerOlder