Data, Data, Data – hotpads report

January 26, 2012 Leave a comment

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?

Categories: Uncategorized

Housing Maps and Craigslist – Scottsdale Rental

January 25, 2012 Leave a comment

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:

Triple Crown Rental - E Charleston Ave

Housing Maps Error (My Error)

How a bill becomes a law – infographic

December 19, 2011 Leave a comment

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/

Categories: Uncategorized

Best Kid’s Laptop – EVER

December 17, 2011 Leave a comment

LaptopI found this “express” laptop on my dining room table the other night.  Kid’s ROCK.

This is the BEST LAPTOP EVER!

DOWNLOAD IT!

Categories: tech

github ideas for projects

December 14, 2011 Leave a comment

Opencart Modules:

  • Prev / Next links on product template page
  • fix to DB model for autoexec
  • impersonate module
  • page scrape / import tool
Categories: Uncategorized

PHP Framework Benchmark Graph

December 9, 2011 Leave a comment

Was trying to learn more about what’s out there for the PHP Yii framework and found this great graph on github:

Frameworks mentioned:

Categories: php

jquery focus after blur

November 21, 2011 Leave a comment

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)

 

Categories: jquery

jquery 1.2 and ajax parameter serialization – passing a php array

November 15, 2011 Leave a comment

php 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!

Categories: php

php date add – date math compounded

November 15, 2011 Leave a comment

php
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.

Categories: mysql, php

void stamp

September 13, 2011 Leave a comment

I just made this today for a project at work. Thought someone else might need this too.

Categories: php, tech
Follow

Get every new post delivered to your Inbox.