Month: April 2010

Disable PHP warnings in seyret

The seyret video module used on this site is awesome, but the PHP warnings it was spewing out on my site were unacceptable. Finally tracked it down. The errors looked like this: Notice: Undefined variable: catlistoption in /home/content/html/components/com_seyret/views/video/video.view.php on line 0 Warning: Invalid argument supplied for foreach() in /home/content/html/libraries/joomla/html/html/select.php on line 68 This was driving…


Busted Westinghouse TV SK-32H540S

I got a frantic call from my mom a while back about her Westinghouse TV. She would turn it on, and then seconds later, the display would go blank. The audio stayed on, and the blue power indicator stayed lit, but there was absolutely nothing on the screen. I looked at it a bit, and…


Bash MySQL function

I use this function to run SQL queries from bash scripts. [code lang=”bash”] fRunQuery(){ # This function should always be preceeded by a SQL statement # Loaded into the variable SQL # ie) SQL="SELECT * FROM table"; fRunQuery # The results of the query will be loaded into the variable # $RESULT: RESULT=`mysql –skip-column-names -h${dbhost}…


Javascript to format date like mm/dd/yyyy hh:mm:ss

[code lang=”js”] var today = new Date(); var dd = today.getDate(); var mm = today.getMonth()+1;//January is 0! var yyyy = today.getFullYear(); var hours = today.getHours(); var minutes = today.getMinutes(); var seconds = today.getSeconds(); if(dd<10){dd=’0’+dd} if(mm<10){mm=’0’+mm} d=mm+’/’+dd+’/’+yyyy+’ ‘+hours+’:’+minutes+’:’+seconds [/code]


AJAX waiting indicator

The following code snippet will display a waiting indicator during any AJAX request. [code lang=”js”] //Adds a wait indicator to any ajax requests $(‘body’).ajaxStart(function() { $(‘#loading’).show(); }); $(‘body’).ajaxStop(function() { $(‘#loading’).hide(); }); [/code]