Skip to content

Instantly share code, notes, and snippets.

View ngetahun's full-sized avatar

Natnael Getahun ngetahun

View GitHub Profile
import sys
import csv
import time
import pandas as pd
def clean_input(start, stop):
start = time.mktime(time.strptime(start, '%Y-%m-%d %H:%M:%S.%f'))
stop = float(int(stop))
return stop, start
@ngetahun
ngetahun / queueing.py
Created November 3, 2020 10:44 — forked from asottile/queueing.py
really bad queue simulating sqs backed by sqlite
import contextlib
import fcntl
import json
import sqlite3
import time
import uuid
from typing import Any
from typing import Generator
from typing import Optional
from typing import Tuple
@ngetahun
ngetahun / execute.sh
Created June 10, 2020 07:17
Gunicorn config to start a flask app with aiohttp in dev env
gunicorn 'wsgi:app' -b 127.0.0.1:5000 \
--name wsgi_app \
--workers 5 \
--worker-class aiohttp.GunicornWebWorker \
--access-logfile /dev/stdout
--enable-stdio-inheritance \
--log-level debug \
--reload \
--access-logformat '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"' \
--bind=unix:sock/wsgi_app.sock \