Archive for the ‘ Tips ’ Category

OSX Messenger all my contacts was unadmitted

A strange thing happened to my messenger, it was opened it today and my surprise was that all the contacts I have are listed as ( not allowed ).

Searching the net I find the solution.

Close MSN and open a terminal window and move to this directory:

1
/ Users / <- OUR USER -> / Library / Preferences / Microsoft

There you find a file named:

Microsoft Messenger User Cache.plist

What we have to do is rename the extension to any other (eg. Bak) to restart MSN after re-create your configuration settings.

We do this process by:

1
mv Microsoft \ Messenger \ User \ Cache.plist Microsoft \ Messenger \ User \ Cache.bak

Reboot MSN to see that everything worked properly.

jsPDF An javascript utility library for generate PDF’s

jsPDF is a javascript utility library for generate PDF’s
With only 5.8kb it let us to generate PDF’S dynamically.
Is compatible with Safari, Firefox 3.5 y iPhone Safari.

1
2
3
4
5
6
7
8
9
10
11
jsPDF.init();
jsPDF.addPage();
jsPDF.text(20, 20, 'Hello world!');
jsPDF.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
jsPDF.addPage();
jsPDF.text(20, 20, 'Do you like that?');

// Making Data URI
var out = jsPDF.output();
var url = 'data:application/pdf;base64,' + Base64.encode(out);
document.location.href = url;

iPhone & iPod Detection

For detecting iPhone / iPod / iPad users and redirecting them to their iPhone-compatible website you can use this simple code snippets:

PHP

1
2
3
4
5
6
7
8
9
if(
    strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') ||
    strstr($_SERVER['HTTP_USER_AGENT'],'iPod') ||
    strstr($_SERVER['HTTP_USER_AGENT'],'iPad')
)
{
    header('Location: http://yoursite.com/iphone');
    exit();
}

Javascript

1
2
3
4
5
6
7
8
if(
    (navigator.userAgent.match(/iPhone/i)) ||
    (navigator.userAgent.match(/iPod/i)) ||
    (navigator.userAgent.match(/iPad/i))
)
{
    //Your redirection code here
}

.htaccess

1
2
3
4
5
6
7
8
RewriteCond %{HTTP_USER_AGENT} ^.*iPad.*$
RewriteRule ^(.*)$ http://ipad.yourdomain.com [R=301]
RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$
RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301]
RewriteCond %{HTTP_USER_AGENT} ^.*BlackBerry.*$
RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301]
RewriteCond %{HTTP_USER_AGENT} ^.*Palm.*$
RewriteRule ^(.*)$ http://mobile.yourdomain.com [R=301]