This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| // 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');", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import argparse | |
| from dataclasses import dataclass | |
| import time | |
| from typing import ClassVar | |
| from datetime import datetime | |
| import boto3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
NewerOlder