Skip to content

Instantly share code, notes, and snippets.

@dcondrey
dcondrey / datpatterns.py
Created March 23, 2024 23:57
Identify repeating patterns in .dat file
import struct
import re
from collections import Counter
class DatPatterns:
def __init__(self, filepath):
self.filepath = filepath
self.content = None
def read_file(self):
@dcondrey
dcondrey / .zshrc
Last active September 18, 2025 08:41
ZSH writers utilities
repetitivephrases() {
recurse=0; minw=3; maxw=20; limit=500; incl_csv=""; excl_csv=""; allfiles=0; mincount=2; single_file=""; internal_check=0
OPTIND=1
while getopts "rm:M:n:E:X:Ac:f:h" opt; do
case "$opt" in
r) recurse=1 ;;
m) minw=$OPTARG ;;
M) maxw=$OPTARG ;;
n) limit=$OPTARG ;;
E) incl_csv=$OPTARG ;;