Stephen R. Blair

Author Archive

Reading is Knowledge, Knowledge is Power!

by Stephen Blair on Aug.20, 2009, under General Posts

Those that knew me growing up would probably laugh and want to call bullshit on me if they were reading this right now. They would say “Steve? Read? Hahaha, yeah right!”. My former teachers would probably have a heart attack.

It is true, I hated reading with a passion. Every time I would pick up a book it was like a sudden case of narcolepsy, reading was a great sleep aid for me. However, later in life I would come to realize that I don’t hate reading, in fact, I love it!

(continue reading…)

Leave a Comment :, , , , , , , , , , , , , , , , , more...

PHP Perfect Shower

by Stephen Blair on Jun.17, 2009, under A PHP Life

If your shower knew PHP, you would have a perfect shower every time!


// PHP Perfect Shower | Stephen R. Blair | www.srblair.com

require_once('water_control.php');

// Run the hot water if it is not already running
if(!isset($hotWater)) {

	$hotWater = true;
	hotWaterTemp(); //Get the hot water temperature

}
// Run the cold water if it is not already running
if(!isset($coldWater)) {

	$coldWater = true;
	coldWaterTemp(); //Get the cold water temperature
}

$targetWaterTemp = '107'; // Your ideal water temperature in degrees

$currentWaterTemp = $hotWaterTemp - $coldWaterTemp; // The current water temperature

// Adjust the hot and cold water until desired temperature is met
while($currentWaterTemp != $targetWaterTemp) {

	if($currentWaterTemp > $targetWaterTemp) {

		moreColdWater(); // Add cold water if it is too hot

	} else

	if($currentWaterTemp < $targetWaterTemp) {

		moreHotWater(); // Add hot water if it is too cold

	}

}

1 Comment :, , , , , more...

Twipping Point – When to say goodbye to a fellow tweeter?

by Stephen Blair on Jun.02, 2009, under General Posts

With the exploding popularity of Twitter has also come a new form of annoyance that some would even call SPAM if you have hit their twipping point. Most of us love all of the information and entertainment we receive from our followers and those that we are following, but there are some tweeters out there that we just need to let go of, wave goodbye to (or sneak away quietly) and stop following. Have you come across this tweeter? This person thinks that everyone wants to know every single website they visit throughout the day or a play-by-play of their average and ultimately boring day.

(continue reading…)

Leave a Comment :, , , , , , , , , , , , more...

Waking Up PHP

by Stephen Blair on Apr.25, 2009, under A PHP Life

My PHP Coffee Mug script has inspired a new category on my blog called A PHP Life and here is the latest addition!

Stay tuned for more to come!



// Waking Up PHP | Stephen R. Blair | www.srblair.com

function morningAlarm() {

	//The snooze button has not been smashed yet
	$snoozeCount = 0;

	//The alarm is buzzing
	if(isset($alarm)) { 

		if($snoozeCount <= 3) { //If you have not hit the snooze button at least 3 times...

			$snoozeCount++; //Go ahead and hit it again!

		} else { 

			$wakeUp = true; //Otherwise, wake your ass up!

		}

	}

}

Leave a Comment :, , , , , , , , , more...

PHP Coffee Mug v1.0

by Stephen Blair on Apr.24, 2009, under A PHP Life

A co-worker and myself went to Starbucks today where I decided that I really could use an office coffee mug to keep at work. I of course chose the largest mug they had which also just happens to come with a porcelain pen that you can use to write on it and eventually heat treat to make permanent. As I was sitting here writing code for work I was also thinking about what clever sayings or cool pictures I could put on my new coffee mug. The mixture of work and play came out as a random coffee mug php script I have come to label as “PHP Coffee Mug v1.0″.

I hope you enjoy my random and utterly useless coffee mug script!


// PHP Coffee Mug v1.0 | Stephen R. Blair | www.srblair.com 

require_once('coffee_cup.php');

if($coffeeCup == empty) {

	//Check to see if there is a fresh pot of coffee
	if($coffeePot != 'fresh') {

		//Make a fresh pot of coffee
		makeCoffee();

	} else {

		//Pour coffee into the coffee cup
		pourCoffee();

		//Drink the coffee!
		drinkCoffee();

	}

} else {

	//Check the date for the coffee in the mug
	if($date > $dateExpire) {

		//Rinse out the cup if it is old coffee
		rinseCup();

		//Check to see if there is a fresh pot of coffee
		if($coffeePot != 'fresh') {

			//Make a fresh pot of coffee
			makeCoffee();

		} else {

			//Pour coffee into the coffee cup
			pourCoffee();

		}

	} else {

		//The coffee is fine, drink it!
		drinkCoffee();

	}

}


Leave a Comment :, , , , , , , , , , , , , , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!