Skip to content

Instantly share code, notes, and snippets.

tomdavidson /
Created May 7, 2023 04:15
gen and trust local ssl cert - wip
#!/usr/bin/env bash
# $1 : relative filename
file_path() {
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
output() {
tomdavidson /
Last active May 8, 2023 03:29
snapd liberation without waiting for 24.04
#!/usr/bin/env bash
# Run on a new systems without downloading by
# `$ wget -O - | bash`
sudo systemctl disable snapd
sudo systemctl disable snapd.service
sudo systemctl disable snapd.socket
View eslint.config.js
// @ts-nocheck
import { env } from 'node:process';
import comments from 'eslint-plugin-eslint-comments';
import imprt from 'eslint-plugin-import'; // 'import' is ambiguous and prettier had trouble
import jest from 'eslint-plugin-jest';
import jestFmt from 'eslint-plugin-jest-formatting';
import n from 'eslint-plugin-n';
import nextjs from '@next/eslint-plugin-next';
import prettierConfig from 'eslint-config-prettier';
tomdavidson / dependabot-pr-body.txt
Created September 20, 2022 02:41
dependabot PR body
View dependabot-pr-body.txt
commit efcfd6e9de598a8fc151d25afed99c479760ed3c
Author: dependabot[bot] <49699333+dependabot[bot]>
Date: Wed Jun 29 04:31:48 2022 +0000
Bump turbo from 1.2.9 to 1.3.1 (#17)
Bumps [turbo]( from 1.2.9 to 1.3.1.
e notes</summary>
<p><em>Sourced from <a href="">turbo's releases</a>.</em></p>
tomdavidson / .kodiak.toml
Created September 20, 2022 02:38
kodiak, semantic pr, and dependabot
View .kodiak.toml
# yaml-language-server: $schema=
version: 2
- package-ecosystem: 'npm'
directory: '/'
interval: 'daily'
versioning-strategy: increase-if-necessary
tomdavidson /
Created June 2, 2022 15:48
k8s socat service to port fwd db access
#!/usr/bin/env bash
get_kubeconfig() {
mkdir -p "$HOME"/.kube
ssa-pg/scripts/ kubecfg > "$HOME"/.kube/config
tomdavidson / output.txt
Created May 4, 2022 21:58
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 /
Created January 6, 2022 06:12
moving forward trunk based workflow

Trunk-based Workflow

Multiple "right ways" to implement trunk-based delepment and workflow. For more info checkout 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 /
Created November 30, 2021 16:06
snippit to help with scripts that should be run as root
#!/usr/bin/env bash
if [ $SUDO_USER ]; then
realUserHome=$(bash -c "cd ~$(printf %q "$realUser") && pwd")
tomdavidson /
Last active November 30, 2021 06:07
bootstrap script for setting up toms new computer
#!/usr/bin/env bash
# promts for sudo and can be installed via:
# wget -O - | 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