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
/** | |
* Prompts a user when they exit the page | |
*/ | |
import { useCallback, useContext, useEffect } from 'react'; | |
import { UNSAFE_NavigationContext as NavigationContext } from 'react-router-dom'; | |
function useConfirmExit(confirmExit: () => boolean, when = true) { | |
const { navigator } = useContext(NavigationContext); |
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 firebase from "firebase/app"; | |
import "firebase/auth"; | |
import { gql, GraphQLClient } from "graphql-request"; | |
import { SWRConfig } from "swr"; | |
import create from "zustand"; | |
import { computed } from "zustand-middleware-computed-state"; | |
const firebaseConfig = { | |
// | |
}; |
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
#!/usr/bin/env bash | |
# Requires a CLI token | |
DOPPLER_TOKEN="$(doppler configure get token --plain)" \ | |
DOPPLER_PROJECT="$(doppler configure get project --plain)" \ | |
DOPPLER_CONFIG="$(doppler configure get config --plain)" \ | |
\ | |
SERVICE_TOKEN=$(curl -sS --request POST \ | |
--url https://api.doppler.com/v3/configs/config/tokens \ |
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
#delete all the remote tags with the pattern your looking for, ie. DEV- | |
git tag | grep <pattern> | xargs -n 1 -i% git push origin :refs/tags/% | |
#delete all your local tags | |
git tag | xargs -n 1 -i% git tag -d % | |
#fetch the remote tags which still remain | |
git fetch |
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
# put this in your .bash_profile | |
if [ $ITERM_SESSION_ID ]; then | |
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND"; | |
fi | |
# Piece-by-Piece Explanation: | |
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment | |
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too | |
# the $PROMPT_COMMAND environment variable is executed every time a command is run | |
# see: ss64.com/bash/syntax-prompt.html |