Skip to content

Instantly share code, notes, and snippets.


Vinod Puliyadi puliyadivinod

View GitHub Profile
puliyadivinod /
Created Aug 9, 2019 — forked from hanneshapke/
Decorator for Celery functions to measure the execution time and memory usage
import time
from memory_profiler import memory_usage
import logging
celery_logger = logging.getLogger('celery')
def track_celery(method):
View scroller.html
<!-- Author: Vinodkumar Puliyadi - Simple Scroller Demo -->
<title>Scrolling Script</title>
<style type="text/css">
body{ padding:0px; margin:0px; height: 2000px; }
#container{ position: relative; height: 2500px; background-color: red; width: 80%; margin:0 auto; }
#adbox{ position: absolute; top:200; right:0; height: 600px; width:200px; background-color:black; color:#fff; }
from datetime import datetime, timedelta
def get_days_count_between_date(from_date, to_date, count=True):
from_date = datetime.strptime(from_date, "%Y-%m-%d %H:%M:%S").date()
to_date = datetime.strptime(to_date, "%Y-%m-%d %H:%M:%S").date()
delta = to_date - from_date
date_range = [ from_date + timedelta(days=i) for i in range(delta.days + 1)]
if count:
return len(date_range)