Make a div stick to top when scrolled to

There are times when you would want to display a bar at the top of the page when user scrolls on the page and it should go back to its original position when the user scrolls back up. This is particularly useful when you want to add say a share bar, a search bar, etc and make it always visible even when the user is at the bottom of the page.
Read more »

Migrating servers using DNS TTL for minimum downtime

You have your site running on an old hardware and want to migrate it to a new upgraded hardware which would result in change of the ipaddress of your site and in turn imply downtime for your site. You want to minimize the downtime due to the change in ipaddress. This can be easily achieved using the Time-to-live (TTL) values of the Domain Naming Service (DNS) entries of your website.

The users usually use your site name and not the ipaddress to visit to your site. DNS is used to resolve the site name to the correct ipaddress. The DNS entry is stored at various levels (browser, OS, proxy server, DNS servers, etc) and is cached for a specific period called as Time-to-live (TTL). Once the TTL expires, the DNS record will be fetched again from the DNS Server. Usually the TTL for a DNS entry is specified as 3600 sec (i.e. 1 hr). The TTL values can be even lower (0, i.e. no caching) or higher (up to 68 years).

Read more »

Notepad++ Keyboard Shortcuts

I have been using Notepad++ everyday for coding at home and work for past 2-3 years. I don’t remember using any other editor during this entire period. I like this editor very much due to various features like syntax highlighting, collapse/expand functionality, ability to open 2 workspaces in same window, find in All Open Documents, find in directory, etc. It supports so many languages like PHP, JavaScript, HTML, CSS, XML, C, C++, Java and many more. Also, it has many plugins for formatting the code, FTP directly from the editor, file browser, RegEx Helper, etc. It can be used on systems on which you do not have the admin permissions (i.e. cannot install new softwares) or even run from a flash drive without even installing on the machine.
It is due to above reasons and many more that I recommend it. All these features indeed help me in faster development, but there is another method that I use for faster development and that is Keyboard Shortcuts. I am a huge user of Keyboard shortcuts and use them not just in Notepad++ but in even other software/applications.
Here is the list of all the keyboard shortcuts as mentioned in the Notepad++ Documentation. I will mark some of the shortcuts, in bold, that I use most frequently. All the shortcuts can be changed from the Shortcut Mapper which can be opened from Settings > Shortcut Mapper Menu.

Read more »

404 Error Page Best Practices

A 404 error page is the page that the user may reach due to various reasons. Some of the reasons are:

  • The user has entered / spelt the URL incorrectly.
  • The page has been moved or deleted.
  • The URL they clicked on was incomplete or cut in an email or message.

Read more »

How and when to use robots.txt file

We have heard of crawlers and bots are crawling our sites to scrap content for various reasons like indexing in search engines, identifying content, scanning email addresses, etc. There are all kinds of crawlers/bots which crawl websites. While some are good which should be allowed access to our site, but we might want to restrict some. In this post we will see how we can do this.

Topics Covered:

Read more »