Skip to content

Instantly share code, notes, and snippets.

View joram's full-sized avatar

John Oram joram

View GitHub Profile
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import stripe
stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
stripe.api_version = '2020-08-27' # this is important. pin your version to avoid breaking changes.
def create_a_customer(name, age):
customer = stripe.Customer.create(
name=name,

Microservice Notes

Problems with a Large Codebase

  • cognitive load
  • unintended side effects
  • releasing everything when you changed one thing
  • scaling due to load on one component means you need to scale all components
  • all must use the same framework/libraries/stack

How to mitigate these problems

@joram
joram / a good system is.md
Last active December 8, 2021 23:40
An opinionated check list for what makes a good service/system

A good distributed system is...

Scaling

Horizontally

Instead of giving it a bigger machine to make it handle more load (vertically scaling), if we could give it N more machines to make it handle more load, that would scale further.

Dynamically/Automatically

When the system needs scaled, it should dynamically scale, without developer intervention, within bounds, to be performant within the SLAs of the system.

Secure

  • communications with the service are over ssl, with a not-hand-rolled authentication layer
@joram
joram / Post Mortem Template.md
Last active August 16, 2021 16:04
Incident Response

TLDR What Happened?

keep this blameless: don’t use peoples names, don’t say “John deployed shitty code“ that’s not useful. better wording would be “a developer deployed, bypassing jenkins“

Who was affected?

api customers? UI customers? which products? how long? what sort of impact?

Incident Timeline:

be detailed

@joram
joram / rum.md
Last active March 26, 2021 15:28
  • dunder (old fermentation sludge)
  • 5:1 ratio molasses/water
  • PH 5.5-6 (add lemon o citric acid)
  • 1cc lemon juice = 1.2ph lower to 1L liquid
  • concrete mixer for stiring
  • add oxygen
  • 1g/L of yeast
@joram
joram / testing in python.md
Last active March 15, 2021 19:22
Thoughts on testing in python

Testing

test_all_the_things

  • These are some thoughts I threw together (with a little help from my friends) around testing, and more specifically unit tests.
  • Everything here is an opinionated statement. There are a zillion exceptions to these rules

Talk outline

  • the following sections
  • a review of an untested section of code, describe tests we would want to write for it.
  • a review of hard-to-test code, refactor to make it testable.

Prepare ahead of time

  • measure out hops, bag and record timing to add

Make Wort (~3hr)

step 1) mashing in (1hr)

  • bring 20.68L Liter water to 68c (+6c)
  • record temp
  • Strike Water + Grain
  • stir to keep from clumping
  • record temp + volume
@joram
joram / Fun Bits.md
Last active March 16, 2018 18:49
Battlesnake thoughts

veteran flare

If we can track who played in previous years, we can allow them a piece of flare like extra head/tail images, or a hat. We could even do custom ones for previous winners.