Skip to content

Instantly share code, notes, and snippets.

View makarchuk's full-sized avatar

Timur Makarchuk makarchuk

View GitHub Profile
import os
import sys
import multiprocessing
import signal
import logging
class Daemonize():
def __init__(self, pid_file='daemon.pid'):
self.obj = None
self.pid_file = pid_file
@makarchuk
makarchuk / decorators.py
Last active August 23, 2016 09:29
decorators.py
import time
import random
class Profiler():
def __init__(sel,f name):
self.name = name
self.count = 0
def __call__(self, fn):
import time
@makarchuk
makarchuk / deque.py
Last active December 25, 2015 22:27
class Element():
def __init__(self, data, next=None, prev=None):
self.data = data
self.next = next
self.prev = prev
class Deque():
def __init__(self):
self.first = None
self.last = None