Skip to content

Instantly share code, notes, and snippets.

View dwmkerr's full-sized avatar

Dave Kerr dwmkerr

View GitHub Profile
@dwmkerr
dwmkerr / miro-dashboard-url.js
Created February 26, 2023 11:39
Miro - Get Project Dashboard URL
// finally - got from
// https://community.miro.com/ideas/project-links-and-sharing-1180/index2.html?postid=6066#post6066
// Run the below in the developer tools when the project dashboard is open.
dashboardData = JSON.parse(localStorage["rtb_saved_dashboard"]).tree.dashboard;
"https://miro.com/app/dashboard/?spaceId="+dashboardData.currentSpaceId+"&projectId="+dashboardData.currentProject.id;
@dwmkerr
dwmkerr / terraform-best-practicess.md
Created December 12, 2018 03:19
Notes on best practices for Terraform modules

(Disclaimer: work in progress!)

Consistent usage of count

Place count consistently in modules. count dramatically changes how a client will reason about a resource, so make it very clear what resources are dynamic.

@dwmkerr
dwmkerr / gpr.sh
Last active October 22, 2023 12:10
A shell command to push and open a pull request. Tested on OSX/Ubuntu. No dependencies.
# This function pushes the current branch to 'origin'. If a web address is shown
# in the output, it opens it up. On GitHub, GitLab and BitBucket, this means it
# will open the pull request for you!
#
# This is also part of the 'dotfiles' configration at:
# github.com/effective-shell/dotfiles
# Push the current branch to origin, set upstream, open the PR page if possible.
# Inspired by: https://gist.github.com/tobiasbueschel/ba385f25432c6b75f63f31eb2edf77b5
# How to get the current branch: https://stackoverflow.com/questions/1593051/how-to-programmatically-determine-the-current-checked-out-git-branch
@dwmkerr
dwmkerr / k8s-patch-virtualservice.go
Last active October 10, 2022 06:06
Example showing how to patch an Istio VirtualService CRDs Golang
// Example showing how to patch Kubernetes resources.
package main
import (
"encoding/json"
"fmt"
"k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/dynamic"
@dwmkerr
dwmkerr / k8s-list-virtualservices.go
Created October 8, 2018 10:05
Example showing how to list Istio VirtualService CRDs Golang
// Example showing how to patch Kubernetes resources.
package main
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/dynamic"
_ "k8s.io/client-go/plugin/pkg/client/auth"
@dwmkerr
dwmkerr / k8s-patch.go
Last active September 19, 2023 11:42
Example showing how to patch Kubernetes resources in Golang. Companion to the article 'https://dwmkerr.com/patching-kubernetes-resources-in-golang/'.
// Example showing how to patch kubernetes resources.
// This is the companion to my article 'Patching Kubernetes Resources in Golang':
// https://dwmkerr.com/patching-kubernetes-resources-in-golang/
package main
import (
"encoding/json"
"fmt"
types "k8s.io/apimachinery/pkg/types"
@dwmkerr
dwmkerr / availability_zones.tf
Last active February 18, 2020 08:20
Terraform AWS Regions and Availability Zones
// Gist: https://gist.github.com/dwmkerr/58bfbf55eb9f05c8603958806add00cc
// Source: https://aws.amazon.com/about-aws/global-infrastructure/
// Updated: 2018-02-27
// Examples:
// 1. Get the second az in singapore:
// "${element(var.aws_availability_zones['ap-southeast-1'], 0)}"
// Availability zones for each region
@dwmkerr
dwmkerr / setup-sublime3-for-angular2.md
Last active April 11, 2020 03:30
Quickly setup Sublime Text 3 for Angular 2

Quick Setup for Sublime Text 3 for Angular 2

Easy to remember, easy to forget.

Step 1: Download Sublime Text 3

Sublime Text 3 Download

Step 2: Create a bash shortcut

It's nice to be able to run subl in a terminal.