Skip to content

Instantly share code, notes, and snippets.

View vcancy's full-sized avatar

Vcancy vcancy

View GitHub Profile
@dmontagu
dmontagu / fastapi_cbv.py
Last active May 2, 2024 03:24
FastAPI CBV
import inspect
from typing import Any, Callable, List, Type, TypeVar, Union, get_type_hints
from fastapi import APIRouter, Depends
from pydantic.typing import is_classvar
from starlette.routing import Route, WebSocketRoute
T = TypeVar("T")
CBV_CLASS_KEY = "__cbv_class__"
@vcancy
vcancy / Dockerfile
Created June 8, 2018 01:52 — forked from magno32/Dockerfile
Dockerfile that creates a build environment for Metabase
FROM ubuntu:xenial
ENV DEBIAN_FRONTEND noninteractive
#Install git and java
RUN apt-get update && \
apt-get -y install locales && \
apt-get -y install \
software-properties-common \
sudo \
# -*- coding: utf-8 -*-
# Print iterations progress
def print_progress(iteration, total, prefix='', suffix='', decimals=1, bar_length=100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
prefix - Optional : prefix string (Str)