Skip to content

Instantly share code, notes, and snippets.

View tmck-code's full-sized avatar
🎯
Focusing

Tom McKeesick tmck-code

🎯
Focusing
View GitHub Profile
@tmck-code
tmck-code / rename_gopro.py
Created September 7, 2025 21:15
Rename GOPRO files
import os
import sys
import json
from datetime import datetime
import shutil
def rename_gopro_files(indir: str, outdir: str, dryrun: bool=False) -> None:
if not os.path.exists(outdir):
os.makedirs(outdir)
@tmck-code
tmck-code / README.md
Last active May 24, 2024 11:16
Surf Heaven Map Downloader
@tmck-code
tmck-code / bk.py
Last active June 28, 2024 04:19
Buildkite Pipeline summary
#!/usr/bin/env python3
from __future__ import annotations
import argparse
import os, csv, json, sys
from dataclasses import dataclass, field
from datetime import datetime, tzinfo, timedelta, timezone
import signal
import time
@tmck-code
tmck-code / bench.py
Last active March 12, 2025 21:08
Python helpers
from functools import wraps
from collections import Counter, namedtuple
import pickle
import operator
import time, sys, os
import pp
Test = namedtuple('Test', 'args kwargs expected n')
class NoExpectation: pass
@tmck-code
tmck-code / os_walk_recursive.py
Created December 5, 2021 12:58
Python dir walk recursive
#!/usr/bin/env python3
import os
from collections.abc import Iterable
from pathlib import Path
def os_walkr(dirpath: str, log=False) -> Iterable[Path]:
'traverse root directory, and list directories as dirs and files as files'
for root, dirs, fpaths in os.walk(dirpath):
path = root.split(os.sep)
@tmck-code
tmck-code / vscode-snippets.json
Created November 5, 2021 02:28
VSCode snippets
{
// Place your snippets for markdown here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
@tmck-code
tmck-code / sqs_to_file.py
Last active August 5, 2021 02:06
Consume the contents of an SQS queue to file
#!/usr/bin/env python3
import boto3
import json
import sys
from itertools import count
NUMBER_OF_MSGS = 100
REGION, QUEUE_NAME, FPATH = sys.argv[1], sys.argv[2], sys.argv[3]
print(REGION, QUEUE_NAME, FPATH)
@tmck-code
tmck-code / athena_query.py
Last active October 28, 2025 22:20
AWS Utilities
#!/usr/bin/env python3
import argparse
from dataclasses import dataclass
import time
from typing import ClassVar
from datetime import datetime
import boto3

Video Editing Lappy Brernn Dremp

OK, so after mulling it over for a bit I've had some thoughts/also might rephrase some things


These points hold true no matter whether you keep your existing and upgrade, or get a new one:

  • Memory: 8GB is enough for what you're doing, 16GB would probably be overkill.
@tmck-code
tmck-code / encide-dirs-mirrored.sh
Last active March 7, 2019 13:53
Encode all files in a directory tree to a different location, while mirroring the structure
#!/bin/bash
# github.com/tmck-code/encode-dirs-mirrored
set -euo pipefail
# Nice wee help message just in case
if [ -z ${1:-} ] || [ -z ${2:-} ]; then
echo "Error: Must specify input & output dirs
e.g. ./encode-dirs-mirrored <input_dir> <output_dir>"
exit 1