Skip to content

Instantly share code, notes, and snippets.

View fr-ser's full-sized avatar

Sergej Herbert fr-ser

  • Berlin, Germany
View GitHub Profile
@fr-ser
fr-ser / app.py
Created October 11, 2020 08:12
Example code to allow take to have manually acknowledged messages
import faust
from faust import Stream
from noack_take import noack_take
# monkeypatch noack_take on streams
Stream.noack_take = noack_take
@fr-ser
fr-ser / swagger.yaml
Last active March 6, 2020 18:17
Swagger documentation for grafana plugin: simpod-json-datasource
openapi: 3.0.0
info:
title: Prometheus Grafana API
description: API definition for the prometheus api server, that is queried by
grafana (https://grafana.com/plugins/simpod-json-datasource)
version: "0.1"
paths:
/:
get:
summary: "Test connection"
@fr-ser
fr-ser / debounce.ts
Last active July 15, 2023 15:12
Typed debounce function wtih TypeScript
export function debounce<F extends Function>(func:F, wait:number):F {
let timeoutID:number;
if (!Number.isInteger(wait)) {
console.warn("Called debounce without a valid number")
wait = 300;
}
// conversion through any necessary as it wont satisfy criteria otherwise
return <any>function(this:any, ...args: any[]) {