Skip to content

Instantly share code, notes, and snippets.

"""
Bitch(es) better have my money.
Instructions:
- Fill in TOTAL, SUBTOTAL, SHARED, and PEOPLE
- Run this script
- Profit
"""
TOTAL = <TOTAL>
// A Terraform settings block.
terraform {
backend "remote" {
// Point to the Terraform Enterprise cluster.
hostname = "my-terraform-enterprise-cluster.io"
// Name of team’s Organization in Terraform Enterprise.
organization = "my-organization”
workspaces {
// Name of the Workspace created from above.
// A Terraform resource that creates a Terraform Enterprise Workspace.
resource "tfe_workspace" "my_workspace" {
name = "my-workspace"
// Name of team’s Organization in Terraform Enterprise.
organization = "my-organization"
vcs_repo {
identifier = "my-git-repo"
}
// A Terraform settings block.
terraform {
backend "s3" {
// Name of the S3 bucket to store state in.
bucket = "my-bucket"
// The Terraform state’s key in the bucket.
key = "path/to/my/key"
// Enable AES-256 server-side encryption for Terraform state.
// A Jenkins Pipeline definition.
pipeline {
stages {
stage('Deploy Infrastructure') {
steps {
// Go into the Terraform directory.
dir("${WORKSPACE}/path/to/my/terraform") {
ansiColor('xterm') {
// Apply infrastructure changes.
sh "terraform apply -auto-approve"
const diffProps = (before, after) => (
Object.keys(after).map(k => before[k] !== after[k] ? {[k]: [before[k], after[k]]} : null).filter(x => x)
);
// Native JS
function validateSignature(token, url, parameters = {}, files = {}, signature) {
// sort the POST fields first and add them to the url
const paramKeys = Object.keys(parameters).sort();
const paramStr = paramKeys.reduce((acc, paramName) => {
return acc + paramName + parameters[paramName];
}, '');
// sort the files by field name and add their SHA1 sums to the URL
const fileKeys = Object.keys(files).sort();
kubectl get pods -a | grep Evicted | awk '{print $1}' | xargs kubectl delete pod

Keybase proof

I hereby claim:

  • I am cooltoast on github.
  • I am cooltoast (https://keybase.io/cooltoast) on keybase.
  • I have a public key ASBhjUqImZN1YcVLvNFXs3ahQUvszjm4ZPJwQhWlaZAlAQo

To claim this, I am signing this object:

@cooltoast
cooltoast / safari_lanscape_menu.js
Created July 28, 2017 22:44
Detect when iOS Safari landscape menu opens and closes
/**
* Credit to https://stackoverflow.com/a/29696509
*/
const isMobileSafari = () => {
const ua = window.navigator.userAgent;
const iOS = ua.match(/iPad/i) || ua.match(/iPhone/i);
const webkit = ua.match(/WebKit/i);
return iOS && webkit && !ua.match(/CriOS/i);
};