Stop Micro-optimizing

November 10, 2009
By SeanJA

Let’s look at a common php ‘optimization’ tip (note that I am only running this test on my computer, and I am not shutting things down to help it go faster). Use single quotes ( ‘ ) instead of double quotes ( ” ) . The reasoning behind this is that php parses double...
Read more »

Classic Game Walkthroughs Part 1: Space Invaders

September 17, 2009
By SeanJA
Classic Game Walkthroughs Part 1: Space Invaders

Welcome to the first installation of Classic Game Walkthroughs. Today we tackle the arcade classic Space Invaders. Avoid the shots from the invaders. Shoot back. Repeat Until they are no more. Repeat until you run out of quarters. Share and Enjoy:
Read more »

When is 4 – 1 = 4?

August 27, 2009
By SeanJA

When c like languages say so $a = 5; $b = 1;   $result = $a---$b; echo $a; #=>4 echo $b; #=>1 echo $result; #=>4 public class FunMaths{ public static void main(String[] args) { int result; int a = 5, b = 1; result = a---b; System.out.println(a); System.out.println(b); System.out.println(result); } } Share and Enjoy:
Read more »

Are You a COBOL Programmer?

August 10, 2009
By SeanJA
Are You a COBOL Programmer?

Share and Enjoy:
Read more »

A couple useful jQuery Snippets

August 9, 2009
By SeanJA

For popups, just add class=”popup” jQuery('a.popup').live('click', function(){ newwindow=window.open($(this).attr('href'),'','height=200,width=150'); if (window.focus) {newwindow.focus()} return false; }); To open in a new tab, add class=”newTab” jQuery('a.newTab').live('click', function(){ newwindow=window.open($(this).href); jQuery(this).target = "_blank"; return false; }); Check if something is in view function in_view(elem){ var docViewTop = jQuery(window).scrollTop(); var docViewBottom = docViewTop + jQuery(window).height();   var elemTop = jQuery(elem).offset().top;...
Read more »

PHP Pop Quiz Hotshot

July 23, 2009
By SeanJA

Without running it, what does this do? function hmmm(){ $i = 'a'; $array = array(); while($i != 'z'){ $array[$i] = $i; $i++; } return $array; } Share and Enjoy:
Read more »

A better way to use jQuery in WordPress Themes

July 1, 2009
By SeanJA

Since a lot of people come to my blog looking for a way to add jQuery into their wordpress themes, it turns out that there is a better way to do it than the way that I previously blogged. You can include jQuery from the current WordPress install by calling: wp_enqueue_script("jquery"); Followed by: wp_head();...
Read more »