For my company I created my first Zend 2 module and they were kind enough to let me release it as open source software on GitHub. The ZF2 Assetic module is a Zend Framework 2 module to use Assetic (an asset management framework for PHP) in your Zend 2 application. An examples module is available as well.
Services can be registered in the configuration as invokables and accessed anywhere in the application through the service locator. There’s a limitation though. The service is not able to use dependencies that are needed during the creation of the service. To solve this, Zend Framework 2 uses factories.