See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
export const App = () => { | |
const [toastVisible, setToastVisible] = useState(false); | |
const [toastError, setToastError] = useState(""); | |
const [authState, setAuthState] = React.useState<AuthState>(); | |
const [user, setUser] = React.useState<object | undefined>(); | |
useEffect(() => { | |
Hub.listen("auth", (res) => { | |
const errorMsg = res.payload.data?.message |
import { createUseStyles } from 'react-jss'; | |
const useStyles = createUseStyles(() => ({ | |
middle: { | |
display: 'flex', | |
justifyContent: 'center', | |
alignItems: 'center', | |
}, | |
heading: ({ color, fontSize }) => ({ | |
extend: 'middle', |
import Document, { Html, Head, Main, NextScript } from "next/document"; | |
import { SheetsRegistry, JssProvider, createGenerateId } from "react-jss"; | |
class MyDocument extends Document { | |
static async getInitialProps(ctx) { | |
const registry = new SheetsRegistry(); | |
const generateId = createGenerateId(); | |
const originalRenderPage = ctx.renderPage; | |
ctx.renderPage = () => | |
originalRenderPage({ | |
enhanceApp: (App) => (props) => ( |
import { ThemeProvider } from "react-jss" | |
const theme = { | |
black: "#000000", | |
primary: "#0c0c0c", | |
secondary: "#898880", | |
secondaryLight: "#C5C3BC", | |
accent: "#80722A", | |
accentMid: "#E9E7DE" | |
} |
import Document, { Html, Head, Main, NextScript } from "next/document"; | |
class MyDocument extends Document { | |
render() { | |
return ( | |
<Html> | |
<Head> | |
<link rel="icon" href="link to favicon" /> | |
<link href="link to font" rel="stylesheet"> |
var minimizeNumber = (num) => { | |
if(!Number.isFinite(num)) return ""; | |
const minimizeMap = ["K", "M", "G", "T", "P", "E"]; | |
if(num < 1000) return num.toString(); | |
const exp = Math.floor(Math.log(num)/ Math.log(1000)); | |
const minimized = Number((num / Math.pow(1000, exp)).toFixed(2)); | |
return minimized+minimizeMap[exp-1]; | |
} |
git config core.sparsecheckout true | |
echo [dirname] >> .git/info/sparse-checkout | |
git remote add -f origin [main-github-repo-url] | |
git pull origin master |
for entry in *.png | |
do | |
convert $entry -quality 60 $entry | |
done |