Open Source

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 »

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 »

Posted in Javascript, Open Source, PHP, Programming, Wordpress, jQuery | 2 Comments »

Smarty Best Practices 1

May 7, 2009
By SeanJA

I know I have slagged a lot on smarty in the past, both on my blog and on twitter… It is not because I do not understand it, it is because I see it being misused (at least as far as I am concerned, I may be wrong about it) every day in old...
Read more »

Posted in Open Source, PHP, Programming, Smarty, WTF | No Comments »

Smarty… again

April 9, 2009
By SeanJA

Smarty again.To those who think that smarty prevents you in any way from writting your business logic into a template… watch this…   {php}   if (!$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')) { echo 'Could not connect to mysql'; exit; }   if (!mysql_select_db('mysql_dbname', $link)) { echo 'Could not select database'; exit; }   $sql...
Read more »

Posted in Computer, Open Source, PHP, Programming, WTF | No Comments »

Why I use NetBeans

April 7, 2009
By SeanJA

I am sure you know by now that IBM was set to aquire Sun Microsystems this week. This would have been bad seeing as most of their products directly compete/overlap with eachother. Fortunately they backed off at the last minute (or at least they did not offer enough money for them). While this might...
Read more »

Posted in Computer, Eclipse, IDE, Java, Javascript, Netbeans, Open Source, PHP, Programming | 12 Comments »