Skip to content

Instantly share code, notes, and snippets.

View Finwood's full-sized avatar

Lasse Fröhner Finwood

  • starcopter
  • Braunschweig, Germany
  • 16:47 (UTC +02:00)
View GitHub Profile
@Finwood
Finwood / pubsub.py
Created November 9, 2022 17:26
Simple Asynchronous PubSub Implementation
# Inspired by https://gist.github.com/appeltel/fd3ddeeed6c330c7208502462639d2c9
import asyncio
import logging
from typing import Generic, TypeVar
T = TypeVar("T")
class Topic(Generic[T]):
@Finwood
Finwood / ThrustCurve.ipynb
Created October 18, 2019 16:19
PX4 Thrust Curve Linearization through `THR_MDL_FAC`
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Finwood
Finwood / files.py
Created September 19, 2017 06:48
Python File List
import os.path
import yaml
def load(fname):
with open(fname) as f:
return yaml.load(f.read())
def parse_dirs(data):
if isinstance(data, str):
yield data
@Finwood
Finwood / pointers.cpp
Created February 28, 2017 20:13
C++ pointers (and references), once and for all!
// `foo` is a completely normal integer.
int foo = 42;
// `bar` is a pointer to an integer. Right now it points to `foo`'s address,
// but may later be reassigned to other addresses.
int *bar = &foo;
// `baz` is a reference to an integer; behaving like a normal integer in
// day-to-day life, only sharing address (and value, obviously) with `foo`.
int &baz = foo;
#!/usr/bin/env python3
# coding: utf-8
import numpy as np
STEPSIZE = 5e-3
def _get_indexer(lower_bound, upper_bound, stepsize):
def indexer(value):
# coding: utf-8
"""Universal toolkit.
The functions in this module are general helper functions, which may be useful
in other projects as well.
"""
import sys
import re
import time
@Finwood
Finwood / keybase.md
Created September 7, 2016 16:12
Keybase identity proof

Keybase proof

I hereby claim:

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

To claim this, I am signing this object: