Pages

Nov 16, 2012

Great backbone.js tutorials

http://www.joezimjs.com/javascript/introduction-to-backbone-js-part-1-models-video-tutorial/

This is a great backbone.js tutorial by Joe Zim. First he explains what are the different things that constitute backbone.js framework and then he builds a sample app with backbone.js.

How to quickly view the page structure


This technique allows you to quickly view the structure of a web page with just a click. An example is shown above.

To get this create a bookmark in your browser called Outline Page Structure and add the following Javascript code in the URI input field.

javascript:elem=document.getElementById("dev-outliner");if(elem){elem.parentNode.removeChild(elem);}else{document.body.insertAdjacentHTML('beforeEnd', '');}

How to use?

  1. Click once to view the page structure outline.
  2. Click again to remove the page structure outline.

Nov 15, 2012

How to debug htaccess errors

Find the httpd.conf in your server. For me this was located at c:\xampp\apache\conf\httpd.conf. Then add the following two lines at the end of the file.

RewriteLog "c:/path_to_your_website/rewrite_log.txt"
RewriteLogLevel 5

Then restart the server.

Now when you access the website a detail log is created in rewrite_log.txt on how the htaccess instructions are processed.

Important Tips:
  1. The best way to debug is before you access any URI on your website clean rewrite_log.txt file. This way atleast you know where to start.
  2. After debugging is complete remove or comment out the above two lines in httpd.conf file. If you don't do this the rewrite_log.txt will keep on growing in the background taking up your precious harddisk space.

Nov 9, 2012

Handling text overflow with CSS



Don't cut strings if are trying to fit text in a limited space. Instead use text-overflow CSS property.

Proper implementation of text-overflow can be found at http://www.quirksmode.org/css/textoverflow.html.

text-overflow is supported in most browsers as shown at http://caniuse.com/text-overflow.