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
# install psql | |
brew install libpq | |
ln -s /usr/local/Cellar/libpq/12.2_1/bin/psql /usr/local/bin/psql | |
# Mac: install cloud sql proxy | |
curl -o cloud_sql_proxy https://dl.google.com/cloudsql/cloud_sql_proxy.darwin.amd64 | |
chmod +x cloud_sql_proxy | |
# start proxy | |
# INSTANCE_NAME example - kuber-test-02:us-central1:dev-server |
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
#!/bin/bash | |
# Include any branches for which you wish to disable this script | |
if [ -z "$BRANCHES_TO_SKIP" ]; then | |
BRANCHES_TO_SKIP=(master develop staging test) | |
fi | |
# Get the current branch name and check if it is excluded | |
BRANCH_NAME=$(git symbolic-ref --short HEAD) | |
BRANCH_EXCLUDED=$(printf "%s\n" "${BRANCHES_TO_SKIP[@]}" | grep -c "^$BRANCH_NAME$") | |
# Trim it down to get the parts we're interested in | |
TRIMMED=$(echo $BRANCH_NAME | sed -e 's:^\([^-]*\)-.*:\1:' -e \ |
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
find . -maxdepth 1 -type d -mindepth 1 -exec du -hs {} \; |
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
public static <T> T uncheckCall(Callable<T> callable) { | |
try { return callable.call(); } | |
catch (Exception e) { return sneakyThrow(e); } | |
} | |
public static void uncheckRun(RunnableExc r) { | |
try { r.run(); } catch (Exception e) { sneakyThrow(e); } | |
} | |
public interface RunnableExc { void run() throws Exception; } |