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.
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,
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.
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:
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.
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 18.104.22.168
- Sqlite 3.7.3
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
Download the free digital edition of Rails Magazine Issue #7.
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.
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.
I have been working on some Spree based ecommerce stores lately, and I ran into this issue while creating a new Spree project. I had bumped into this a while back but did not write about it then. But, now I have decided to pen it down.
The steps to creating a new Spree project is very simple. Assuming that you have Ruby and Rails both installed, you can simply do:
$ gem install spree
$ spree mystore
$ cd mystore
$ rake db:bootstrap
And, voila you should have a shiny Spree store.
But, I have bumped into an issue at the step
$ rake db:bootstrap as shown below:
$ rake db:bootstrap (in c:/RoRProjs/wixspree) rake aborted! stack level too deep c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2390:in `raw_load_rakefile' (See full trace by running task with --trace)
After a little digging, I found out that Spree has a dependency on the ‘jeweler’ gem which in turn has some kind of dependency on Git.
So, although it seems like a weird solution but just by initializing a git repository on your Spree project folder i.e. mystore in my example, you will be happy to see that the problem is resolved.
So, to recap, in the above steps to create your new Spree project, add a new step before the rake step:
$ git init
$ rake db:bootstrap
You should be golden by now. Hope it helps.
Note: I am running Spree 0.9.4 on Windows Vista and Rails 2.3.5 and Ruby 1.8.6 (ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32])
Note: If you do not have Git installed, you might want to do that. Here are some excellent articles which show how to do it: