jump to navigation

awesomeness – perceptive pixel July 27, 2007

Posted by chris in : rant , add a comment

Just watch: http://perceptivepixel.com/

alter css values dynamically with javascript July 26, 2007

Posted by chris in : ajax/dom/javascript , add a comment

You can use javascripts document.getElementById().style method to alter CSS values. Here’s an example:

Create your div tag:

Now create your javascript function:

function changeCss()
{
     document.getElementById("myDiv").style.border = '2px dotted #CCC';
}

Now you can call this javascript function on any given event to alter your CSS tags border. Things like height, width, and a bunch others work as well. For instance create an html button, and onclick call the changeCss() function.

ajax and the xmlhttprequest object July 16, 2007

Posted by chris in : ajax/dom/javascript, php , add a comment

I’m teaching myself “ajax” here is how to create the basic xmlhttprequest object, interact with a server-side scripting language such as php, and display the returned xml to the page (in this case a series of html form text boxes).

(more…)

easy mysql backup July 6, 2007

Posted by chris in : SQL, linux, php , add a comment

Here’s an example of quick script I wrote in PHP and added as a cronjob to backup some mysql databases:

// dump database tables to sql text files //
exec('mysqldump -uroot -pPasswordHere music > /tmp/music.sql');
exec('mysqldump -uroot -pPasswordHere taskfreak > /tmp/taskfreak.sql');
// pack into tarballs //
exec("tar -cf /tmp/music.sql.tar /tmp/music.sql");
exec("tar -cf /tmp/taskfreak.sql.tar /tmp/taskfreak.sql");
// gzip tarballs //
exec("gzip /tmp/music.sql.tar");
exec("gzip /tmp/taskfreak.sql.tar");