https://github.com/piersfinlayson/esp-sdk-samples
These were originally developed for an esp8266 hackathon workshop I ran at my workplace, to help beginners come up to speed writing, compiling and installing apps on wemos d1 mini boards, and they assume running a linux build environment with esp-open-sdk https://github.com/pfalcon/esp-open-sdk installed.
They show a few techniques like writing to GPIOs, using wifi callbacks, and reading/writing directly to/from flash.
esp8266 otb-iot documentation - https://otb-iot.readthedocs.io/
esp8266 related blog - http://www.packom.net/