Skip to content

Instantly share code, notes, and snippets.

View ka7eh's full-sized avatar

Kaveh Karimi-Asli ka7eh

View GitHub Profile
@zzstoatzz
zzstoatzz / prefect_and_generics.py
Last active September 20, 2024 00:09
generics in prefect
from typing import Sequence, TypeVar, Generic
from pydantic import BaseModel, TypeAdapter
from prefect import flow, task
ResultType = TypeVar("ResultType")
class Result(BaseModel, Generic[ResultType]):
data: Sequence[ResultType]
@bgauduch
bgauduch / 0 - Multiple git identities on one machine.md
Last active September 9, 2026 16:19
Multiple git identities on one machine: config per folder and per provider (personal vs work). Every command verified.

Multiple git identities on one machine

One machine, several git identities (personal vs work, GitHub vs GitLab, two accounts on one provider). Each repository picks its own name, email and credentials. In a hurry: Appendix B, once per rule.

A wrong identity does not fail: git commits and pushes under the wrong author. Part 1 ends with the check that catches it.

Requirements

Feature Minimum git
@drmalex07
drmalex07 / convert-geojson-to-wkt.py
Created May 12, 2014 22:13
Convert GeoJSON to/from WKT in Python. #python #geojson #geometry
import json
import geojson
from shapely.geometry import shape
o = {
"coordinates": [[[23.314208, 37.768469], [24.039306, 37.768469], [24.039306, 38.214372], [23.314208, 38.214372], [23.314208, 37.768469]]],
"type": "Polygon"
}
s = json.dumps(o)