Job Hunters Episode 1

Funny story – I was approached to be in this web series because the actor who was slated to play Phil quit. As it turns out, my friends needed someone to play a total jerk and “everyone thought of me.” Brilliant.

Facebook Status Visibility

Before it become apparent that google+ was a veritable ghost town, I thought that the concept of circles was a pretty neat idea. Rather than take the Facebook approach and make your post visible to everyone, you were encouraged to kind of whitelist your post to relevant circles (though you could still scream out into the wilderness if you wanted).

Recently, I became curious if the same feature was available on Facebook and, wouldn’t you know it, it totally is. Anytime you post something there is a drop down list that says ‘public’ by default. From here you can narrow the scope of how visible your posts are. The real power of this feature is the ‘custom’ option paired with the way facebook encourages you to organize your friends into different lists, which you have the option to do anytime you view a friend’s profile. Once you have your list organized the way you want it, you can post exclusively to that group, or exclusively exclude them.

Job Hunters Trailer!

Here’s the trailer to a web series called Job Hunters that I got to be a part of. The series premieres April 1st at the Emerald City Comicon.

Dynamic getters and setters with php

I’ve been using Magento pretty heavily for almost a year now and I’ve come to know it fairly well, thanks mostly to the guys at goSolid who mastered it by means unknown to me. Documentation for Magento ranges from near useless to pretty thorough, but the Magento forums look like some kind of developer purgatory, rife with poor souls asking “Has anyone figured this out yet?!” Regardless, one of the features that I really enjoy about it is how any attributes within a class are, by default, assigned get and set methods. Good object design entails not making your object attributes directly accessible from outside of the class, so making functions to get and set those attributes is a good idea. I find it very tedious to craft these methods myself every time I make a custom class because for every attribute you add you need to write 2 functions. Thus, I present to you an abstract class that will create getters and setters dynamically

class SM_Abstract{

	public function __call($method, $params){
		//get all the attributes from this class and store them in an array
		$attributes = get_class_vars(get_class($this));

		//check if the first 3 characters of $method = "get" or "set"
		$request = substr($method, 0, 3);

		//the variable that was requested. ex. Cars if method was getCars
		$varRequested = substr($method, 3);

		//check to see that the requested variable is in our list of varables
		$varInArray = false;
		foreach($attributes as $key=>$value){
			if(strcasecmp($varRequested, $key) == 0){
				$varInArray = true;
				$attribute = $key; //set the matched attribute
			}
		}

		if($request != 'get' && $request !='set' || !$varInArray){
			echo "call to undefined method $method";
		}else{
			switch($request){
				case('get'):
					return $this->{$attribute};
				case('set'):
					$this->{$attribute} = $params[0];
					return $this;
			}
		}
	}
}

This class can be inherited from so there won’t be any need to make standard getters and setters. Thanks to polymorphism, any of these dynamically generated methods can be overridden.

New Partybox Site

I just finished an overhaul of the site for my friends’ band Partybox


Go to the page and like them on Facebook to download their whole album free!