Skip to content

Instantly share code, notes, and snippets.

View CBroz1's full-sized avatar
๐Ÿ‘‹

Chris Broz CBroz1

๐Ÿ‘‹
View GitHub Profile
@CBroz1
CBroz1 / remove_outdated_sql_backups.sh
Last active September 23, 2025 21:02
MySQL backup retention policy and deletion process
#!/usr/bin/env bash
# Author: Chris Brozdowski
# Date: 2025-09-22
#
# Remove outdated MySQL backups with the following retention policy, based
# on the date in the folder name (e.g., your-prefix-20250131):
# - Keep all backups from the last month
# - Keep one backup per month for the last year
# - Keep one backup per year for all previous years,
# either Jan 1 or the very first
@CBroz1
CBroz1 / SpyglassWorkshopSlides_2025.md
Last active September 17, 2025 16:04
Spyglass Workshop Slides 2025
title author date styles
Spyglass Workshop 2025
Chris Broz
08/2025
style
dracula

Calibration Slide

@CBroz1
CBroz1 / fetch_pynwb_requirements.py
Created January 23, 2025 21:02
Fetch pynwb dependies for hdmf and h5py
"""
Fetches hdmf and h5py versions for each pynwb release.
Stores the versions in a DataJoint table for later use.
This was developed based on the misunderstanding that pynwb's requirements.txt
reflects the actual versions used in each release. Instead, this information
is stored in the pyproject.toml file, without the hard version pins.
Author: Chris Broz
Date: 2025-01-25
"""V1"""
from functools import reduce
from typing import List, Union
import numpy as np
import spikeinterface as si
from spikeinterface.core.job_tools import ChunkRecordingExecutor, ensure_n_jobs
from spyglass.common.common_interval import (
_union_concat,
import copy
import itertools
import operator
import os
import pickle
from collections import namedtuple
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
@CBroz1
CBroz1 / CodingChallenge_SerialNumbers.py
Last active January 28, 2023 17:18
Coding Challenge: Return N serial numbers given list of valid chars in each position
"""Coding challenge: Serial numbers | Chris Brozdowski, January 28th 2023
Goal: Create N serial numbers given N and a list of valid characters for each position
in the resulting serial.
Assumptions:
1. Each item in the list will be a string.
2. If a provided string is empty, there are no valid characters for this position.
Output should exclude this position.
3. If N exceeds the number of unique serials, only report unique serials.