Miscellaneous code snippets for mbed development