Progress Bar in Rails

Ever thought of implementing a progress bar in rails? or did a need arise for you to do the same?

Something like if you want the user to show the progress bar while he is uploading the file and so on

Well there is a plugin available which will help you to do the same.. Here are the details for it

ProgressBar Plugin:

Install: ruby script/plugin install http://progressbarhelper.googlecode.com/svn/trunk/progress_bar_helper/

#View –

Include JS Files
<%=javascript_include_tag “progress_bar/jsProgressBarHandler.js”%>

Custom Static Progress Bar:
custom_static_progress_bar(name, value, options = {})

Options are:
# * name : used as an id for the progress bar
# * value : decimal value to represent (i.e. value <= 1)
# * options : rendering options
#
# Rendering options are:
# * show_text : set to true to display percentage value in a text form
# * animate : set to true to animate the image
# * width : sets the width of the image (!must be the same as the actual box_image width
# * height : sets the height of the image (!must be the same as the actual box_image height
# * box_image : sets the container image
# * bar_images : sets the progress bar images (must be an Array)

Example:
<%=custom_static_progress_bar(”a2?,1.0,{:show_text=>”Test”,:animate=>true,:width=>120,:height=>12})%>

Progress Bar:
progress_bar(name,value, display_percentage_text = false, multicolor = false)

Njoi A gr8 progress bar.

Thanks

Dhaval Parikh

http://www.dhavalparikh.co.in

Be Sociable, Share!

.htaccess protection with nginx

Hey just recently had a requirement where in I had to set password for my website. It was a ruby on rails website and I had to set .htaccess for it. I knew how to setup .htaccess for apache but with nginx (that our site was using as webserver) I didnt knew what to do.

Then I figured out the solution

Open nginx.conf file. Search for the location word you might see multiple location configuration. But put the code below in the root location

            auth_basic "RESTRICTED ACCESS";
            auth_basic_user_file /path/to/htpasswd/file

For ruby on rails it will be generally in
 the public folder of your rails app.

If you havent generated the htpassword 
yet pls do it using the following command 

htpasswd -b -c htpasswd username password

Hope this will be useful to you if you
 are caught in the same situation as me.

Njoi protecting the site
Be Sociable, Share!

My all time favourites

My aim here is to make all the investors get reasonable returns @ the least possible risk….People might not agree to these views..but I have proved it again and again since past many yrs….
Here is the proof I m just writting about those stocks in which i have traded the most in terms of % turnover and also % returns. I will get you updated all these stocks like @ wat levels one should buy and sell them in order to get the best of it.. Apart from that I will also get u the latest News updates or recent developments of these specific companies..

First of all the list of the ones which i like..In my next post i will tell u the reasons y I like the stocks metntioned below

1) GDL
2) Nitin Fire
3) Zylog System
4) Balrampur Chini
5) Amtek India
6) Rain Calcining
7) CESC
8) Religare
9) Infosys
10) Tata Motors

All the stocks above have given good returns to the investors and traders if they have traded these stocks at proper levels.. This is true with almost all the stocks but these r some which i track regularly..and i continue to like them inspite some of them might have underperformed..but for me they have always outperformed..

So Keep watching this space i will get u updated with the stock details soon and also the research reports if possible. Watch the comment space for each stock to get the latest updates

My Picks for 2008
1) L&T
2) Punj lloyd
3) Reliance Inds
4) Gmr Infra
5) NTPC
6) CESC
7) GDL
8) Infosys
9) Godrej Inds
10)Shiv Vani oil

These are the combination of midcaps and largecaps..And i wouldnt hesitate to put equal amount in all the 10 stocks..one can expect minimum 50% returns frm these stocks in this yr if traded @ proper levels..also watch out for specific news abt the stocks in the latest stocks section..

Keep visiting

Be Sociable, Share!

Mongrel Clustering with Rails

Hey every one wants to make their site run faster..and there are many ways like caching (page caching, fragment caching, method caching) so on. One other way is using mongrel cluster which will run multiple instance of mongrel on you server which will help to improve website speed to a huge extent.

Let me tell you the steps for doing mongrel clustering .. its really easy..

Step 1 : – Install mongrel cluster gem

sudo gem install mongrel_cluster

Step 2 : – configure cluster and run the config file which will reside in config/mongrel_cluster.yml

mongrel_rails cluster::configure -p 8000 -e production -a 127.0.0.1

Well thats it now here you go

Start the cluster:mongrel_rails cluster::start

Restart the cluster:mongrel_rails cluster::restart

Stop the cluster:

mongrel_rails cluster::stop


Well just try these steps and if you are not able to configure it just post acomment and i will get back to you.

Enjoy better speed :)
Be Sociable, Share!

Inexpensive ways you can market your service or business on the Web

Well many times I face this question that just making a website isnt the only thing..For it to be successful it requires marketing just like for any other thing …But the main thing is how to market ur website so that u can get max number of users to your website..

Below there r few ways of doing marketing for ur website – online..and they r very affordable methods which is another thing to be kept in mind for a new business..since they have less budget..

Every time I used to mention only few points since i couldnt remember all of them..And then i came across the article on powerhousebiz which made me write this blog today

So there are a number of inexpensive ways you can market your service or business on the Web, and here are eleven of them:

1. Network. Have you ever received an email from a friend asking you to send that email to 10 more of your friends? If you pass along emails to other people in your address list ­ whether it is a virus alert, crime alert, urban legends or even chain letters ­ you can use this strategy to promote your business. Tell your family, relatives and friends about your new online venture, then ask them to spread the word to their friends. In your email, describe to them your new site and how it will be of use to them. Hopefully, your email will be passed on to many more of your friends’ friends. This will help get the word out about your site. Don’t forget to ask for their comments and suggestions on how to improve your site.

2. Viral Marketing. Another form of effective word-of-mouth strategy on the Web is through viral marketing. Hotmail and Bluemountain.com became valuable properties on the Web as a result of clever use of this strategy. Emails from Hotmail and e-cards from BlueMountain always comes with a footer message that describes the company, resulting in multiplier effect in terms of brand awareness.

Another way of utilizing viral marketing for your site is through referrals. If you are offering content or service, you can put up a “Tell a Friend” button that lets customers recommend products or Web pages via email to friends. Recommend-It and BigNoseBird.com are some of the sites that offer these services for free. These services allow you to keep track of those who recommend your site and the people they recommend it to.

3. Start a newsletter to keep ’em coming back. Newsletters and e-zines have become valuable tools in building loyalty and repeat visitors to a site. You can choose to develop the content of your newsletter, or use articles provided by other authors. Build your mailing list as you go along, but never send unsolicited emails. Spam is simply not worth it. You may start with 10 subscribers in your 1st two months, but you can grow to a thousand in a year depending on your traffic levels and promotion efforts.

4. Print flyers for distribution in your neighborhood. While the Internet is global in its reach, you can start promoting your site locally. Prepare fliers about your site, making sure that its lay-out does not scream: “I am a cheapo!!” Go to your neighbors whom you think might be interested in what you have to offer. If going door-to-door is not your style, post your fliers in your neighborhood grocery stores, public libraries (if they allow you), fast-food eateries, and even your local churches. Some even go to the mall to distribute flyers, while others leave their flyers in the cars in the parking lot.

5. Send out Press Releases to as many newspapers, local or national media that you can think of. If worked properly, the media can provide you with the publicity boost that your business needs. Send out a press release about your site’s launching, highlighting the features that makes your site different from all the rest. If you have an interesting and unique business model, describe it in your release. Tie-up your launching with a local event, or sponsor a contest. There are many ways of using the media; you just have to know how to use it.

6. Print business cards, with your website URL on it. A well-designed card is the mirror of your site. Give one to everyone you know. You may also want to take a look at web cards, or postcards with your web site’s screenshot. Instead of sending traditional Easter or Christmas cards, try them out.

7. Talk about your website whenever you have the opportunity to meet new acquaintances. You are the best promoter of your business. Take every opportunity to network and participate in local organizations. Tell your friends in the Sunday choir that you have a web site. Ask your peers in your ToastMasters club to check out your site. If you are riding the subway and are seated beside a person reading a book on how to make money, give him or her your business card.

8. Submit your site to the search engines and directories. Be patient though; as most search engines take about 2-3 months to list a site. You don’t have to use a submission service as you can pretty much do it yourself. Yahoo now charges $199, but it is definitely worth it. LookSmart also charges listing fee, but they provide smaller traffic compared to Yahoo. Evaluate pay-per-click sites like Overture, where you can bid for keywords and pay for every traffic that it brings your site.

9. Participate in discussion forums. A lot of websites provide message boards to attract traffic. You can post messages and invitation to your site in these message boards. Participate in the discussion, always ending your posts with your signature file. There are also business chat rooms where you can introduce your website to anyone in your product line. Carefully read the guidelines and don’t spam lest you be banned from participating in future discussions.

10. Write articles and establish yourself as an expert in your field. Make sure to provide a brief description about you and your site. Read the guidelines of the site before submitting your articles. If you have developed a wide body of content, and regularly produce new articles or write-ups, you can even earn from them through syndication.

11. Never forget opportunities to promote your site offline. These can range from simple things such as putting a car sticker with your URL on it (make sure it is big enough for other commuters to see) to writing a book or regular column in a newspaper.

All these will be enough to keep you busy 16 hours a day and may never end as long as you are on the Internet. You should always be looking for new areas where you can promote your site with minimal expenses.

Be Sociable, Share!

SEO – What is Google PageRank and Why You Should Care About It

Well this specific post is some what different from the general topics that I cover on this blog. But the thing is that recently I have launched my website www.dhavalparikh.co.in and so the idea came after I hosted it…

First of all whenever a site is launched the main thing is that it should be known to the public…U dont want to restrict just to ur group but u want that ur website should be seen by more and more people. So wats the way out..Well ofcourse the first thing that comes to mind is SEO.

For any site to actually succeed you require to do SEO for that site … and the first step for that it getting it listed on major search engines…And thats wat I did and I was lucky to get my site listed on the search engines with good ranks.. On yahoo is u search for Dhaval Parikh as a keyword u will get my site listed first.. and on google if you see with the same keyword it comes 4th so its good for me @ the initial level…I did that by trying some of the basics in SEO such as Sitemaps, Meta tags and so on..

After that comes page rank..Google Page rank is now a days becoming popular bcoz it decided the value of the site. I wanted to get a better google page rank and I m still finding out methods to get better page rank for my site…

While doing research for it I found this little article which will actually help u to know what is google page rank and how its useful and also its importance

If you have a new website and you want people to visit it, then you are probably going to be interested in learning about PageRank. So what is Google PageRank, and why does it matter? Well pretty much, PageRank is what the search site Google uses to determine the quality and popularity of a webpage. Thus, it really is choosing if the site will appear at the top of the search engines results. So if you want your site to come up in search results, then you should care about what PageRank things about your site!

When PageRank first came out, it usually ranked the sites with the highest keyword density at first.
During that period someone with basic seo skills was able to get a website in the top 10 results without to much hassle. People were using that weakness to rank their sites higher. Now that time is over and in order to get in the top 10 results on google you have to work harder and build a lot of back links to keep your head out of the water and generate some google organic traffic from google.

So how does Google PageRank rank your website now? Well, in theory, Google thinks that if a page has a lot of links leading to it, then it must be a pretty important site. Thus, if you have a lot of links out there on other sites leading back to your website, it is going to do wonders for your search engine ranking. In fact, you can think of a link on another site kind of like a vote for your site. So, say website A has a link to website B; then it would be like website A was voting for website B! Of course, it does not just stop there. Sites that have a higher ranking have more weight when voting. Thus, if you are linked to a lot of small, low ranked sites and then another site is just linked to one high ranked site, they could be ranked above you.

Of course, with any system there are flaws. People tend to post their links anywhere to try and get their ranking up. In fact, if you have ever come across a web page that has nothing except a ton of links on it, then you just uncovered a link farm. This is a site that is made to not be found by people. The only things that usually find this page are the Google Crawlers. Thus, they find the links and count it as a vote for another site. However getting your link on a link farm does not count as a positive vote for your web site. Keep in mind that all links are not created equal! Link farms are considered spamming by Google so try to stay away from link farms. In fact, getting your links to several link farms websites may get you banned from some search engines and especially Google.

Hope you njoied the article..You can post comments below and let others know about this article also.

Dhaval Parikh
Software Engineer
Ruby on Rails
www.dhavalparikh.co.in

Be Sociable, Share!
1 5 6 7 8 9 23