Converts a directory of low bitrate mp4 audio files to window media audio with ffmpeg.
This is a quick conversion for my car's CD player as it doesn't support mp4.
| """Generate a random YouTube like Video ID, supports deterministic generation | |
| if seed is passed. | |
| """ | |
| import random | |
| import string | |
| import sys | |
| YT_SET = (string.ascii_letters + string.digits + "-_") * 2 | |
| """Checking to see if snappy works with Python 3 recent updates to libraries | |
| Requires: | |
| python-snappy==0.5 | |
| fastavro==0.9.9 | |
| """ | |
| import random | |
| import string |
| '''Generator that can tell the future based on a iterable object | |
| Update: Created a helper class to simplify the core generator code, left original to verify against. | |
| ''' | |
| from collections import deque | |
| class Bucket(object): |
Converts a directory of low bitrate mp4 audio files to window media audio with ffmpeg.
This is a quick conversion for my car's CD player as it doesn't support mp4.
I hereby claim:
To claim this, I am signing this object:
A quick example to allow easy environment variable injection for yamlsettings in lists. Normally a list can only be completely overriden via environement variables, this allows you to pick specific values to load in to a given entry.
Run with something like:
BAR_PASS=s3cr3t BAZ_PASS=god python example.py| """Send metrics over stdout for datadog lambda monitoring. | |
| Monitoring details: | |
| https://www.datadoghq.com/blog/monitoring-lambda-functions-datadog/ | |
| """ | |
| import time | |
| from copy import copy | |
Failures:
python -m example
SERVICE_USER=foo python -m exampleValid:
SERVICE_USER=foo SERVICE_PASS=bar python -m example| import json | |
| from pygments import highlight, lexers, formatters | |
| def pretty_json_file(fn): | |
| print(highlight( | |
| json.dumps(json.load(open(fn)), sort_keys=True, indent=2), | |
| lexers.JsonLexer(), | |
| formatters.TerminalFormatter(), | |
| )) | |
| #!/usr/bin/env python | |
| import argparse | |
| import hashlib | |
| import os | |
| import tempfile | |
| import sys | |
| def query_yes_no(question, default="yes"): | |
| """Ask a yes/no question via raw_input() and return their answer. |