This snippet is in honza's repo.