This file contains hidden or 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
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH="/home/asemashko/.oh-my-zsh" | |
# Set name of the theme to load --- if set to "random", it will | |
# load a random theme each time oh-my-zsh is loaded, in which case, | |
# to know which specific one was loaded, run: echo $RANDOM_THEME | |
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes |
This file contains hidden or 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 twisted.internet import reactor | |
from twisted.protocols import sip | |
from twisted.internet.protocol import ServerFactory | |
class SipProxy(sip.Proxy): | |
def __init__(self): | |
sip.Proxy.__init__(self,host='192.168.1.3',port=5060) | |
self.tries=0 | |
def handle_request(self,message,addr): |
This file contains hidden or 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
import importlib | |
import os | |
SETTINGS_MODULE = os.environ('SETTINGS_MODULE') | |
class Borg: | |
_shared_state = {} |
This file contains hidden or 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
def profile_memory(output): | |
if isinstance(output, str): | |
output = open(output, 'w') | |
def decorator(func): | |
@profile(stream=output) | |
@functools.wraps(func) | |
def wrapper(*args, **kwargs): | |
result = func(*args, **kwargs) | |
return result |