Programming

Getting Started With PHPUnit

February 11, 2010
By SeanJA

We all agree that testing code is better than not testing it right? So why do we tend to avoid writing unit tests to make sure that we are writing code that works? I’m looking at you PHP guys. Good thing there is PHPUnit and it is as easy as can be to get...
Read more »

Posted in PHP, Programming | 4 Comments »

Simple Tool Tip with jQuery

December 1, 2009
By SeanJA

I saw a post that talked about how to make a simple tool tip with jQuery, but that post did not make a plugin of it. It just added the function to the global scape, meaning that it was not chainable and it would only be applied to the a element. So I took...
Read more »

Posted in Javascript, Plugin, jQuery | No Comments »

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 »

Posted in Java, PHP, Programming, WTF | 4 Comments »

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 »

Posted in Javascript, Open Source, Programming, jQuery | 9 Comments »

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 »

Tags: , , , ,
Posted in PHP, Programming | 4 Comments »