Skip to content

Instantly share code, notes, and snippets.

View dependabot-pr-body.txt
commit efcfd6e9de598a8fc151d25afed99c479760ed3c
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date: Wed Jun 29 04:31:48 2022 +0000
Bump turbo from 1.2.9 to 1.3.1 (#17)
Bumps [turbo](https://github.com/vercel/turborepo) from 1.2.9 to 1.3.1.
e notes</summary>
<p><em>Sourced from <a href="https://github.com/vercel/turborepo/releases">turbo's releases</a>.</em></p>
<blockquote>
@tomdavidson
tomdavidson / .kodiak.toml
Created Sep 20, 2022
kodiak, semantic pr, and dependabot
View .kodiak.toml
# yaml-language-server: $schema=https://json.schemastore.org/dependabot-2.0.json
version: 2
updates:
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'daily'
versioning-strategy: increase-if-necessary
@tomdavidson
tomdavidson / kubectl-db-tunnel.sh
Created Jun 2, 2022
k8s socat service to port fwd db access
View kubectl-db-tunnel.sh
#!/usr/bin/env bash
get_kubeconfig() {
mkdir -p "$HOME"/.kube
ssa-pg/scripts/pulumi-run.sh kubecfg > "$HOME"/.kube/config
}
PORT=${PORT:-5432}
SERVICE_NAME="postgres-tunnel"
@tomdavidson
tomdavidson / output.txt
Created May 4, 2022
gcp analyze-entities example
View output.txt
$ gcloud ml language analyze-entities --content="Adt Security Systems bankruptcy dept 1501 Yamato Rd. Boca Raton, FL 33431"
{
"entities": [
{
"mentions": [
{
"text": {
"beginOffset": 21,
"content": "bankruptcy dept"
},
@tomdavidson
tomdavidson / twf.md
Created Jan 6, 2022
moving forward trunk based workflow
View twf.md

Trunk-based Workflow

Multiple "right ways" to implement trunk-based delepment and workflow. For more info checkout trunkbaseddevelopment.com. Tom's "right way" emphisies forward moving flow and deploying from artifacts rather than git SHAs:

  • All code change starts and ends with the single, long-lived trunk, main. There are no release, prod, or other long-lived branches. Releases are cut from the trunk.

  • Code review will utilize GitHub PRs from short-lived branches targeting the main trunk. We call these short-lived branches, working branches, to avoid conflating feature-based workflow with our trunk-based workflow.

  • Prior to integration, the proposed change is fully tested, even deployed when end-to-end or manual acceptance tests are needed. Git Hooks are used to run unit tests and static analysis prior to pushing.

@tomdavidson
tomdavidson / scrit-as-root.sh
Created Nov 30, 2021
snippit to help with scripts that should be run as root
View scrit-as-root.sh
#!/usr/bin/env bash
if [ $SUDO_USER ]; then
realUser=$SUDO_USER
else
realUser=$(whoami)
fi
realUserHome=$(bash -c "cd ~$(printf %q "$realUser") && pwd")
@tomdavidson
tomdavidson / bootstrap.sh
Last active Nov 30, 2021
bootstrap script for setting up toms new computer
View bootstrap.sh
#!/usr/bin/env bash
# promts for sudo and can be installed via:
# wget -O - https://gist.githubusercontent.com/tomdavidson/64828803dbd4718514a465be1d7e908a/raw/75ec0521175b3d8b7d92c188d3dc0d251dbf5469/install-node-zx.sh | bash
! type sudo >/dev/null 2>&1 && apt install sudo && usermod -aG sudo "$(whoami)"
export CLOUDSDK_CORE_PROJECT='dots-333103'
# install NodeJS & zx if not already installed
@tomdavidson
tomdavidson / slugify.sh
Created Nov 20, 2021
Lowercased, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with '-'. No leading or trailing '-'. Useful with URLs, host names, domain names, and stack names.
View slugify.sh
#!/usr/bin/env bash
shopt -s extglob
# Lowercased, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with '-'.
# No leading or trailing '-'. Useful with URLs, host names, domain names, and stack names.
slugify() {
: "${1:?'Usage: slugify NAME'}"
local next="$1"
next="${next,,}" # lowercase
next="${next//+([^a-z0-9])/-}" # replace non-alphanumeric wiht '-'
next="${next#-}" # remove - from the start
View lolaus.sh
#!/usr/bin/env bash
set -euo pipefail
DEBUG=${DEBUG:-}
help() {
cat <<EOF
Simple monorepo lifecycle/pipeline tool for running one or more commands on one
or more directories that have diffs compared to an ancestor. The primary
View shellcheck.mjs
#!/usr/bin/env zx
const shellFiles = globby.globbySync(['**/*.sh', '**/*.bash'], { gitignore: true });
nothrow($`npx -y shellcheck -f diff ssa-pg/scripts/deploy-infra.sh | git apply`);