Sunday, December 6, 2009

Google Analytics new asynchronous tracking code

Google Analytics has now provides new asynchronous tracking code. The main feature of the asynchronous code is that it could load ga.js while the page is being rendered.

There are two ways to use this code.

  1. Place the code below before the  </head> tag.
     <script type="text/javascript">  
     var _gaq = _gaq || [];  
     _gaq.push(['_setAccount', 'UA-XXXXX-X']);  
     _gaq.push(['_trackPageview']);  
     (function() {  
       var ga = document.createElement('script');  
       ga.src = ('https:' == document.location.protocol  
         ? 'https://ssl' : 'http://www')  
         + '.google-analytics.com/ga.js';  
       ga.setAttribute('async', 'true');  
       document.documentElement.firstChild.appendChild(ga);  
     })();  
     </script>  
    

  2. Split the code. Half of the code will be put before the </head> tag. Another half will be put at the end of the page, before the </body> tag.
    The first half (before </head> the tag).
     <script type="text/javascript">  
     var _gaq = _gaq || [];  
     _gaq.push(['_setAccount', 'UA-XXXXX-X']);  
     _gaq.push(['_trackPageview']);  
     </script>  
    
    The second half (before </body> the tag).
     <script type="text/javascript">  
     (function() {  
       var ga = document.createElement('script');  
       ga.src = ('https:' == document.location.protocol  
         ? 'https://ssl' : 'http://www')  
         + '.google-analytics.com/ga.js';  
       ga.setAttribute('async', 'true');  
       document.documentElement.firstChild.appendChild(ga);  
     })();  
     </script>  
    

Note:

  1. Remove any existing Google Analytics code before using this asynchronous code.

  2. Disable any Google Analytics plugin (if you use one) for WordPress.

  3. Replace UA-XXXXX-X with your web property ID.

Saturday, December 5, 2009

Hard reset Nokia E71

To hard reset Nokia E71:

  1. Switch off the phone.

  2. Press and hold down *, 3 and talk/green keys while switching on the phone, until you see the Nokia boot up screen.


The default password is 12345.

Please note that this action would remove everything from the phone memory, and restore the factory settings.

However, it will not erase the contents of the memory card.

Note:

  1. You can also hard reset E71 via *#7370# code.

  2. To reset E71 to its factory settings only, use *#7780# code.

Thursday, December 3, 2009

Orbit Downloader hijacks 404 error pages

Orbit Downloader is a free download manager for Windows operating system without ads. Besides, it can also be used to download video/music/streaming media from Myspace, YouTube, Imeem, Pandora, and Rapidshare.

However, in spite of being an ads free download manager, by default it will hijack all 404 error pages in your browser, by redirecting the pages to orbitdownloader.com search page.

Maybe it is a good feature that you might like, but it is not for me.

Fortunately, Orbit Downloader allow you to disable this feature, as depicted in Figure 1.

Figure 1: Disable Orbit Downloader 404 pages hijack

To disable this feature,
  1. Open Orbit Downloader windows, from the Start Menu, or by double clicking its icon in the system tray.
  2. Click on Tools > Preferences > Monitoring.
  3. Untick "Let Orbit suggestions on browser navigation error".
  4. Click OK.
  5. Restart your browser.

Friday, November 20, 2009

Enable Mod Rewrite on WAMPSERVER

You need to enable Mod Rewrite in order to use pretty permalinks in WordPress or Clean URLs in Drupal.

However, WAMPSERVER does not enable Mod Rewrite by default.

To enable Mod Rewrite,
  1. Click on the WAMPSERVER icon in the system tray, and choose Apache.
  2. Click on Apache modules.
  3. Click on the down triangle until you see rewrite_module. Click to enable it.
  4. Restart All Services.
Figure 1 shows the steps graphically.

Figure 1: Steps to enable Rewrite Module on WAMPSERVER 




Thursday, November 19, 2009

How to use CSS to style code snippets

It is easy to use CSS to style code snippets, as shown in Figure 1.

[caption id="attachment_2836" align="alignnone" caption="Figure 1: Sample output of CSS style for code snippets"]Figure 1: Sample output of CSS style for code snippets[/caption]


Step 1: Append this code inside a style sheet.


pre{ font-size:12px; background:#fff; border:1px solid #000; line-height:20px; width:600px; overflow:auto; overflow-y:hidden; margin:0; padding:0; } pre code{ font-family:Monaco,Courier; display:block; margin:0 0 0 40px; padding:18px 0; } 

Step 2: Put the code snippets inside <pre> and <code> tags.


<pre><code>def f(): txt = "Some sample code" return txt </code></pre>

3 free online resources to help you learn Linux commands

These websites should provide you with the basic (up to advance) command line skills, as well as teach you some neat command line tricks.

1. LinuxCommand.org




LinuxCommand.org is a Linux education and advocacy site devoted to helping users of Linux operating systems.

Visit LinuxCommand.org.

2. Linux Command Directory



Linux Command Directory is a directory of 687 Linux commands with descriptions.

Visit Linux Command Directory.

3. The Linux Cookbook



The Linux Cookbook presents "recipes" for preparing or accomplishing a particular, specific thing.

Visit The Linux Cookbook.

Windows Media Player 11 download

Windows Media Player 11 is the latest release of Microsoft's video and audio player that can rip CDs and play videos/DVDs.

Windows Media Player 11
Requirement: Windows XP with Service Pack 2 (SP2) installed.

Download Windows Media Player 11 (23Mb)