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 functools import wraps | |
from typing import Any | |
from typing import Awaitable | |
from typing import Callable | |
from typing import TypeVar | |
from pydantic import BaseModel | |
class BaseRequest(BaseModel): |
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 cv2 | |
import argparse | |
def detect_and_draw_keypoints(image_path: str, output_path: str) -> None: | |
"""Detect keypoints in the image using BRISK and save the output image with keypoints drawn. | |
Args: | |
image_path (str): Path to the input image. | |
output_path (str): Path to save the output image with keypoints. |
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
# https://www.treccani.it/magazine/lingua_italiana/speciali/Quiz/6_Nichil2.html | |
Data una lista di 5 parole, trova la parola (diversa da queste 5) che si collega con tutte queste contemporaneamente. | |
Cerca la parola nascosta cercando per esempio: | |
- titoli di film italiani famosi | |
- titoli di libri italiani famosi | |
- titoli di transmissioni televisive italiane | |
- titoli di canzoni italiane famose | |
- legami di tipo autore/opera |
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 dataclasses import dataclass | |
from enum import Enum, auto | |
from typing import Annotated, Literal | |
from pydantic import BaseModel, Field | |
class VarType(str, Enum): | |
a = "a" | |
b = "b" |
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, Request | |
from fastapi.responses import StreamingResponse | |
from starlette.background import BackgroundTask | |
import httpx | |
app = FastAPI() | |
client = httpx.AsyncClient(base_url="http://localhost:8000/") | |
async def reverse_proxy(r: Request): |
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
ruby '2.7.0' | |
source 'https://rubygems.org/' do | |
gem 'aws-sdk', '~> 3.0.1' | |
gem 'awspec', '~> 1.4.0' | |
gem 'kitchen-terraform', '~> 5.4' | |
gem 'kitchen-verifier-awspec', '~> 0.2.0' | |
gem 'rhcl', '~> 0.1.0' # ruby hcl parser | |
end |
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
create table records ( | |
record_id int, | |
record_name varchar(100), | |
record_value int, | |
date_start timestamp default now(), | |
date_end timestamp default null, | |
primary key(record_id, record_name, date_start) | |
); | |
insert into records (record_id, record_name, record_value) |
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
secret=MySuperSecret | |
keyId=someKeyId | |
encrypt: | |
aws kms encrypt \ | |
--key-id $keyId \ | |
--plaintext $(echo $secret | base64) \ | |
| jq -r '.CiphertextBlob' |
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
secret="My database password" | |
# echo $secret > password.txt | |
get-data-key: | |
aws kms generate-data-key \ | |
--key-id $key_id \ | |
--key-spec AES_256 \ # or --number-of-bytes 64 \ | |
--region $region | | |
> aws-data-key.json |