Skip to content

Instantly share code, notes, and snippets.

View LPMatrix's full-sized avatar
🎯
Focusing

Sanusi Mubaraq LPMatrix

🎯
Focusing
View GitHub Profile
@LPMatrix
LPMatrix / Postortem.md
Created August 22, 2023 21:45
A sample show how to write a blameless postmortem document

Blameless Postmortem: Double Debit Incident

Incident Summary

On [Date and Time], our fintech platform experienced an incident where some users were debited twice for a single transaction. This led to customer dissatisfaction and concerns about the reliability of our services. This postmortem document aims to provide a detailed analysis of the incident, its root causes, and recommended actions to prevent similar incidents in the future.

Timeline of Events

[Timestamp]: Incident was first reported by customers experiencing double debits.

[Timestamp]: Technical team received alerts and initiated investigation.

[Timestamp]: Issue identified as a software glitch affecting a specific payment gateway.

People have exactly one canonical full name.

People have exactly one full name which they go by.

People have, at this point in time, exactly one canonical full name.

People have, at this point in time, one full name which they go by.

People have exactly N names, for any value of N.

Falsehoods programmers believe about prices

  1. You can store a price in a floating point variable.
  2. All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
  3. All currencies are subdivided in decimal units (like dinar/fils)
  4. All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
  5. All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
  6. Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
  7. For any currency you can have a price of 1. (ZWL)
  8. Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
class Stack:
def __init__(self):
self.elements = []
def push(self, data):
self.elements.append(data)
return data
def pop(self):
return self.elements.pop()
class Queue:
def __init__(self):
self.items = []
def isEmpty(self):
return self.items == []
def enqueue(self, item):
self.items.insert(0,item)
class Node:
def __init__(self, data):
self.left = None
self.right = None
self.data = data
# Insert method to create nodes
def insert(self, data):
# Capacity for internal array
INITIAL_CAPACITY = 50
# Node data structure - essentially a LinkedList node
class Node:
def __init__(self, key, value):
self.key = key
self.value = value
self.next = None
def __str__(self):
# A single node of a singly linked list
class Node:
# constructor
def __init__(self, data = None, next=None):
self.data = data
self.next = next
# A Linked List class with a single head node
class LinkedList:
def __init__(self):
import ctypes
class Array(object):
"""
array implementation class
"""
def __init__(self):
self.item_count = 0
import math
def karatsuba(x, y):
if x < 10 and y < 10:
return x * y
n = max(len(str(x)), len(str(y)))
m = int(math.ceil(float(n) / 2))