Skip to content

Instantly share code, notes, and snippets.

View eruvanos's full-sized avatar

Maic Siemering eruvanos

View GitHub Profile
@eruvanos
eruvanos / README.md
Last active June 23, 2023 07:29
Simple mock server for testing using Flask

Mock server for testing using flask

License

MIT

Prepare

Install flask and requests to run this example.

@eruvanos
eruvanos / vp
Created July 18, 2017 06:50
Virtual Pipe - Tool to show what was piped through
#!/usr/bin/env python
import time
from sys import stdin, stdout, argv
try:
from tkinter import *
except ImportError:
from Tkinter import *
@eruvanos
eruvanos / log_util.py
Last active August 22, 2022 17:45
Better log config
"""
Configures a logger to log <=INFO to stdout and >INFO to stderr
"""
import logging
import os
import sys
DEFAULT_FORMAT = '%(asctime)s - %(levelname)s - %(name)s - %(message)s'
NO_TIME_FORMAT = '%(levelname)s - %(name)s - %(message)s'

Keybase proof

I hereby claim:

  • I am eruvanos on github.
  • I am eruvanos (https://keybase.io/eruvanos) on keybase.
  • I have a public key ASCBFe9JGaDvOfkHdQAxO0EmGrcCzQ_WvjNyUWaqAPEKrQo

To claim this, I am signing this object:

@eruvanos
eruvanos / GlobalErrorController.java
Created July 15, 2016 20:01
Global errorhandler for Spring
package de.siemering.spring.controllers;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("${error.path:/error}")
public class GlobalErrorController implements ErrorController {
@eruvanos
eruvanos / StopWatchHolder.java
Created June 14, 2016 13:32
StopWatchHolder: Holds Spring Stopwatch as static field and extends a next() method
package de.siemering.gist;
import org.springframework.util.StopWatch;
public class SwHolder{
private static StopWatch sw = new StopWatch();
public static void start(String taskName) throws IllegalStateException {
sw.start(taskName);