start new:
tmux
start new with session name:
tmux new -s myname
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \; |
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
#!/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]} |
# 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"' {} \; |
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 | |
} |
// 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 |