Skip to content

Instantly share code, notes, and snippets.

@markns
markns / source_read.py
Created April 5, 2023 08:39
Airbyte source_read.py
from typing import Any, Dict, List, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="SourceRead")
@attr.s(auto_attribs=True)

Keybase proof

I hereby claim:

  • I am markns on github.
  • I am markns (https://keybase.io/markns) on keybase.
  • I have a public key ASBCu3jVzJgFURsgmh5GbScZ1lNbIytSyotzxpUH-fnVDQo

To claim this, I am signing this object:

@markns
markns / threadpool_example.py
Created February 21, 2019 18:16
Use of python ThreadPoolExecutor that handles cancellation and exceptions correctly
import collections
import concurrent.futures
import os
import threading
import time
from random import randint
Result = collections.namedtuple("Result", "copied scaled name")
Summary = collections.namedtuple("Summary", "todo copied scaled canceled")
@markns
markns / gist:dd35f38d257f51255a8d82d86fb94813
Created January 26, 2018 14:23
grpc unary-stream client
import grpc
from gridarrow.api_v1.proto.api_pb2 import ApplicationStreamRequest
from gridarrow.api_v1.proto.api_pb2_grpc import StreamsStub
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = StreamsStub(channel)
@markns
markns / gen-client.sh
Created December 29, 2017 13:53
auth0 go swagger client generation
#!/usr/bin/env bash
base_url=https://${tenant}.auth0.com/api/v2/api-docs
api-spec-converter ${base_url}/Client%20Grants --from=swagger_1 --to=swagger_2 > swagger/client-grants.json
api-spec-converter ${base_url}/Clients --from=swagger_1 --to=swagger_2 > swagger/clients.json
api-spec-converter ${base_url}/Connections --from=swagger_1 --to=swagger_2 > swagger/connections.json
api-spec-converter ${base_url}/Device%20Credentials --from=swagger_1 --to=swagger_2 > swagger/device-credentials.json
api-spec-converter ${base_url}/Grants --from=swagger_1 --to=swagger_2 > swagger/grants.json
api-spec-converter ${base_url}/Logs --from=swagger_1 --to=swagger_2 > swagger/logs.json