
Whilst picking up a new language – Python, I decided to whip up a basic paint like tool using PyGame. As you can see above it looks basic, You can click and drag to draw, and right click to remove. If a key is pressed, the image is stored in a text file with ‘pixels’ …
The Internet is a valuable resource for everyone, being a programmer, I usually found my self either looking for a specific piece of code or trying to share a piece. I have made a list of my favourite websites orientated around code, some may seem obvious, others may not.
Whilst working on a project I needed to be able to create a grid using tables with a specific width,height and identifier to be used with jQuery. So I wrote a quick function in PHP, possibly not the most practical as it could be done with DOM and save a lot of server execution time …
Recently I started learning python, I found there were many great resources out there so I thought I would share them with you all. In no particular order, my favorite Python resources.
Python Official Documentation
Possibly the best place to look …
I have been working on a dynamic CRUD system in PHP for a recent project of mine, I have stripped down the code the untangled it from the rest of my system for the public.
The system is mostly class based using objects with public variables corresponding the the field names in a mysql table.
I did …
Recently whilst working on a project, I needed a method of returning JSON from a class based on it’s public variables. The routines are not perfect and may need work but if used correctly issues shouldn’t occur.
Class To JSON
function class_to_json($input)
{
if($input)
{
$class_vars = get_object_vars($input);
…