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
# vim: set ft=python : | |
from __future__ import print_function | |
import json | |
import sys | |
import datetime | |
from redis import StrictRedis as Redis |
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
"""Create a map and render it as a pgm image. | |
(see http://netpbm.sourceforge.net/doc/pgm.html) | |
""" | |
import sys | |
import math | |
import json | |
from functools import lru_cache | |
from noise import snoise2 |
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
class CachedProperty(object): | |
""" | |
A cached property; A bit specific, as | |
it runs the getter as an instance method | |
& forwards the instance & init args to it. | |
Uses python descriptors protocol | |
""" | |
def __init__(self, getter, *args): | |
self.getter = getter | |
self.args = args or None |
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 python | |
from sys import argv, exit | |
from os import path | |
import datetime | |
if len(argv) == 5: | |
(script, inputf, outputf, sign, msec) = argv | |
else: | |
print "fixsrt <input.srt> <output.srt> <+/-> <milli seconds>" | |
exit(1) |