Okay so this is really fun. Just over four years ago I was working at a popular mortgage company as a back-end Tech Lead and was tasked with developing a PHP web framework to replace the dated and abominable system they currently had in place. Their current “framework” was like the ugly bastard child of an MVC… with grade three burns. In other words it was total shit (all these years later and I still seem to harbor a great hate for it). The web had been advancing quite nicely and we were now looking at the birth of Web
For some reason I decided I wanted to create a comic-ized image of myself from a photo. I think initially I wanted it to create myself some sort of digital avatar, but in the end it was out of pure obsession. See I figured it was a really normal thing to want to do and I’d find a bunch of free websites out there where I could upload a photo of myself and it would convert it. Not so (admittedly I was searching from ‘comicize’ when I think the correct term is more like ‘posterize’), there are some sites out…
In my post yesterday I talked about calculating geographical distances. During my research I’d come across this http://www.scribd.com/doc/2569355/Geo-Distance-Search-with-MySQL. It was a super interesting read and helped me get a much better understanding of what it is I am even doing.
Okay this is complicated stuff. Working on putting together a new site for a client, I have a table of locations with longitude and latitude fields for every row (I actually had a tab delimited file, but I sucked it into the db). For the functionality on the web front end a user needs to search by distance, e.g. find all locations within 10 miles of a zip code. Um okay, so how the hell do I do this?
Well first of I need to get the latitude and longitude for a zip code. For that I very quickly found…
My last couple of posts I’ve talked about how to customize Wordpress to create your own theme and templates. As I talked about in this post I feel that Wordpress is a hugely powerful CMS admin system but falls behind with its front-end publishing capabilities. I don’t like how it publishes the HTML and in this post I will give some hints as to how to completely abandon the Wordpress front-end for your own.
1. Open up a new file and add the following:
<?php /* Template Name: My Template */ ?>
2. Save the file in your theme folder with the name of your new template, the filename doesn’t have to be an exact match for the template name, e.g. ‘mytemplate.php’.
<?php $username = "youraccountname"; $password = "yourpassword"; $url="http://twitter.com/statuses/friends/londonstreetlif.xml"; $curl = curl_init(); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_USERPWD, "$username:$password"); curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($curl, CURLOPT_URL, $url); $result = curl_exec ($curl); //remove space before parenthesis curl_close($curl); ?>
I recently had a crash course in WordPress when I had to build a very custom website from scratch in two weeks from start to finish. It needed to be WordPress because this site will contain a blog that will be handed off to a third party to maintain, and WordPress is arguably the industry standards for blogging software. I wasn’t overly familiar with WordPress, I’d setup a blog or two in my time, but never anything as complex as building a custom theme or plugin. But I basically knew everything I needed to do was possible, I’d read up…