Klairvoyant infosolution's Blog

CSS Buttons

john

1) in css file

.button, .button:visited{
background: #222 url(overlay.png) repeat-x;
display: inline-block;
padding: 5px 10px 6px;
color: #fff;
text-decoration: none;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
border-bottom: 1px solid rgba(0,0,0,0.25);
position: relative;
cursor: pointer
}
.small.button, .small.button:visited{ font-size: 11px}
.button, .button:visited,.medium.button, .medium.button:visited
{
font-size: 13px;
font-weight: bold;
line-height: 1;
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
}
.large.button, .large.button:visited
{
font-size: 14px;
padding: 8px 14px 9px;
}
.super.button, .super.button:visited
{
font-size: 34px;
padding: 8px 14px 9px;
}
.pink.button, .pink.button:visited{ background-color: #6b32b2; }
.pink.button:hover{ background-color: #44177c; }

2)
<a class=”super button pink”>Pink Button</a>
<a class=”large button...

Read more

paypal sandbox error:- This transaction cannot be processed due to an invalid merchant configuration.

john

Solution:-

while creating test merchant account select account type as “Website Payments Pro” instead of “seller”

Read more

Forms in rails, different ways

john

1) Method 1

a) input.html.erb

<form action=”/look/at”>
<input type=”text” name=’text1′>
<input type=”checkbox” name=”checkbox1″>
<input type=”radio” name=”radio1″ value=”red”>Red
<input type=”radio” name=”radio1″ value=”green”>Green
<input type=”radio” name=”radio1″ value=”blue”>Blue
<select name=”select1″>
<option value=’green’/> Green
<option value=’Blue’/> Blue
<option value=’Red’/> Red
<option value=’Orange’/> Orange
</select>
<select name=”select2[]” multiple size=”3″>
<option value=’AC’/> AC
<option value=’Music system’/> Music Syatem
<option value=’Heater’/> Heater
<option value=’auto...

Read more

Paypal with rails-Using Active merchant

john

) gem install activemerchant

2) create two paypal test accounts 1)Business 2) personal

copy the following information which will be created while creating business account

API Username,API Password and Signature

location:- https://developer.paypal.com/

3) code the following in a ruby file ex “purchase.rb”

require “rubygems”
require “active_merchant”

ActiveMerchant::Billing::Base.mode=:test

gateway=ActiveMerchant::Billing::PaypalGateway.new(
:login=> “API username”,
:password=>”API Password”,
:signature=>”signature”
)
# here the credit card information of the personal test account

credit_card=ActiveMerchant::Billing::CreditCard.new(
:type=>”visa”,
:number=>”4582849457729927″,
:verification_value=>”000″,
:month=>01,
:year=>2013,
:first_name=>”John”,
:last_name=>”M V”
)
if credit_card.valid?
...

Read more

Open Source Ruby On Rails Applications

john
Read more

IDE for rails

john
Read more

mentioning version and database for rails new project

john

rails _3.0.8_ new myproject -d mysql

where  -d for mentioning what database we use

Read more

How to get data from heroku to your system

john

1) Install the latest heroku gem
2) Install taps gem

3) execute the command heroku db:pull

for more
1) http://devcenter.heroku.com/articles/taps
2)http://blog.heroku.com/archives/2009/3/18/push_and_pull_databases_to_and_from_heroku/

 

Read more

ERROR: Could not find a valid gem ‘1.2.3.’ (>= 0) in any repository

john

Install  as the following form

gem install rack –version=1.2.3.

where rack is the gem we want to install

 

Read more

activated rack ..., but your Gemfile requires rack ..... Consider using bundle exec. (Gem::LoadError)

john

When it says try using bundle exec… it means that you have to prefix the command with that

Example if  “cucumber features” display the error

“bundle exec cucumber features”

 

Read more

Document preparation tool in rails

john

rake doc:app  turn your “rdoc formatted” comments into properly formatted html

source

http://rdoc.sourceforge.net/

Also check the other option at

http://rdoc.sourceforge.net/rd/index.html

 

Read more

Rails Development - Usefull sites

john
Read more

FasterCSV

john

FasterCSV is intended as a replacement to Ruby‘s standard CSV library.

Installation
1) $ gem install fastercsv
2) add the following to gemfile
gem ‘fastercsv’

code sample

performancecsv=Array.new
FasterCSV.open(“./file.csv”, “w”) do |csv|
@studentdetails.each do | student |
performancecsv.push(“content1″)
………
…..
performancecsv.push(“content2″)
csv << performancecsv
performancecsv.clear
end  #each do
end # FasterCSV

Example code
2) https://github.com/JEG2/faster_csv/tree/master/examples

 

Read more

RVM use

john

RVM make installing multiple ruby interpreters / runtimes easy and consistent, it provides features such as gemsets that aren’t typically supported out of the box on most ruby installs.

Read more

useful sites

john

http://www.projectfedena.org/
http://plivo.com/
http://sugarjs.com/

Read more

Some open source enterprise search platform

john

http://www.elasticsearch.org/
http://lucene.apache.org/solr/
http://sphinxsearch.com/

Read more

group chat app

john

https://www.hipchat.com/

https://www.flowdock.com/
https://github.com/maccman/holla

Read more

Issue Tracking and Project Tracking Tools

john
Read more

Image creation

john
Read more