Thursday, April 9, 2009

GRE WorldList Prepration made easy


Have you felt so boring while reading word list from Barron's or other text book?

For me the smell of the text book was so bad that I could never imagine doing my GRE prep from a book?

Another advantage for using a software was that I could have it open in office and use it during lunch break or 'other' breaks because usually I was too tired of getting of going home and preparing for GRE word list.

use following link and enjoy
http://www.megafileupload.com/en/file/96031/GRE-zip.html

Tuesday, July 8, 2008

Google ad Sense code implementation with Ruby on Rails

I needed to integrate Google Adsense with my Ruby On Rails application. It was quiet easy actually but initally it was somewhat time consming to search some bits and pieces.

So I am putting all the code here so that it may help you and I hope you will have fun with it.

//////// *************** 4 Steps *********//////////////

step 1 - Make a controller named ads (ruby script\generate controller ads) ,ads_controller.rb file, and replace code with the ocntent of the file at

Download AdsController.rb

Step 2 - In your rails hierarchy goto app/helpers/application_helper.rb put following code

def google_ad
content_tag("iframe",nil , :scrolling => "no", :frameborder => 0 ,
:width => 800, :height => 80,
:src => url_for(:controller => "ads", :action => "adsense",
:canvas => false, :only_path => false))
end
end

Step 3 - Go to app/views and in the rhtml file corresponding to the view add javacript code to call the function name "google_ad()"

one line code for this simple call is similar to



You can place it where ever you want to display adds.

Step4 - Refresh Code and GAdsense should be working :) You can play with the formating in ads_controller.rb file