Skip to content

Instantly share code, notes, and snippets.

View Tycholiz's full-sized avatar

Kyle Tycholiz Tycholiz

View GitHub Profile
@Tycholiz
Tycholiz / payment-flow-user-stories.md
Last active August 11, 2021 16:11
Postgres user stories for Payment Flows

This file contains snippets of code that you can execute in a postgres client in order to carry out certain user stories at the database-level

Running the below commands assumes that you have taken the 2 steps (in order):

  1. seed the database
  2. run latest database migrations (ie. the ones provided by the db--payment_model_changes branch of the Legible Monorepo)

Purchase a book

-- user signals intent to buy
begin;
-- The enum way
create type app_public.role_types as enum (
'READER',
'PUBLISHER'
);
create table app_public.roles (
id uuid primary key,
title app_public.role_types
);
@Tycholiz
Tycholiz / generateReport.py
Last active June 12, 2019 06:21
A Watson time tracker script that generates a freelance client report for weekly allocation of hours
#! /usr/bin/python3
import os, json, sys, xlwt, time, datetime, argparse
from datetime import timedelta, datetime
from docx import Document
from docx.shared import Inches
def parseArguments():
parser = argparse.ArgumentParser()
parser.add_argument("projectName", help="name of client")
parser.add_argument("-i", "--invoice", help="include the invoice section or not?", action='store_true')