Data, Data, Data – hotpads report
Just tried listing my house for rent on hotpads.com and they have this interesting “stats” tab. It shows where the price of your rental falls in relation to different segments of the surrounding neighborhood. I wonder if anyone looks at that?
Housing Maps and Craigslist – Scottsdale Rental
I recently posted up my house for rent on Craigslist and went over to housingmaps.com, a simple and effective mashup of google maps and craiglist’s home listings for rentals and sales. I wanted to put a general address for the home, but it showed up in the wrong place on housingmaps.com … here’s a screenshot of the error:
How a bill becomes a law – infographic
Very interesting infographic on how a bill becomes a law… I bet you could easily make a board game out of this.
http://www.good.is/post/infographic-how-a-bill-actually-becomes-a-law/
Best Kid’s Laptop – EVER
I found this “express” laptop on my dining room table the other night. Kid’s ROCK.
This is the BEST LAPTOP EVER!
github ideas for projects
Opencart Modules:
- Prev / Next links on product template page
- fix to DB model for autoexec
- impersonate module
- page scrape / import tool
PHP Framework Benchmark Graph
Was trying to learn more about what’s out there for the PHP Yii framework and found this great graph on github:
Frameworks mentioned:
jquery focus after blur
Need to focus() on the input field after the user has clicked or tabbed off the input field?
See below:
http://forum.jquery.com/topic/jquery-focus-after-blur
You might also want to add a .select() to re-select the input field causing the problem (if it’s a text field)
jquery 1.2 and ajax parameter serialization – passing a php array
It just sucks when I miss the fine print in the documentation. Recently I’ve been working on a project that passes product parameters to a jquery $.ajax call. The parameters are variable, so I wanted to pass them back to the server in a PHP style array:
/process.php?ProductOption[color]=123&ProductOption[size]=455&ProductOption[edition]=711
This seems to work with jquery 1.3 and greater (http://api.jquery.com/jQuery.param/) but the system I’m on requires 1.2 for a few other dependencies. So the workaround I used for the problem of passing php style array query string components was as follows:
//static variables to pass to ajax call
var ajaxData = {
'ProductType' : $('#Type').val(),
};
//variable product options to pass back, all fields
//are wrapped in a <div id="ProductOptions"> for easy selection
$('#ProductOptions :input').each(function(){
if($(this).val().length) {
//the input field names are in PHP array style too: i.e.
//<input type="text" name="ProductOption[color]" value="444" />
var name = $(this).attr('name').replace(/.+\[([^\]]+)\]/, "$1");
ajaxData['ProductOption[' + name + ']'] = $(this).val();
}
});
$.ajax({
async: false,
url: '/admin/ctl_Process.php',
data: ajaxData,
success: function(data) {
//do something here...
}
});
Enjoy!
php date add – date math compounded

This will probably be an elementary post for most, but recently, I was working on a problem that required determining the expiration of a membership and to write some rules about auto-renewing that membership 10 days prior to expiration. Instead of writing any kind of painful date math, or having to rely on mysql for dateadd functions, strtotime accomplished what I needed:
$now = time();
//expire the membership in a year
$MembershipExpiration = date('Y-m-d', strtotime('+1 year', $now));
//renew the membership 10 days prior to expiration:
$MembershipRenewal = date('Y-m-d', strtotime('+1 year -10 day', $now));
I just threw in the “-10 day” to see what would happen, and those smart cookies who built php already have it all under control.



