These are a few bits of code I have designed to be reusable, and have used in a few of my projects.
DbHandler.php - PHP code for connecting and running queries on a MySQL database. MatrixHandler.java - Java code I wrote for manipulating matrixes in a 3D game I made for Android using OpenGL ES 2.0.