write code snippets to files