Created
March 14, 2016 02:49
-
-
Save amlweems/eed5179dd9677fe80d3e to your computer and use it in GitHub Desktop.
asciinema at lightning speeds
This file contains 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 | |
""" speeder.py | |
Speed up your asciinema casts by an arbitrary factor. | |
Assumes your recording is stored at ./new and outputs a new recording at ./newer. | |
""" | |
import json | |
import sys | |
if len(sys.argv) != 2: | |
print("Usage: %s <factor>" % sys.argv[0]) | |
sys.exit(1) | |
factor = int(sys.argv[1]) | |
blob = open('new').read() | |
with open('new') as f: | |
blob = json.load(f) | |
for k in blob['stdout']: | |
k[0] /= factor | |
with open('newer', 'w') as f: | |
json.dump(blob, f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍