Skip to content

Instantly share code, notes, and snippets.

View DavidKloucek's full-sized avatar

David Klouček DavidKloucek

View GitHub Profile
@AndBondStyle
AndBondStyle / fastapi_pdi_alchemy.py
Last active August 22, 2025 18:24
FastAPI + Dependency Injector + SQLAlchemy
import asyncio
import os
from contextlib import asynccontextmanager
from typing import Any
import sqlalchemy as sa
from dependency_injector import providers
from dependency_injector.containers import DeclarativeContainer
from dependency_injector.wiring import Provide, inject
from fastapi import APIRouter, Depends, FastAPI
@dg
dg / composer-frontline.php
Last active May 17, 2025 20:05
Composer Frontline: Updates all the version constraints of dependencies in the composer.json file to their latest version.
<?php
declare(strict_types=1);
// Updates all the version constraints of dependencies in the composer.json file to their latest version.
//
// usage: composer-frontline.php (updates all Nette packages)
// composer-frontline.php doctrine/* (updates all Doctrine packages)
// composer-frontline.php * (updates all packages)
@ialong
ialong / ANPR.ipynb
Created February 10, 2015 00:32
Automatic Number Plate Recognition (ANPR) iPython Notebook - with output - as JSON
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaywilliams
jaywilliams / csv_to_array.php
Created April 30, 2010 23:18
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array