Skip to content

Instantly share code, notes, and snippets.

@blakethepatton
Created May 19, 2020 01:59
Show Gist options
  • Save blakethepatton/d158d4dbfc97da4addfef5ced9aeb897 to your computer and use it in GitHub Desktop.
Save blakethepatton/d158d4dbfc97da4addfef5ced9aeb897 to your computer and use it in GitHub Desktop.
Asciinema timelapse

pip3 install in_place

input cast goes in input.cast, this file is overwritten update the factor variable to increase the timelapse speed.

python3 script.py

import in_place
import json
factor = 10
with in_place.InPlace('input.cast') as file:
for line in file:
linejs = json.loads(line)
if isinstance(linejs, list) and type(linejs[0]) == float:
linejs[0] = linejs[0]/factor
file.write(json.dumps(linejs) + "\r\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment