Code / Work

my not-so-boring coding attempts

Fade transit dynamically updated DOM content using jQuery

This jQuery plugin originated from smooth transition requirements in the live module. Earlier that module would do immediate replacement of existing dynamic content/comment preview with the updated preview.

That, however, did not look nice for a so so neat module. Cool Neither did fadeOut() and fadeIn() stand good. Since there would be a gap between them i.e. there would be a transition among three items: from Preview 1 to background to Preview 2, unlike transition from Preview 1 to Preview 2.

I found innerFade quite like the thing I needed, but it would require extra touch since my requirements were dynamic content updating. Later, I also discovered the Cycle plugin. ( continue reading... )

Firebug 1.2 Beta 3 SVN build

Since getfirebug.com is down from several days, plus there's no mirror available via Google searches for Firebug 1.2 Beta 3, I went ahead with building my own from source. This is the Firebug 1.2 plugin/extension build from it's SVN repository, revision 743. The build is latest as of JUN 13TH, and is, possibly, ahead of beta 3 version of Firebug 1.2. Please remember this is a development build, rather than being a stable one, so it is prone to bugs and might crash your Firefox installation, and with that I take no responsibility of this thing! =D

Install Firebug 1.2 Beta 3.x (SVN Revision 743)

Compatibility: Firefox 1.5 -> Firefox 3 ( continue reading... )

Hash Check failed for your download? Torrents can fix it!

Here's how I went fixing my 3.3GB of Fedora i386/32-bit DVD ISO, downloaded directly(http) from an official mirror, which went kaput. x-( Hash check(SHA1) failed to verify the ISO! Rather than a fresh download, I went fixing the ISO itself.

  1. Download your data(ISO, ZIP, etc.) from any source or mirror. Sometimes it's faster to grab than a torrent download, but you may corrupt your big downloads with frequent pauses or crashes, and the checksum fails to verify!
  2. Download your favorite Bit Torrent client. Here are some recommendations: µTorrent for Windows and KTorrent for KDE.
  3. Search for the exactly same data torrent, and open using the torrent client.
  4. Monitor the location of your torrent downloads directory while you start the download. Stop the torrent as soon as the files are created there.
  5. Now replace the file in the torrent downloads with the one you downloaded earlier. Make sure the name is intact as the torrent client made it. For example, Fedora-9-i386-DVD.iso.bc! is the format for incomplete BitComet torrent downloads.
  6. Now you need to check the data integrity of your torrent. The option is "Check data integrity" in KTorrent, and "Force Re-Check" in uTorrent(µTorrent). It'll take a few seconds to verify your data for corrupt parts and enlist to itself for re-download of them. My check stopped at 99.9% for Fedora-9-i386-DVD.iso.
  7. When the check is finished, proceed with starting the torrent now. In my case, 0.01% was downloaded again, fixing my ISO!
  8. Yay!! Now help others out! And keep seeding. :Smile


In whole, you are able to download stuff faster than torrents(sometimes Wink ) via http/ftp sources, and later fix up any errors that download may have using a torrent client! Good luck! ( continue reading... )

Toggle the "www" domain prefix without .htaccess directives

Two years back I created a basic module toggle_www to toggle the "www" part of your Drupal website, taking the user the correct requested page. In other words, redirect users from http://www.example.com/some/deep/page to http://example.com/some/deep/page or vice-versa. However, killes suggested to take it off, because the same functionality could be achieved using some redirect directives in .htaccess. Being new in the developer community at that time, upon a short thought I took the project page off.

However, users using IIS, or whose servers don't allow .htaccess files - just like this blog's host HCoop.net does(they have their own tool Domtool), need a separate solution if they want to manage the above said. So before I revive the toggle_www module for Drupal 6.x, some overview how we redirect using PHP's header() function. This is rather some easy PHP stuff, with some aspects covered. ( continue reading... )