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
async function getUser(url) { | |
try { | |
const response = await fetch(url, { | |
method: 'GET', | |
headers: { | |
accept: 'application/json', | |
}, | |
}); | |
if (!response.ok) { |
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
ssh-keygen -t rsa -C "[email protected]" | |
$ ssh-add ~/.ssh/id_firstkey | |
$ ssh-add ~/.ssh/id_secondkey | |
$ ssh-add -D | |
$ ssh-add -l | |
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, { createContext } from "react"; | |
export type RejectedFileType = { | |
rejectedFiles: any[]; | |
currentPage: number; | |
totalRecords: number; | |
sortByObject: Record<string, string> | |
loading: boolean; | |
error: 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
html { | |
max-width: 70ch; | |
padding: 3em 1em; | |
margin: auto; | |
line-height: 1.75; | |
font-size: 1.25em; | |
} | |
h1,h2,h3,h4,h5,h6 { |
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
.gradient-bg-welcome { | |
background-color: #0f0e13; | |
background-image: radial-gradient( | |
at 0% 0%, | |
hsla(253, 16%, 7%, 1) 0, | |
transparent 50% | |
), | |
radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%), | |
radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%); | |
} |
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 { useEffect } from "react"; | |
import { useState } from "react"; | |
export default function useElementPosition(el) { | |
function getElement(x, y) { | |
return { | |
x, | |
y, | |
}; | |
} |
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, { createContext, useReducer, useContext } from "react"; | |
// Define the context | |
const GlobalStateContext = createContext(); | |
const GlobalDispatchContext = createContext(); | |
// Reducer | |
const globalReducer = (state, action) => { | |
switch (action.type) { | |
case "TOGGLE_THEME": { |
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
const filename = 'data.json'; | |
const jsonStr = JSON.stringify(JsonExport); | |
let element = document.createElement('a'); | |
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(jsonStr)); | |
element.setAttribute('download', filename); | |
element.style.display = 'none'; | |
document.body.appendChild(element); |
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
scripts: { | |
"build": "GENERATE_SOURCEMAP=false react-scripts build" | |
} | |
# Netlify | |
CI=false npm run build |
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
[build] | |
command = "CI=false npm run build" | |
publish = "/build" | |
base = "/" | |
[[redirects]] | |
from = "/*" | |
to = "/index.html" | |
status = 200 |
NewerOlder