Author Archives: John
[Django] How to replace an image using ModelForm
I have a user profile model which holds their ‘mugshot’ image. I’m using modelForm to to present a profile update form. It was easy to build a working form, but now I need a couple of tweaks to the image: … Continue reading
Date formats and Django forms
Date formats are something that US dominance remains unable to overcome. Whilst all software assumes a format of mm/dd/yyyy, all other nations of the world want to change that to their local preference. Django is no exception. Here’s the magic … Continue reading
domainnamegroup.com.au is a scam
I got this letter in the mail recently. At first glance I thought, “oh, does my programmerforhire.com.au domain need renewal already?”… I have a sneaking suspicion that’s exactly the reaction this item was intended to provoke…
My errors always return to jQuery’s “success” function?
How do I tell my application that the query was unsuccessful when jQuery insists on always running the “success” function when it returns?? When we make an ajax call with jQuery the server’s response is consumed by the “success” function … Continue reading
Age in years with python?
Given someone’s date of birth how do I work out their age? This is actually less trivial than first appears because: the person’s age doesn’t increment until their birthday passes on the calendar that day is not always the same … Continue reading
How to convert a VMWare vmdk appliance to VirtualBox vdi
There are loads of ready-built appliances for VMWare in .vmdk format but I use VirtualBox and there is never a release in .vdi form to be found. I’ve heard that virtualbox will run the vmware images… but is that true?
How to push wordpress from testing to production
I use a testing server for my site, and I use wordpress. I create and update content on testing, then deploy it to production. But the wordpress import procedure won’t update an existing post so…
How to use a testing server with wordpress
I like to mirror and build my wordpress site on a testing server and get it all ‘just right’ then push the changes to production when I’m somewhat ready to release. This a standard practice in the IT industry and … Continue reading
Svn global-ignore
I want subversion to always ignore compiled files. There is lots on the internet about using property svn:ignore but nothing about setting a global-ignore. Where the heck is this danged config file? On FreeBSD I found it at “~/.subversion/config”. Yes, … Continue reading
How to add a new user to SVN on Apache
Problem: I’ve started working on an existing project and needed to add myself as a user to the repository. It proved kinda tricky. First I couldn’t get Tortoise to authenticate, then I couldn’t add myself as a user, and then … Continue reading