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
from functools import wraps | |
from timeit import default_timer | |
import gevent | |
from gevent.queue import Queue | |
def gevent_throttle(calls_per_sec=0): | |
"""Decorates a Greenlet function for throttling.""" | |
interval = 1. / calls_per_sec if calls_per_sec else 0 | |
def decorate(func): | |
blocked = [False] # has to be a list to not get localised inside the while loop |
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
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |
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 | |
"""An mDNS daemon designed to appear, to the iPad app, to be a TiVo Premiere.""" | |
import Zeroconf | |
import socket | |
local_ip = socket.gethostbyname(socket.gethostname()) | |
local_ip = socket.inet_aton(local_ip) |
NewerOlder