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
| { | |
| "[sql]": { | |
| "editor.formatOnSave": false | |
| } | |
| } |
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 Depends, FastAPI | |
| from pydantic import BaseModel | |
| from sqlalchemy import Column, Integer, String | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.orm import Query, Session | |
| from pagination import PaginatedList, paginated_get | |
| Base = declarative_base() |
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
| #!/bin/bash | |
| # ----------------------------------------------------------------------------- | |
| # This script extracts the path of the devcontainer config-file from | |
| # docker-events. | |
| # | |
| # This helps in identifying who has started a container if the container-name | |
| # does not itself include any indication. | |
| # | |
| # This can be used to determine if a container can be safely stopped/removed |
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
| """ | |
| This module contains classes that dispatch calls depending on arg-types. | |
| The goal is to handle "media-types" for HTTP APIs with well-defined functions. | |
| An "incoming" request may contain a payload that needs to be stored in the | |
| back-end. We need to "parse/decode" the incoming object depending on media-type. | |
| Similarly, when we respond to the request we may need to convert the object to | |
| something the client understands. The client can opt-in/-out using the "Accept" | |
| media-type. |
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
| #!/usr/bin/python3 | |
| """ | |
| This script creates a realm, client, and user in Keycloak for local development. | |
| """ | |
| from os import environ | |
| import requests | |
| import rich |
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 select | |
| import datetime | |
| import psycopg2 | |
| import psycopg2.extensions | |
| from sqlalchemy import create_engine, text | |
| engine = create_engine("postgresql+psycopg2://vagrant@/postgres") |
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
| # cspell: ignore ASGI | |
| """ | |
| A simple rate-limiting middleware for ASGI applications. | |
| This middleware uses the `limits` library to enforce rate limits on incoming | |
| requests. It allows you to specify a default rate limit and custom limits for | |
| specific client-IPs on specific paths. | |
| Usage:: |
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
| { | |
| "jingles":[ | |
| { | |
| "resource_str":"300-dine_in_hell", | |
| "movie":"300", | |
| "title":"We Dine in Hell!", | |
| "duration":3.761625, | |
| "has_metadata":true, | |
| "inserted":"2021-02-09T18:38:48.199850+00:00" | |
| }, |
OlderNewer