Skip to content
Installing Rails plugins from Github on Windows
Posted 2027 days ago

Well, I have installed several Rails plugins but I was bummed when I tried to install the re-captcha plugin from Github. The command belwo just fails silently and creates an…

How to print a document as a booklet
Posted 1009 days ago

After spending about an hour, reams of pages, and pails of ink, I finally stumbled into the magic of booklet printing. My source document was a MS-Word 2010 document with…

How to print a document as a booklet
How to install RMagick + ImageMagick on Windows
Posted 1790 days ago

I have installed RMagick and Image Magick on many Windows machines and I have stumbled across various kinds of errors, and finally I have decided to document them so that…

Installing gems behind proxy servers
Posted 2448 days ago

It is well documented as part of gem help that using the following common options:

-p, --[no-]http-proxy [URL]      Use HTTP proxy for remote operations

will allow gem to use the proxy server…

ruby-alibris wrapper wins
Posted 1242 days ago

I had blogged about my recent open-source project, a Ruby wrapper for the Alibris API, ruby-alibris. Soon after, Alibris had announced their First Annual Alibris API Programming Contest, and I submitted…

Playing with CoffeeScript
Posted 1410 days ago

After having used Haml and Sass and loving them, a friend introduced me to CoffeeScript. In short CoffeeScript is to Javascript as Haml is to Html and Sass is to…

Playing with CoffeeScript
Error in Ruby relative_path_from call on Windows
Posted 1647 days ago

I was recently working on some code for building an extension for Spree, when I ran into an issue while generating a extension controller. The error only happens on Windows.

The…

Rails Magazine releases free Issue #5 digital edition
Posted 1797 days ago

Themed in beautiful Winter art and pictures, Rails Magazine released their Issue #5 free digital edition to the whole Ruby and Rails community worldwide.

It is the largest issue since we…

Rails Magazine releases free Issue #5 digital edition
Tip: has_one and nested form/attributes
Posted 1932 days ago

Although, the usage of nested forms with has_many associations is well documented, I found that especially the call ..build that works for has_many associations do not work for has_one associations.…

Install SQLite3 on Windows
Posted 2010 days ago

I found this great screencast that shows how easily you can install SQLite3 on Windows. So, here you go:

Install SQLite3 on Windows

PreviousNext
Aug 11 / Rupak Ganguly

How to manage whitespace around text in Haml?

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

While creating some html content using Haml, I ran into the problem of removing the extra space that Haml puts in after a link text. Here is what I wanted the link text to look like:

Check out my website.

But, what I got was: (note the extra space before the period)

Check out my website .

It drove me nuts trying to fix it before I discovered the cool new Haml helpers. The particular helper in question that fixed the above issue is the succeed helper method as shown below:

%strong
   Check out my
   = succeed '.' do
       %a{href: 'http://rails.webintellix.com'} website

Hope that helps you to write good html using Haml.

If you have other Haml tricks you know of, let me know in the comments section.

Nov 13 / Rupak Ganguly

Ruby wrapper for PunchTab API

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

A while back, in May 2013, I had worked on writing a Ruby wrapper for the PunchTab API. I found the concept of PunchTab‘s loyalty program interesting, and wanted to integrate that into my web apps. So, I wrote the wrapper. See the code snippets below, to see how to use the wrapper to access PunchTab’s loyalty programs.

read more…

Feb 24 / Rupak Ganguly

How to print a document as a booklet

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

After spending about an hour, reams of pages, and pails of ink, I finally stumbled into the magic of booklet printing. My source document was a MS-Word 2010 document with 18 pages, which I wanted to print as a 2-sided, 2-pages per sheet, booklet on Letter paper. Although, MS-Word comes with an option to print a document as a booklet as shown below,

booklet_printing_1

 

it is impossible to get it right, the way you expect it. It would print page 1 and 7 one side of the sheet, while you would expect it to print 1 and a blank. Just tried every other possibility, even with odd numbered pages, but I had no luck.

read more…

Jul 6 / Rupak Ganguly

ruby-alibris wrapper wins “Most Developer-Friendly Code” award

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

I had blogged about my recent open-source project, a Ruby wrapper for the Alibris API, ruby-alibris. Soon after, Alibris had announced their First Annual Alibris API Programming Contest, and I submitted the ruby-alibris project as an entry. And, to my surprise, I got notified that it won the “Most Developer-Friendly Code”, and a $250 cash prize. Today, Alibris released a press release announcing the winners. Here is an excerpt from the press release:
read more…

May 15 / Rupak Ganguly

Ruby wrapper for Alibris API

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

I recently wrote a Ruby wrapper (ruby-alibris) for the Alibris API. I started with the Search API, and I would finish the wrapper with the Recommendations and Reviews shortly. Read the documentation below and give it twirl. I would be interested in your comments and feedback. Alibris, is the premier online marketplace for independent sellers of new and used books, music, and movies, as well as rare and collectible titles.

read more…

Jan 19 / Rupak Ganguly

Playing with CoffeeScript

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
After having used Haml and Sass and loving them, a friend introduced me to CoffeeScript. In short CoffeeScript is to Javascript as Haml is to Html and Sass is to CSS. Not so strictly speaking but lets roll with this for now. So here is my how-to article to share my thoughts and experience, while I played with it.
What is CoffeeScript and why do you care?
Instead of me, making something up, here is what the CoffeeScript site has to say:
“CoffeeScript is a little language that compiles into JavaScript. Underneath all of those embarrassing braces and semicolons, JavaScript has always had a gorgeous object model at its heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way.
The golden rule of CoffeeScript is: “It’s just JavaScript”. The code compiles one-to-one into the equivalent JS, and there is no interpretation at runtime. You can use any existing JavaScript library seamlessly (and vice-versa). The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript implementation, and tends to run as fast or faster than the equivalent handwritten JavaScript.”
Read more or try in your browser at the CoffeeScript website.
Jan 19 / Rupak Ganguly

Rails Installer on Windows

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

If you are like me, I started my Ruby on Rails development on Windows and I had my issues with installing the stack. I had issues with gems especially the ones with C-extensions. But, things have changed dramatically over the years and things are much smoother now. A great example of getting the Rails stack installed on Windows is: Rails Installer.

The Rails Welcome Kit has everything you need to hit the ground running. In one easy-to-use installer, you get all the common packages needed for a full Rails stack. Download it now and be writing (and running) Rails code in no time. Packages included are:

  • Ruby 1.8.7-p330
  • Rails 3.0.3
  • Git 1.7.3.1
  • Sqlite 3.7.3
  • DevKit

Watch the RailsInstaller Introduction from Engine Yard on Vimeo.

Nov 2 / Rupak Ganguly

Rails Magazine Issue #7 released

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Rails Magazine Issue #7

Rails Magazine Issue #7

We are happy to bring you the Issue #7, 2010 of Rails Magazine. We are trying our best to fall into a regular publishing schedule. In this edition, we have a very nice collection of articles. I am also very happy to have penned down the editorial for this edition.

In the 28-pages of full color, we bring you the following:

  • Editorial by Rupak Ganguly
  • An Overview of Refinery – a Rails CMS by David Jones
  • Converting A Rails Site to Refinery CMS by Christopher W. Lehman
  • Auditing plugin by Mihai Târnovan and Gabriel Târnovan
  • Hobo – Making Application Development on Rails Even Faster by Dave Reynolds
  • Installing Ruby on Rails on Windows by Victor Thiago
  • Simple Unobtrusive Ruby/Rails Debugging by Stephen Rycyk
  • A Well Kept Secret, Ruby and Cryptography by Richard Penwell

The digital edition (PDF) is available for free at http://www.railsmagazine.com/issues/7. You can also grab a printed copy available in US, UK and Canada (7.60 USD + shipping).

Download the free digital edition of Rails Magazine Issue #7.

Jun 29 / Rupak Ganguly

Rails Magazine Issue #6 released

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
Rails Magazine Issue #6

Rails Magazine Issue #6

I am very happy to announce the release of the Rails Magazine Issue #6. It took us a while to get this issue out but it is better late than never. We improved a lot on the backend side and revamped into a new automated publishing system. This will in future enable us to streamline the author submission, editing and publishing process. Olimpiu and Raluca Metiu, the husband/wife combo, worked very hard to get the new publishing system up.

In this beautiful 36-pages full color issue you will find some very in-depth articles and a couple of nice interviews. The issue consists of the following:

  • Beautifying Your Markup With Haml and Sass by Ethan Gunderson
  • Scaling Rails by Gonçalo Silva
  • Interview with Sarah Allen by Rupak Ganguly
  • Data Extraction with Hpricot by Jonas Alves
  • Deployment with Capistrano by Omar Meeky
  • Fake Data – The Secret of Great Testing by Robert Hall
  • RubyConf India 2010 coverage by Judy Das
  • Previous and Next Buttons by James Schorr
  • RVM – The Ruby Version Manager by Markus Dreier
  • Interview with Michael Day of Prince XML by Olimpiu Metiu

The digital edition (PDF) is available for free at http://www.railsmagazine.com/issues/6. You can also grab a printed copy  available in US, UK and Canada (8.80 USD + shipping).

Download the free digital edition of Rails Magazine Issue #6.

Jun 7 / Rupak Ganguly

The new iPhone 4 phone is here…

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Steve Jobs announced the arrival of iPhone 4 at WWDC today. The highlights of the iPhone 4 are as below:

1. New Hardware Design: Front and back camera with flash, 2 mics, integrated antennae, and 24% thinner. Quad band HSDPA, 7.2Mbps, 802.11n WiFi, GPS, compass, accelerometer.

2. Retina Display: Four times as many pixels, 326 pixels per inch (300 is the limit for the retina!), 3.5 inch display, 960 x 640 pixels, 326 pixels per inch, 800:1 contrast ratio, IPS technology (better than OLED)

3. iPhone 4 is powered by the A4 chip: Micro-SIM, larger battery – improved battery life – 7 hours of 3G talk, 6 hours of 3G browsing, 10 hours of WiFi browsing, 10 hours of video, 40 hours of music and 300 hours of standby.

4. Gyroscope: 3 axis gyro, the gyro tied to accelerometer, compass together for six axis. pitch, roll, yaw. rotation about gravity, 6-axis motion sensing.

5. New Camera system: 5 megapixel, backside illuminated sensor. 5x digital zoom, tap to focus, and an LED flash. Records HD video – 720p at 30 fps. LED flash stays for video recording. You can record, edit and email right from the iPhone. iMovie for iPhone at $4.99.

6. iOS 4: iPhone OS4 aptly renamed to iOS4. You can see the features in another post I wrote earlier.

7. iBooks: Bookshelf, PDF reader, iBookstore

8. iAds: Apple’s ad network, comes on live on July 1st, 2010 for all iOS 4 devices.

9. FaceTime: Video calls on iPhone. WiFi only. iPhone 4 to iPhone 4. No setup. Camera can be flipped to the rear or front. Portrait or Landscape. This has to be the all time, life-altering, feature in any product…

Checkout all the features, the design, and the full technical specs of the new iPhone 4 phone at Apple. Last but not the least, see it for yourself in this video of the new iPhone 4 phone and the photo gallery in all its glory…


Availability: Pre-order starts on June 24th, 2010. “AT&T is going to make an incredibly generous upgrade offer. If your contract expires at any time in 2010, you can upgrade to the iPhone 4. You can get it up to six months early.”

Colors: White and black.

Pricing: iPhone 4 – $199 for 16GB, $299 for 32GB. iPhone 3GS – $99.

iOS 4 upgrades: For the 3G, not all the features are supported, same with the iPod touch, and this excludes the first generation. Upgrades are free for all these products. Available on June 21st, 2010.

Hat tip: Engadget and gdgt did a live coverage of the event. Thank guys, for your coverage for people like us, who could not attend in person.