Skip to content

Instantly share code, notes, and snippets.

View jeremywadsack's full-sized avatar

Jeremy Wadsack jeremywadsack

View GitHub Profile
@jeremywadsack
jeremywadsack / load_balancer
Created March 28, 2017 21:54
Create a Google Cloud HTTPS Load Balancer (with Cloud CDN) that fronts a Kubernetes service hosted in a GKE cluster exposed on a NodePort.
#!/usr/bin/env bash
# TODO: Fill in these details for the cluster and project:
# The GKE cluster
CLUSTER=
# Assume the app is named the same as the working directory
APP=$(basename $(pwd))
# The GKE tag that identifies the cluster nodes
CLUSTER_TARGET_TAG=
# Expects to have `tls.crt` and `tls.key` in this folder
@jeremywadsack
jeremywadsack / retry_stripe_webhook.rb
Created May 29, 2019 17:37
Retry failed Stripe Webhook events
# frozen_string_literal: true
# Stripe will retry failed webhooks seven times with exponential backoff. If that has been exceeded
# then the webhook event is marked "failed" and won't be retried. We can resend the event by [retrieving
# the event data and posting it to the
# webhook](https://groups.google.com/a/lists.stripe.com/forum/#!topic/api-discuss/N33ZXqp3NzI).
#
# To use this, configure your endpoint URL below, then run this in providing event IDs on the command line.
WEB_HOOK = "YOUR ENDPOINT HERE"
@jeremywadsack
jeremywadsack / duplicate-cross-company.sql
Last active December 14, 2022 05:03
Employees with duplicate phone numbers that are cross-company
select
e.phone_number,
e.name,
e.public_id as employee_public_id,
c.name as company_name,
c.public_id as company_public_id,
d.name as division_name,
d.public_id as division_public_id
from customers_employee e
left join customers_company c on e.company_id = c.id