Archive for the 'tech' Category

HTC Incredible – Name That Fits

Tuesday, May 18th, 2010

I’ve recently traded my trusted Blackberry 8330 smartphone for a HTC Droid Incredible and I have to say the name truly fits this tiny powerhouse called a phone. The biggest feature that I’m loving right now is an usable app store, if you’ve every used Blackberry’s app world you’ll know what a painful experience that can be.

I’m also loving the camera, 8 megapixels is as same as my Canon DSLR. Browsing the web is now a dream as well, the included browser even supports Flash albeit in a lite format. Another handy feature is the speech recognition is very good and very well integrated into the built in Google search, allowing very quick searches via speaking rather than typing.

Although I did have some doubts with the onscreen keyboard, I have fat fingers and always struggled to type on the tiny Blackberry keyboard, but the key recognition is spot on. The predictive text is also very good and eases some of the typing. Battery life can be a bit iffy for a full day of use, but as powerful as the phone is I’ll certainly trade having to charge it more often for the power. (more…)

Tags: ,

Server Migration – Part 2

Thursday, February 11th, 2010

I’ve finished the server migration and everything was successful and only maybe 30-45 minutes of downtime. The old computer I’m using for a server got an upgrade while I was migrating as well. A little faster processor and doubled the memory in it.

I did run into a problem with ESXi, apparently since the motherboard was older in the server ESXi wouldn’t install correctly onto the drive I had in there, and the motherboard also didn’t support booting from USB to install ESXi to a flash drive, as suggested by a few sites. So I scraped the idea for ESXi and installed CentOS 5.4 on the server without any desktop managers and disabled everything except a few essential services, this netted a server using less than 200 MB of memory. Then I installed VMWare Server 2 on it and transferred my VM image over to the server. Although there is more overhead having a complete OS and VM Server for my purposes it should be fine.

Tags: ,

WordPress Theme Developers Tip – Call Dynamic CSS the Right Way

Monday, January 25th, 2010

While developing my Techozoic theme, I’ve progressed from adding custom CSS into the head section, to having an external file and using $_GET variables to pull options from the database, to now I believe is the right way to do it, using add_filter and a custom query in WordPress. By using this new method I’ve done away with unsafe $_GET variables and can now use any builtin WP functions in the external file.
First you’ll need to edit your functions.php file and add this block of code.

	add_filter('query_vars', 'add_new_var_to_wp');
	function add_new_var_to_wp($public_query_vars) {
		$public_query_vars[] = 'my_theme_custom_var';
		//my_theme_custom_var is the name of the custom query variable that is created and how you reference it in the call to the file
		return $public_query_vars;
	}

This sets up WP to now accept a new variable in a query called my_theme_custom_var the format of the query would be http://www.yourblog.com/index.php?my_theme_custom_var=css . The ? mark tells WP that this is a query and the = sign tells what the query variable should be set to.

Now to actually setup the function that will call the external file. I found this gem when looking at how popular WP theme called Atahualpa handled it’s external CSS.

	add_action('template_redirect', 'my_theme_css_display');
	function my_theme_css_display(){
		$css = get_query_var('my_theme_custom_var');
		if ($css == 'css'){
			include_once (TEMPLATEPATH . '/style.php');
			exit;  //This stops WP from loading any further
		}
	}

This code now will check if a query is passed to WP with the value my_theme_custom_var and if it is and has the value of css then it includes the style.php file which is our dynamic CSS file. Then the code exits which stops any other functions from happening other wise the whole home page is outputted along with the style.php file, which isn’t what is needed only the file.
Now you can use any WP functions on the style.php file as it is included from the functions.php file which is a standard WP file.
Source : Will Norris

Tags: , ,

WordPress Theme Options Framework Ver 2

Tuesday, January 12th, 2010

As I’ve worked more on my theme and increased my coding skills I’ve added to my original theme option framework. I’ve become more aware of best practices of coding and WordPress, a big issue with the original framework was the way options were added to the wp_options database table. Each theme option got it’s own entry in the table, this might be okay for small theme, but I’ve grown to over 40 different options in my Techozoic theme. It was time to optimize, with the new framework the entries added to the wp_options table went from 40 to 2. I’ll continue below with code examples and explanations. As an added bonus I’ve included an example of how to pull your theme options into a external stylesheet, based off of this concept.

(more…)

Tags: , , ,

WordPress, Caching, and Compression

Tuesday, October 27th, 2009

ApacheAfter reading this article dealing with “bulletproofing” a blog, I started looking at my own blog. Over the past few months as more and more great plugins come out that I depend on now, my page load times had started suffering. A load time of 14 seconds on a T1 was not unheard of, and it could get as bad as 20 seconds on some days. The article by Eric Amundson had a link to a couple of Firefox plugins that looked promising in helping diagnose ailing websites. One is Page Speed from Google. The other from Yahoo! called YSlow.

(more…)

Tags: , , , ,