Skip to content

Instantly share code, notes, and snippets.

@kongo2002
kongo2002 / CircuitBreaker.kt
Last active December 9, 2021 22:46
circuit breaker
package de.kongo2002
import java.util.concurrent.locks.ReentrantReadWriteLock
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.TimeoutCancellationException
import kotlinx.coroutines.withTimeout
/**
* Basic circuit breaker implementation based on the given
* [CircuitBreakerConfig].
@kongo2002
kongo2002 / agent.py
Created November 9, 2021 01:05
HTTP echo server supporting msgpack
#!/usr/bin/env python
# Simple echo-like HTTP server that supports echoing
# of msgpack payloads.
#
# Ideally used to debug datadog tracing messages
#
# Dependencies:
# - msgpack (`pip install msgpack`)
@kongo2002
kongo2002 / k8s.zsh
Last active November 7, 2021 22:13
zsh keybinding for k8s resources
# k8s.zsh
#
# Registers key-binding for CTRL-K to insert a kubernetes
# pod, deployment or service name into the command.
#
# The name selection is piped through FZF.
# check of FZF exists
if [[ ! -x $(which fzf) ]]; then
return 0
" Vim script file
" Description: fetch JIRA issue information
" Author: Gregor Uhlenheuer
" Filename: vijira.vim
" Last Change: Thu 16 Jan 2020 11:53:16 PM CET
if exists('g:loaded_vijira')
finish
endif
let g:loaded_vijira = 1
" Gist: http://gist.github.com/346275
" ToggleLongLines() - toggle matching of long lines --------------------{{{2
function! ToggleLongLines()
if exists('*matchadd')
if !exists('w:long_match')
let len = (&tw <= 0 ? 80 : &tw)
let w:long_match = matchadd('ErrorMsg', '.\%>'.(len+1).'v', 0)
echo 'longlines'
else
@kongo2002
kongo2002 / uzbl.vim
Created March 25, 2010 15:25
Vim uzbl syntax file
" Vim syntax file
" Language: Uzbl config syntax
" Maintainer: Mason Larobina <mason.larobina@gmail.com> and grodzik
" Version: 0.1
" To install this syntax file place it in your `~/.vim/syntax/` directory.
" To enable automatic uzbl-config file type detection create a new file
" `~/.vim/ftdetect/uzbl.vim` with the following line inside:
"
" au BufRead,BufNewFile ~/.config/uzbl/* set filetype=uzbl