function ReplaceByDashes(string){
return string.replace(/\s/g,'-');
}
// run it
var string = "Hello my beautiful world!";
string=ReplaceByDashes(string);
alert(string);
if(typeof String.prototype.rbd==='undefined'){ // we have to check if someone hasn't added it already
String.prototype.rbd = function(){
return this.replace(/\s/g,'-');
}
}
// run it
var string = "Hello my beautiful world!";
string=string.rbd();
alert(string);
String.prototype.ucFirst = function () {
return (this.substr(0,1).toUpperCase() + this.substr(1,this.length));
}
sudo gconftool-2 --direct --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory --type Boolean --set /apps/gdm/simple-greeter/disable_user_list True
export XKL_XMODMAP_DISABLE=1
gconftool-2 -t bool --set /apps/gnome_settings_daemon/plugins/keyboard/active false
gconftool-2 --set "/apps/metacity/general/button_layout" --type string "menu:minimize,maximize,close"
function print_r(theObj){
if(theObj.constructor == Array ||
theObj.constructor == Object){
document.write("<ul>")
for(var p in theObj){
if(theObj[p].constructor == Array||
theObj[p].constructor == Object){
document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
document.write("<ul>")
print_r(theObj[p]);
document.write("</ul>")
} else {
document.write("<li>["+p+"] => "+theObj[p]+"</li>");
}
}
document.write("</ul>")
}
}
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
<?php
echo curPageURL();
?>
#!/bin/bash
MUSER="root"
MPASS="password"
MHOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
BAK="/mnt/backupdir"
GZIP="$(which gzip)"
NOW=$(date +"%d_%m_%Y")
for i in `find $BAK -ctime +22`; do rm $i; done
[ ! -d $BAK ] && mkdir -p $BAK
DBS="$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse 'show databases')"
for db in $DBS
do
FILE=$BAK/$db.$NOW.gz
$MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
done
sudo -u gdm gconftool-2 --set --type boolean /apps/gdm/simple-greeter/disable_user_list true