add some code snippets

Signed-off-by: Mahavir Jain <mahavirpj@gmail.com>