Skip to content

Instantly share code, notes, and snippets.

View FlorianLudwig's full-sized avatar

Florian Ludwig FlorianLudwig

View GitHub Profile
@FlorianLudwig
FlorianLudwig / keybase.md
Last active January 10, 2021 19:14
keybase.md

Keybase proof

I hereby claim:

  • I am florianludwig on github.
  • I have a public key ASAoFp49rprFGVXu9zbsaxdCpDkuQTP6cEb-UF-80J9QqAo To claim this, I am signing this object:
@FlorianLudwig
FlorianLudwig / main.py
Created October 14, 2020 14:49
FastAPI With two ports
"""
hypercorn main:multi_port -k uvloop -b 127.0.0.1:8000 -b 127.0.0.1:8001
"""
from fastapi import FastAPI
from starlette_exporter import PrometheusMiddleware, handle_metrics
app = FastAPI()
app.add_middleware(PrometheusMiddleware)
@FlorianLudwig
FlorianLudwig / usage.py
Created July 19, 2018 09:32
dependecy injection
context = {
'a': 'something-that-should-be-injected'
}
import di
@di.inject
def with_param(a):
# initialization file (not found)
@FlorianLudwig
FlorianLudwig / ngspice_emscripten.py
Created March 25, 2014 16:52
compile ngspice with emscripten (WIP)
# this is WIP and does NOT produce a working result.
import os
import shutil
import subprocess as sp
NG_SPICE_25 = 'http://netcologne.dl.sourceforge.net/project/ngspice/ng-spice-rework/25/ngspice-25.tar.gz'
NG_SPICE_26 = 'http://optimate.dl.sourceforge.net/project/ngspice/ng-spice-rework/26/ngspice-26.tar.gz'
#!/bin/sh
#----
# bootstrap fedora18
#release=$(cat /etc/fedora-release | awk '/^Fedora/ {print $3}')
#arch=$(arch)
release=18
arch=x86_64
ROOTFS=/var/lib/libvirt/lxc/fedora$release-$arch
@FlorianLudwig
FlorianLudwig / gist:3293965
Created August 8, 2012 10:06
ajdavis:getmore
self.assertEqual(
before, after,
> "%d cursors left open (should be 0)" % (after - before),
E AssertionError: -1 cursors left open (should be 0)
test/test_getmore.py:119: AssertionError
-------------------------------------------------------------------------------------------------- Captured stdout --------------------------------------------------------
12:01:27 23272 test_shunt.py 67 DEBUG #| ['mongod', '--bind_ip', '127.0.0.1', '--oplogSize', '10', '--dbpath', '/tmp/filekvMDt1', '-v', '--port', '27017']
12:01:27 23272 test_shunt.py 70 DEBUG #| started mongod 23361
12:01:27 23272 test_shunt.py 72 INFO #| waiting for mongod to start (sleeping 3 seconds)