add demo code snippet to singleton pattern demo post