Skip to content

Instantly share code, notes, and snippets.

View mikefrizzell's full-sized avatar

Mike Frizzell mikefrizzell

View GitHub Profile
@mikefrizzell
mikefrizzell / random_csv_data.py
Created April 22, 2023 14:18
Python script to create random data in CSV format for an example Streamlit application
import csv
import random
from datetime import datetime, timedelta
names = ["Person1", "Person2", "Person3", "Person4", "Person5"]
request_types = ["Continuing care", "Patient", "Insurance", "Attorney", "Work comp", "Law enforcement", "Regulatory"]
# Set the start and end dates
start_date = datetime.strptime('1/1/2022', '%m/%d/%Y')
end_date = datetime.strptime('12/31/2023', '%m/%d/%Y')
@mikefrizzell
mikefrizzell / mo_ag_form.py
Last active April 20, 2023 19:48
Script to autofill a garbage form with garbage data
# They added a CAPTCHA to the form, so this won't work anymore
# There is a better version of this here: https://github.com/mikefrizzell/mo_ag_form
import requests
import random
import string
import urllib.request
import re
# URL of the webpage
// DAX code to combine multiple columns in Power BI
Combined Table =
UNION(
SELECTCOLUMNS(Table1, "Type", [category_a], "Number", [number_done_a]),
SELECTCOLUMNS(Table1, "Type", [category_b], "Number", [number_done_b])
)
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Dim table As ListObject
Dim column As Integer
Dim emailDict As Object
Dim email As String
Set table = Me.ListObjects("Table1")
column = table.ListColumns("User").Index