How to get haml support in netbeans 6.9

By default netbeans 6.9 is not providing the support for haml. We need to download the netbeans haml plugin and add to your netbeans.
Download the haml plugin from here:
http://postcomment.googlecode.com/files/org-netbeans-modules-haml.nbm

then go to your netbeans Tools/plugins/ and go to Downloaded tab, click on add plugin select the drop down and give your downloaded plugin path. Click on ‘OK’ button. Click on ‘Install’. Thats it!

Install timedoctor in ubuntu 12.04

Sign Up from http://www.timedoctor.com/

Install timedoctor from here:
http://www.timedoctor.com/download.html

Install dependancies:

$ sudo apt-get install libxss1
$ sudo apt-get install libxmu

Go to the downloaded folder and do

$ chmod a+x setup-timedoctor-2.3.5-linux.run
$ ./setup-timedoctor-2.3.5-linux.run

Rails gem therubyracer installation error: extconf.rb:10:in `’: Error compiling V8 (RuntimeError)

It is because of you have already the old version of therubyracer is in your project. And that version depends on a libv8 gem, thats why it is getting error so, uninstall the libv8 gem and install the therubyracer again

$ย gem uninstall libv8
$ย gem install therubyracer

A Simple example of Using iframe in Rails

Write the code for iframe and in the src option give the path that defined in routes. It will render the file which corresponding action of the controller renders.

An Haml example is given below:

%iframe{:align => "center", :name => "window", :src => "#{list_make_shipments_path(:ids => "#{@shipment_success_responses.collect(&:id).join(",")}")}", :height => "1000px;", :width => "1100px;", :style => "float:left;margin-top:30px;"}

Create an Image from base64 encrypted image digest data

Suppose you have a base64 digest data of an image, how are you going to display it in your website?

For example You an encrypted image data like this : PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9JRVRGLy9EVEQgSFR…

Here is an example in haml, how to display the image from this data ( you can make corresponding HTML from this if you are using a Html file)


%img{:alt => "File Icon", :src => "data:image/gif;base64,PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9JRVRGLy9EVEQgSFR...", :style => "float: left;margin-top:200px;", :id => "my_image_id", :class =>"blahblahblah"}

 

Importing contacts from your email using Rails ‘contacts’ gem

Using ‘contacts’ gem you can import all your contact emails.

Step 1:

In Your Gemfile add,

## For Importing Email Contacts
gem "contacts", :git => "git://github.com/abhilashak/contacts.git"
gem "gdata", :git => "git://github.com/abhilashak/gdata-1.git"

For importing from gmail, we need the gem ‘gdata’.

Do bundle install

you are done.

Step 2:

In your views/import_profile_contact/new.html.erb file,

<%= ย text_field_tag "profile_contact[email]", "" %>

<%= ย password_field_tag "profile_contact[password]", "" %>

Put one more hidden field tag to know that from which email the user need to import

<%= hidden_field_tag :contact_from, @contact_from %>

the values of @contact_from may be gmail, yahoo mail, hot mail. According to which option user clicks pass the corresponding string.

Step 3:

In your controller get the email and password params

@contact_from = params[:contact_from]

email = params[:profile_contact][:email]
password = params[:profile_contact][:password]

if @contact_from && email && password
  if @contact_from == "gmail"
    @imported_contacts = Contacts.new(:gmail, email, password).contacts
  elsif @contact_from == "yahoo_mail"
    @imported_contacts = Contacts.new(:yahoo, email, password).contacts
  elsif @contact_from == "hotmail"
    @imported_contacts = Contacts.new(:hotmail, email, password).contacts
  end
end

You will get all contacts in an array….