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 / Atbash.java
Last active August 29, 2015 14:13
Java implementations of simple substitution ciphers
/*
* Class Name: Atbash
*
* @author Thomas McKeesick
* @version 1
*
* Creation Date: Wednesday, September 24 2014, 11:54
* Last Modified: Friday, January 09 2015, 13:01
*
* Class Description: This is program that decodes the
@tmck-code
tmck-code / csv_funtimes.py
Last active October 30, 2018 07:23
CSV funtimes! Call with `parse.py <input_file> <output_file>`
#!/usr/bin/env python3
from datetime import datetime
from datetime import timedelta
import sys
import csv
TIME_FORMAT = '%d/%m/%Y %H:%M'
def load_file(fpath):
with open(fpath, 'r') as istream:
@tmck-code
tmck-code / csv_funtimes_generic.py
Created October 30, 2018 22:21
The refactored, generic version of csv_funtimes.py. Produces identical output
#!/usr/bin/env python3
from datetime import datetime
from datetime import timedelta
import sys
import csv
from collections import namedtuple
TIME_FORMAT = '%d/%m/%Y %H:%M'
Timestamp = namedtuple('timestamp', ['key', 'timestamp'])
@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

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 / 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
@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 / 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 / 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 / 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