Skip to content

Instantly share code, notes, and snippets.

Avatar
⛰️

Christian Haudum chaudum

⛰️
  • Grafana Labs
  • Dornbirn
  • Twitter @chaudum
View GitHub Profile
View x2term.py
#!/usr/bin/env python3
import argparse
import json
import sys
import re
from typing import Dict, List, Tuple
def parse_args():
View example.py
# pip install wetterdienst==0.9.0 crate[sqlalchemy]
# pip install cr8
#
# Usage:
# cr8 run-crate 4.2.x
# python example.py
from sqlalchemy import create_engine
from wetterdienst import DWDObservationData
from wetterdienst import Parameter, PeriodType, TimeResolution
View dump.py
#!/usr/bin/env python3
#
# Brain Dump
#
# Requirements:
# pip install aiofiles aiopg
#
# Usage:
# python dump.py
View abstract-property.py
import abc
class Base(abc.ABC):
@property
@abc.abstractmethod
def prop(self):
...
class Impl(Base):
View keybase.md

Keybase proof

I hereby claim:

  • I am chaudum on github.
  • I am chaudum (https://keybase.io/chaudum) on keybase.
  • I have a public key whose fingerprint is EBCE F684 BA35 529C B936 E65B 9EBD BC4E EBD1 576F

To claim this, I am signing this object:

View sqlexporter.yaml
global:
scrape_timeout_offset: 250ms
min_interval: 0s
max_connections: 3
max_idle_connections: 3
target:
data_source_name: "postgres://crate@localhost:5432/sys?sslmode=disable"
collectors: [health_collector]
View asyncio_return_values.py
import asyncio
async def do_something_long_running(sec=1) -> bool:
print(f"sleep for {sec}s")
await asyncio.sleep(sec)
return True
async def coro_a(t):
View asyncio_return_values.py
import asyncio
async def do_something_long_running(sec=1) -> bool:
print(f"sleep for {sec}s")
await asyncio.sleep(sec)
return True
async def coro_a():
return await do_something_long_running()
View croud.py
#!/usr/bin/env python3
import argparse
import json
import sys
def add_default_args(parser):
parser.add_argument(
"--region",
View gist:0a28d3cb5ba5701088b736b3b0225608
1,34d0
< crate_circuitbreakers{name="fielddata",property="limit",}
< crate_circuitbreakers{name="fielddata",property="overhead",}
< crate_circuitbreakers{name="fielddata",property="trippedCount",}
< crate_circuitbreakers{name="fielddata",property="used",}
< crate_circuitbreakers{name="in_flight_requests",property="limit",}
< crate_circuitbreakers{name="in_flight_requests",property="overhead",}
< crate_circuitbreakers{name="in_flight_requests",property="trippedCount",}
< crate_circuitbreakers{name="in_flight_requests",property="used",}
< crate_circuitbreakers{name="jobs_log",property="limit",}