Skip to content

Instantly share code, notes, and snippets.

View dwreeves's full-sized avatar

Daniel Reeves dwreeves

  • Battery
  • Boston, MA
View GitHub Profile
@dwreeves
dwreeves / profile-dbt-versions.sh
Last active April 1, 2024 16:35
Memory profiling for dbt-core versions
#!/bin/bash
set -euxo pipefail
###############################################################################
# Notes:
# - Caveat emptor. Script is presented as is, no warranty expressed, etc.
# - Requires uv to be installed
# - Set the environment variables + any other env vars you need to run dbt.
# - This script will delete your .venv; be careful. Set env vars correctly!
###############################################################################
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from pydantic import BaseModel, ConstrainedStr, StrictStr
class MyStr(ConstrainedStr):
to_upper = True
class Foo(BaseModel):
x: str
class Bar(BaseModel):
x: MyStr
@dwreeves
dwreeves / mic-fix
Created August 11, 2022 16:08
OSX Monterey fix for auto-adjusting volumes with Bluetooth microphones. Add me to your `~/.local/bin` and `chmod +x ~/.local/bin`
#!/bin/bash
set -eo pipefail
function maybe_make_a_volume_adjustment {
volume=`osascript -e "input volume of (get volume settings)"`;
(( vol_adj=((volume+50)/2-volume)/5 ));
if [ ${vol_adj} -lt 0 ]
then
sign="-"
@dwreeves
dwreeves / split_columns_hobolink_export_2.csv
Created November 27, 2020 20:30
Another glitchy hobolink output
@dwreeves
dwreeves / definitions.py
Last active May 17, 2020 00:51
Module for `import_census_tract_data`, a function that allows for easy import of Census data into a Pandas DataFrame format.
"""
Definitions of various constants. Adjust based on project structure and needs.
"""
import os
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Files and Directories
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dwreeves
dwreeves / c4b sdw - data processes.md
Last active September 10, 2019 00:42
Safe Drinking Water Project - Recommendations for storage, processing, and cleaning of data

Code for Boston - Safe Drinking Water Project

Daniel Reeves - process notes and recommendations

Summary of recommendations

  • Separate out processed and raw data in the data/ folder.
  • Include README.md files within each folder containing data files; also utilize the Issues tab in GitHub more often.
  • Utilizes branches in the GitHub workflow, and keep the master branch's data folder "clean," so to speak.