rchen's snippets