Some valuable code snippets for sharing.