Skip to content

Instantly share code, notes, and snippets.

View GJMcClintock's full-sized avatar

Garrett Mcclintock GJMcClintock

  • Queen Creek, AZ
View GitHub Profile
@GJMcClintock
GJMcClintock / dbt_merge.yml
Created August 13, 2025 17:57
Quick Slim-ish dbt Merge Job
### This is a quick path to slim deployment by running changed models and their dependencies
### It will NOT pick up changes in macros, so be mindful of that
### It also will not handle seeds, but you can add that file extension if you need (we use Sigma input tables instead)
name: dbt Merge
on:
workflow_dispatch:
push:
branches:
- main
@GJMcClintock
GJMcClintock / create_dim_date.sql
Last active March 6, 2025 10:18
A SQL script to create a view for a date dimension that includes holidays and relative date counts (eg: nth monday of month/quarter/year). Built for Athena/Presto so many need some modification for other flavors.
CREATE OR REPLACE VIEW dim_date AS
-- Change the 2009-12-31 to be one day PRIOR to when you want this to start.
-- The week_of_month and week_of_quarter will be null until the first Monday
-- You may wish to start earlier to allow all needed dates to have proper counting
WITH series AS (
SELECT x AS id,
date_add('day', x, DATE '2012-12-31') AS dim_date
FROM UNNEST(sequence(1, DATE_DIFF('day', DATE '2012-12-31', DATE '2050-01-01'), 1)) t(x)
@GJMcClintock
GJMcClintock / Getting Started with College Football Data in Python.md
Last active November 11, 2025 20:27
Getting Started with College Football Data in Python

Introduction to College Football Data Using Python

If you are reading this - you enjoy college football. Or you may just enjoy working with different types of data. Hopefully, you're like me and like both. I am self-taught in Python, so I am by no means the end all be all expert of how to approach things, but if I can figure it out, you can to.

This guide is a fork of Parker Flemings (@statsowar on Twitter) guide "Introduction to College Football Data with R and cfbscrapR". We will go through the same excercises he did, simply with the Python equivalent to his R masterpiece.

If you have any questions - or see any errors - shoot me a tweet @GJMcClintock. This is very pragmagtically done - if it works, it works. None of what I presently deal with is very resource intensive, so I am sure there are much more efficient ways to get the job done. If you have suggestions on tha

import pandas as pd
import requests
import json
from tqdm import tqdm as tqdm
from scipy.stats import norm
import itertools
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# %% Get Games