Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
// Top level App component | |
import React from "react"; | |
import { ProvideAuth } from "./use-auth.js"; | |
function App(props) { | |
return ( | |
<ProvideAuth> | |
{/* | |
Route components here, depending on how your app is structured. | |
If using Next.js this would be /pages/_app.js |
import { useLayoutEffect, useCallback, useState } from 'react' | |
export const useRect = (ref) => { | |
const [rect, setRect] = useState(getRect(ref ? ref.current : null)) | |
const handleResize = useCallback(() => { | |
if (!ref.current) { | |
return | |
} |
# finds all *.js files that have either `</` or `/>` tags in them and renames them to *.jsx | |
find ./src -type f -name '*.js' -not -name '*.jsx' -not -name '*.ejs' -exec bash -c 'grep -l -E "</|/>" "$0"' {} \; -exec bash -c 'mv "$0" "${0%.js}.jsx"' {} \; |
#!/bin/bash | |
CURTAG=`git describe --abbrev=0 --tags`; | |
CURTAG="${CURTAG/v/}" | |
IFS='.' read -a vers <<< "$CURTAG" | |
MAJ=${vers[0]} | |
MIN=${vers[1]} | |
BUG=${vers[2]} |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; |