Web Development

Setting Nginx, PHP Fastcgi and XCache on a new Ubuntu

Posted on

Recently, because of a mandatory VPS move I had an opportunity to migrate all my sites from apache to nginx. My old box was in a messy state and setting up a new box from scratch was always going to be fun. Here in this post, I will walk you through all the steps that helped me migrate seamlessly. Specially, how did I setup the new box ensuring zero downtime on the sites. Ensuring zero downtime while migration: By the time I will pin up various pieces on my new vps box, I didn’t want my site visitors to see […]

Web Development

Making cross-sub-domain ajax (XHR) requests using mod_proxy and iframes

Posted on

One of the restrictions imposed by all browser side programming languages is that one cannot make cross-domain ajax requests. This restriction comes because of the same origin policy and even sub-domain ajax calls are not allowed. In this blog post, I will demo two methods of making cross-sub-domain ajax requests. First demo will use mod_proxy module of Apache. While the second demo will use iframe and javascript tricks for making sub-domain ajax requests. Using mod_proxy for cross-domain ajax requests By enabling mod_proxy module of apache2, we can configure apache in reverse proxy mode. In reverse proxy mode, apache2 appears be […]

Open Source

Introducing jSlider: A Content Slider plugin for JQuery

Posted on

jSlider is a light weight JQuery plugin for content sliding. By content we mean everything: HTML code, Images, Advertisements etc etc. jSlider allows to put our content in simple <div>‘s, and then it automatically generates a content slider for you, which one can customize using various options provided. Screenshot Below is a screen shot of a content slider using jSlider: Download and Demo jSlider is hosted at google code. Use the following links for demo and downloads: Download the source code. Click for a demo of jSlider Using jslider.jquery.js Below is a sample html code which will be processed by […]

Web Development

fixed.js – Solution to IE6 “position:fixed” Bug

Posted on

IE6 has been a bane for all frontend developers for years. An element can be positioned relative to the browser window using the style position:fixed, it does not move when the page is scrolled. You can do nice layout things (e.g. facebook chat bar) with this in most modern browsers but not for IE6 in windows until you use fixed.js Sample Code for Facebook Type Chat Bar <html> <head> <style type=”text/css”> body { margin:0px; padding:0px; height:1600px; position:relative; } #shoutbox { position:fixed; background-color:#F2F2F2; border-top:1px solid #CCCCCC; bottom:0px; left:0px; width:100%; height:25px; } </style> <script type=”text/javascript” src=”fixed.js”></script> </head> <body> <div id=”shoutbox”> <!– Our […]

Web Development

Getting started with Autotools – GNU Build System on Debian

Posted on

If you eat and drink open source, chances are high that you might have downloaded an open source project code, only to see files like: aclocal.m4, configure.ac, Makefile.am, Makefile.in and what not. You might have also used commands like ./configure, make etc but what are these files? Does they really belong to the project you download? Do I need to understand them? In this blog post I look forward to answer all your question, as well as introduce you to not so popular Autotools – A GNU Build System. Setting up Autotools on Debian? Before we go ahead and understand […]

Web Development

Getting started with Openlaszlo – Framework for developing flash apps

Posted on

Openlaszlo is an open source framework which simplifies development of flash applications. Openlaszlo allows you to code your flash apps using xml style laszlo code, and thereafter you can compile your code to output a .swf file for production usage. I first came around openlaszlo while I was developing Alterplayer – open source flash mp3 player. In this post I will demonstrate: Getting started with Openlaszlo – Setting up your dev enviornment Hello World! in Openlaszlo Upcoming tutorials Setting up Openlaszlo development environment Download the latest openlaszlo release 4.4 from http://openlaszlo.org/download or alternatively download directly from http://download.openlaszlo.org/4.4.0/openlaszlo-4.4.0-windows-dev-install.exe Double click and […]

Web Development

Toggle : A Javascript game, anyone up for the challenge?

Posted on

This weekend I came across a game made using java applets. Initially looked like its possible to solve it, but slowly we realized that there might be no solution to this game. Finally I decided to clone it using javascript and see if you can solve the same. Toggle PS: Tested on all browsers except IE Modes: I included a custom mode in this game. Original game had only the classic mode. Classic Mode: When you click a square in classic mode, that clicked square and all neighbourhood squares toggle their colors (excluding diagonal neighbours). Custom Mode: In custom mode, […]

Web Development

Konami Code on Facebook : How to implement it on your site

Posted on

Yesterday while chatting with friends, I discovered an unusual thing on facebook. Unusual because I didn’t see any sense in what I saw back then. The process to discover this unusual thing is as follows: How to view lens flare on facebook 1. Login to facebook.com 2. Click once anywhere on your home page 3. Click the following sequence of characters using your keyboard 4. Up, Up, Down, Down, Left, Right, Left, Right, B, A, Enter Key 5. Click again on the page or try to scroll the page up or down If everything is done correctly you will see […]

Web Development

Getting Google Page Rank using Javascript – For Adobe AIR Apps

Posted on

Last week while working on SEO Analyzer v 1.1 desktop application, I faced a challenge of getting google page rank for a particular site using javascript. I am not sure if someone has already done this before, but I thought of sharing this javascript code for all adobe air and web developers out there. googlepagerank.js var googlepagerank = { hexdec: function(hex_string) { hex_string = (hex_string+”).replace(/[^a-f0-9]/gi, ”); return parseInt(hex_string, 16); }, count: function( mixed_var, mode ) { var key, cnt = 0; if( mode == ‘COUNT_RECURSIVE’ ) mode = 1; if( mode != 1 ) mode = 0; for (key in […]

Web Development

Using Image Maps in Javascript – A Demo Application

Posted on

Past month I was busy with project back in office, JAXL web chat client and photolog – a custom made wp-plugin for converting it into a photo blog. As I am close to finish them all, I am back to blogging after more than a month. Here I would like to demonstrate a cool technique which I explored while working for the india elections site. We decided to have a cool india map where we could show data for each state. Though flash is always the best method to go with for such applications (and finally we did it with […]