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 fastapi import FastAPI | |
from fastapi.responses import FileResponse | |
from fastapi.staticfiles import StaticFiles | |
app = FastAPI() | |
STATIC_FILES_DIR = "./static/" | |
index_file = FileResponse( | |
STATIC_FILES_DIR + "index.html", |
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
""" | |
author: Thomas Meschede | |
license: MIT | |
""" | |
def rate_limit_burst(max_calls: float, interval: float): | |
""" | |
Rate-limits the decorated function locally, for one process. Using Token Bucket algorithm. | |
max_calls: maximum number of calls of function in interval |
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 { Component, defineAsyncComponent, defineComponent, h } from 'vue' | |
export function hydrateNever(componentOrFactory: Component): Component { | |
return makeHydrationBlocker(componentOrFactory, { | |
beforeCreate() { | |
this.never = true | |
}, | |
}) | |
} |
NewerOlder