Skip to content

Instantly share code, notes, and snippets.

View wyattfry's full-sized avatar
🏠
Working from home

Wyatt Fry wyattfry

🏠
Working from home
View GitHub Profile
@wyattfry
wyattfry / pre-commit
Last active May 15, 2025 17:57
Terraform / AzureRM
#!/usr/bin/env bash
set -euo pipefail
# A script to place in .git/hooks/ to perform
# some quick preliminary checks before committing
# code to the AzureRM Terraform Provider repo
# It assumes the repo dir is in $HOME
# To temporarily disable, you can do this: `USE_HOOK=false git commit`
@wyattfry
wyattfry / lapis.js
Created February 26, 2024 15:55
General Assembly JS
const options = ["Lapis", "Papyrus", "Scalpellus"];
const name = {
player: "Player",
computer: "J. Scripticus"
};
const choice = {
player: null,
computer: null
};
@wyattfry
wyattfry / env0.tf
Last active January 24, 2024 21:57
Terraform / Env0
# This TF config can be used in a root module to automatically
# structure Env0 after your Terraform repo. That is:
# - root modules (i.e. directories with .tf files, whose parent directories lack .tf
# files) become Env0 Templates
# - directories without .tf files become Env0 Projects (supports
# arbitrarily deep directories / sub-projects)
# - .tfvars files in root modules become Env0 Environments
# Example: if your repo looked like this:
#
# backends/
@wyattfry
wyattfry / .vimrc
Created September 23, 2022 14:54
vimrc for yaml
" taken from https://www.krenger.ch/blog/vim-settings-for-yaml-files/
set ts=2
set sts=2
set sw=2
set expandtab
syntax on
filetype indent plugin on
set ruler
@wyattfry
wyattfry / az-tf-sb-sync.sh
Last active October 14, 2021 16:50
Azure Terraform
#!/usr/bin/env bash
set -e
usage() {
>&2 echo \
"$0 - Import missing Azure service bus resources into Terraform state
Usage: $0 [h] TF_DIR
-v verbose
-h print this help message
#!/usr/bin/env bash
# Generates a kebab case string of random words, defaults to 5
# Expects a text file of new line delimited words at /usr/share/dict/words
# If you're on Ubuntu, try running e.g. sudo apt install wamerican
set -e
get_word() {
lines=$(cat /usr/share/dict/words | wc -l)
i=$(( ($lines + $RANDOM) % $lines ))
head -$i /usr/share/dict/words | tail -1 | tr -d '\n' | tr -d "'";