Skip to content

Instantly share code, notes, and snippets.

View Gowiem's full-sized avatar
🌤️
Stoked on Terraforming

Matt Gowie Gowiem

🌤️
Stoked on Terraforming
View GitHub Profile
@Gowiem
Gowiem / atmos_tfstate_migration.sh
Last active March 26, 2024 14:02
Atmos based Across Statefile Terraform State Migration Script
#!/usr/bin/env bash
###
### This is intended to be copied and stored alongside your Terraform code. This keeps a historical record of your various migrations.
### It requires editing for each migration that you want to do according to the source + destination root modules and the resources you intend to move.
###
### This is dependent on the $ATMOS_STACK environment variable (available when using Atmos / Spacelift automated via https://github.com/cloudposse/terraform-spacelift-cloud-infrastructure-automation)
### for the WORKSPACE that you're moving from, but you can obviously update that if you're not working in that environment.
set -eu -o pipefail
@Gowiem
Gowiem / rack_stats.rb
Created February 16, 2016 18:03
Rack Middleware for collecting Rails stats on Controller, Action, and Global response times and response code
# Heavily inspired by:
# scout_statsd_rack -- https://github.com/scoutapp/scout_statsd_rack/blob/master/lib/scout_statsd_rack.rb
# trashed -- https://github.com/basecamp/trashed
# Add to Rails App: `config.middleware.use RackStats`
class RackStats
attr_accessor :app
def initialize(app)
@app = app
end
#!/bin/bash
GITHUB_USERNAME=Gowiem
MINS_AGO=$(date -v-30M -u +"%Y-%m-%dT%H:%M:%SZ")
PRS_CREATED_RECENTLY=$(curl -u $GITHUB_USERNAME:$GITHUB_API_TOKEN \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/issues?since=$MINS_AGO&per_page=100")
PR_URLS=($(echo $PRS_CREATED_RECENTLY | jq -r ".[].pull_request.url | @sh"))
@Gowiem
Gowiem / gist:2917996
Created June 12, 2012 14:52
Send data in bundle
Intent mPoiDetailIntent = new Intent(PoiListActivity.this, PoiDetailActivity.class);
mPoiDetailIntent.putExtra("POINT_OF_INTEREST", poiClicked);
startActivity(mPoiDetailIntent);
// Then in the activtity that is recieving, so the PoiDetailActivity.class:
Bundle b = getIntent().getExtras();
if(b != null){ // Activity started from PoiListActivity
mPointOfInterest = (PointOfInterest) b.getSerializable("POINT_OF_INTEREST");
#!/bin/zsh
if [ ! -f README.yaml ]; then
echo "Too old."
exit 0
fi
if [ ! -f versions.tf ]; then
echo "Too old."
exit 0
#!/bin/bash
if [ ! -f README.yaml ]; then
echo "Too old."
exit 0
fi
if [ ! -f versions.tf ]; then
echo "Too old."
exit 0
@Gowiem
Gowiem / chatops.sh
Created July 7, 2020 23:57
CloudPosse Terraform ChatOps Update
#!/bin/bash
if [ ! -f README.yaml ]; then
echo "Too old."
exit 0
fi
if [ ! -d ./test/src/ ]; then
echo "Too old."
exit 0

Keybase proof

I hereby claim:

  • I am Gowiem on github.
  • I am gowiem (https://keybase.io/gowiem) on keybase.
  • I have a public key whose fingerprint is A9EF C5FB 5653 47B5 9038 2B42 2838 626E 0AAC 0ECD

To claim this, I am signing this object:

@Gowiem
Gowiem / remote_config.yml
Last active November 28, 2018 19:57
Remote config file for Ansible playbook take home interview test
remote_var: "val"
@Gowiem
Gowiem / load-form-tree.js
Created October 31, 2017 15:07
A complicated model tree loading function
import Ember from 'ember';
import DS from 'ember-data';
const { RSVP } = Ember;
const { PromiseObject } = DS;
async function loadSections(form) {
return form.get('formSections');
}