Tuesday, August 31, 2010

Block SideWiki on your website

Put this javascript in the < head > section of your web pages:

<script charset="utf-8" type="text/javascript"> 

if( location.href.indexOf('#SWBLK') == -1){
  if( navigator.userAgent.indexOf('GTB') > 0 ){
    var theTime = new Date();
    location.href = location.href + '#SWBLK' + theTime.getTime();
  }
}
</script> 

Saturday, August 21, 2010

jQTouch form login with redirect example

First file, jqtform.html:



<html>
<head>
<meta charset="UTF-8" />
<title>jQTouch &beta;</title>
<style type="text/css" media="screen">@import "jqtouch/jqtouch.min.css";</style>
<style type="text/css" media="screen">@import 
"themes/jqt/theme.min.css";</style>
<script src="jqtouch/jquery.1.3.2.min.js" type="text/javascript" 
charset="utf-8"></script>
<script src="jqtouch/jqtouch.min.js" type="application/x-javascript" 
charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
var jQT = new $.jQTouch({});

$(function(){ 
$('body').bind('pageAnimationEnd', function(event, info){
//alert($('#Success')[0].innerHTML);
if ($('#Success') && $('#Success')[0].innerHTML=='Success'){
$(location).attr('href','http://www.jqtouch.com/');
}
});
});

</script>
<style type="text/css" media="screen">
body.fullscreen #home .info {
display: none;
}
</style>
</head>
<body>
<form id="myform" action="jqtform.php" method="POST" class="form">
<div class="toolbar">
<h1>Log in</h1>
</div>
<ul class="rounded">
<li><input type="text" name="username" value="" placeholder="Username" /></li>
<li><input type="password" name="password" value="" placeholder="Password" 
/></li>
</ul>
<a style="margin:0 10px;color:rgba(0,0,0,.9)" href="#" class="submit 
whiteButton">Submit</a>
</form>
</body>
</html>



Second file, jqtform.php:



<?php
$title = "Wrong username or password";
if ($_POST["username"] && $_POST["password"]) {
if ($_POST["username"] =="jqtouch" && $_POST["password"] == "jqtouch") { 
$title = "Success";
}
}
?>
<div>
<form id="myform" action="jqtform.php" method="POST" class="form">
<div class="toolbar">
<h1><?php echo $title ?></h1>
</div>
<ul class="rounded">
<li><input type="text" name="username" value="" placeholder="Username" /></li>
<li><input type="password" name="password" value="" placeholder="Password" 
/></li>
</ul>
<a style="margin:0 10px;color:rgba(0,0,0,.9)" href="#" class="submit 
whiteButton">Submit</a>
</form>
<?php if ($title == "Success"){ ?>
<div id="Success">Success</div>
<?php } ?>
</div>

Friday, August 13, 2010

Permanently mounting a VirtualBox shared folder in a Ubuntu guest

Assuming your shared folder is called vbshared, first:

sudo mkdir /mnt/vbshared

Then, add the following line to the file  /etc/fstab:

vbshared /mnt/vbshared vboxsf defaults 0 0

Restart your Ubuntu guest.

Ubuntu Linux Folder Sharing Error: Failed to execute child process "testparm" (No such file or directory)

apt-get install samba-common-bin

Wednesday, August 11, 2010

 
Jeffrey Ting Jeffrey Ting on Facebook Jeffrey Ting on Spock Jeffrey Ting on Plaxo Jeffrey Ting on Spoke Jeffrey Ting on LinkedIn