Simple and Re-usable Code Bytes

Here are some useful snippets of code, a mix of PHP/jQuery/HTML/CSS/SASS etc, that I have collected over the last few years. They're generally the type of code where there's multiple ways of doing something, so I find the best solution and tweak it to make it even better, and where possible I make it generic and open.