Magento's GitHub account used to have a project at
https://github.com/magento/magento/magento2-samples
This repository contained around 20 examples of How to Build a Magento 2 module. However, this project's been deleted because -- reasons?
While some of practices in these modules have been abandoned, and not all the modules ran, this was still an important resource, both historic and practical, for developers learning and working with Magento 2.
Does anyone know if there's any public forks of the repository available?