Skip to content

Instantly share code, notes, and snippets.

@mattslack
mattslack / bb.sh
Last active July 23, 2021 13:02
Open a new PR in BitBucket with the branches pre-selected
#!/usr/bin/env bash
#
# Name this file 'bb', put it somehwere in your PATH and make it executable.
#
if [[ $# -eq 0 ]]; then
echo ""
echo " Create a pull request on BitBucket"
echo ""
@mattslack
mattslack / deploy
Created August 2, 2023 20:41
Deploy to fly.io
#!/usr/bin/env bash
generate_label () {
SHA=$(git rev-parse --short HEAD)
if [ -z "$(git status --porcelain | wc -l)" ]; then
STATE="clean"
else
STATE="dirty"
fi
LABEL="deployment-${SHA}-${STATE}"
@mattslack
mattslack / pull-config.sh
Last active August 4, 2023 20:36
Pull craftcms project config down from production on fly.io
#!/bin/sh
# Pull down the current project config from production and overwrite the local
# config files with it.
cd "$(git rev-parse --show-toplevel)" || exit 1
if [ -n "$(git status --porcelain config/project)" ]; then
echo "You have uncommitted changes to your local project config."
exit 1
fi