Building a my groups block

How does one build a 'my groups' block? I thought it would be an out of the box thingy. But it is not. On the channel the answer was DIY. So this is what I build. The code patterns below are the same. The use cases differently.
  1. Show my groups
  2. Add special node type immediately to a group. This is for speed
  3. Generate a node and redirect elsewhere. This is for speed and timeing usage.

My Groups

This is just looping through the group ids of the current user.