gif

Enabling gzip on apache to send compressed data

This article is part of a series on Installing a ruby on rails application using phusion passenger on ubuntu on slicehost .

Browser should receive compressed data from server. I have been running my blog for years and ,all this while, I had not configured apache to send compressed data. Let’s fix it.

Determining if server is sending compressed data

First task is to find out if server is sending compressed data or not.

That Cuking Paperclip!#$!

No, nothing to do with MS Office, promise.

This is a rehash of a conversation I had on the Cucumber mailing list / Google Group

If you are using the Paperclip plugin to handle user image submissions you may run into some head-scratching trouble when testing this with Cucumber. The following approach, while perhaps not ideal, tests the full stack, short of a browser.

Handling AJAX errors and displaying friendly error messages to users

AJAX is cool. Except that when it does not work. When an AJAX operation goes wrong then more often than not user continues to see the spinner spinning and no feed back is provided to the user that something has gone wrong.

Play MP3 audio files in rails

If  you want to play mp3 files from your web application then you can do it by using SoundManager2 plugin.
There are few steps that you need to follow.
Step 1: Install the soundmanger2 plugin.

ruby script/plugin install http://soundmanager2.rubyforge.org/svn/soundmanager2

Step 2:  Generate the soundmanager2 in your app. This will store the necessary files in your app.

ruby script/generate sound_manager2

Above command [...]

Profiling Ruby With Google’s Perftools

Benchmarking, profiling and debugging are all areas where better tool support could really benefit the Ruby community. Built in benchmark library and extensions such as ruby-prof provide us with a minimal level of introspection to help identify the common bottlenecks, but they still fall short of the available tools for the JVM, or other dynamic runtimes.

wxRuby for the Lazy

WxRuby is probably the best overall GUI library for Ruby currently available. It is cross-platform, provides native look-and-feel and is stable enough for production use. All other GUI libraries, despite their various merits, fall short in at least one of the areas. However, WxRuby does have one major downfall. It is pretty much a straight port of the C API. Writing WxRuby code is largely the same as writing actual WxWidgets C code. It’s far from the “Ruby Way”.

Safely Using Production Assets in Staging

There are well over 100GB of image assets in the production deployment of the Web app I am currently developing. Since I’m using a full dump from the production database for my staging database, I need my staging environment to use all the same assets as well. The last thing I want to do is to copy the 100GB+ of images into my staging environment.

Evented Programming With jQuery

Over the past several years, I’ve been actively using jQuery for a variety of things. Early on, I shared the frustration that people had around using jQuery for more substantial projects. Starting with version 1.2 and continuing with version 1.3, however, jQuery provides a powerful evented model that can be used to build up fairly complex applications using evented, as opposed to traditional objected oriented programming.

Receive Mail with attachment using TMail - Ruby on Rails

Receive Mails using TMail. I like to use TMail for receive mail because TMail is best to handle the header of the email object. There are only a few methods that deal directly with the body of the email. So i just thought to share it. I have used pop3 for receive mail and use TMail for parse it.
For use TMail you need to do install gem.

gem install TMail

def popmail
     require 'net/pop'

Save images from any URL

Save images from any URL

Note: it will works only OS –> WINDOWS and Browser –>  IE

1. install Ruby

2. Install watir gem – gem install watir

3. Look this code

Code:

require ‘watir’
include Watir
#browser = Watir::IE.new
browser=Watir::IE.new
browser.visible=true
browser.goto(’http://www.misipile.com/’)

idx = 0

Syndicate content