Skip to content

Instantly share code, notes, and snippets.

@thedatadavis
thedatadavis / state_income_tax_brackets.csv
Last active February 21, 2023 07:17
US State Income Tax Brackets (take top end rates with grain of salt)
state_abbr filer_type tax_rate bracket_start bracket_end tax_year
AK single 0 0 999999999 2022
AK married_jointly 0 0 999999999 2022
AL single 0.02 0 500 2022
AL single 0.04 501 3000 2022
AL single 0.05 3001 999999999 2022
AL married_jointly 0.02 0 1000 2022
AL married_jointly 0.04 1001 6000 2022
AL married_jointly 0.05 6001 999999999 2022
AR single 0.02 0 4300 2022
@thedatadavis
thedatadavis / postgres_calc_running_sum_with_generate_series.sql
Last active December 20, 2022 09:06
Example of using `generate_series` in PostgreSQL to calculate a running sum for each customer
-- Run query here: https://bit.io/christoff12/explore_stuff?view=docs#/retail
with clean_data as (
select
customerid as customer_id,
invoiceno as invoice_id,
stockcode as stock_code,
quantity,
unitprice as unit_price,
<!DOCTYPE html>
<html>
<head><meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>working_with_lists_of_dicts</title><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>
@thedatadavis
thedatadavis / roman_converter.py
Created August 25, 2020 23:44
Converts Roman Numerals up to 50
new_ref = {
'I': 1,
'V': 5,
'X': 10,
'L': 50
}
def convert_roman(roman_numeral):
val = 0
skip_next = False
<?xml version="1.0" encoding="UTF-8"?>
<!-- UPS Tracking Service WSDL Release Date Jul 12, 2008 -->
<!-- Copyright 2007-2008 United Parcel Service of America, Inc. All rights reserved. -->
<wsdl:definitions name="Track" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:error="http://www.ups.com/XMLSchema/XOLTWS/Error/v1.1" xmlns:upss="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0" xmlns:trk="http://www.ups.com/XMLSchema/XOLTWS/Track/v2.0" xmlns:tns="http://www.ups.com/WSDL/XOLTWS/Track/v2.0" targetNamespace="http://www.ups.com/WSDL/XOLTWS/Track/v2.0">
<wsdl:types>
<xsd:schema>
<!-- This schema defines the UPS Security header used for authorization purposes -->
<xsd:import namespace="http://www.ups.com/XMLSchema/XOLTWS/UPSS/v1.0" schemaLocation="UPSSecurity.xsd"/>
<!-- This schema defines the error detail data types returned within SOAPFaults to provide more specific information pertaining to the pr
@thedatadavis
thedatadavis / blockstack.txt
Created December 16, 2018 08:22
Blockstack verification
Verifying my Blockstack ID is secured with the address 1LMCygrzKWCsaEojTV3h2RLasJr7VyFf6x https://explorer.blockstack.org/address/1LMCygrzKWCsaEojTV3h2RLasJr7VyFf6x