Friday, November 20, 2015

Updated Clip All function for Publix Digital Coupons

Over a year ago, I provided the Clip All function for Publix Digital Coupons.  It's been working well and I've received plenty of positive feedback for it.

This month, Publix revised their digital coupon site and the function stopped working.  I have fixed my code and it should work again!  There are a few things to point out though.

First, the method I used in the past for attaching my JavaScript code to their site no longer works.  When I do that, it causes the page to re-load itself, which then negates the addition of my code.  I now load the code and invoke the function from within the bookmarklet.  That works out fine, but that method no longer allows me to re-direct you to the coupon site if you're not currently there.  So you need to invoke the code from the coupon site.

Second, the no longer have links to more pages of coupons, but load more dynamically as you scroll down the page.  I try to make the code emulate the scrolling activity to automatically load more coupons, but it doesn't always trigger the event to load more coupons.  So, if you're sitting on the bottom of the page with all the coupons 'clipped', try to scroll up and down a little to see if more coupons start loading.  If more load, the auto-clipping function should kick back into action.

Please go to for installation instructions, and please drop me a comment here if you try it out to let me know how it works for you.

Tuesday, January 07, 2014

Bishop Swap Puzzle Fixed!

I implemented a Bishop Swap Puzzle back in 2007 (see my prior post), but it has had a bug in it where bishops of the same color could pass through each other.  I had noted it as a 'TODO' in my code comments while I was writing it, but I had neglected to go back and fix it and forgot all about it until I was trying it out again recently.

I'm happy to say that I've now fixed the bug and it works correctly, so happy gaming!

Once you've completed the Bishop Swap puzzle, be sure to check out the others!

Thursday, January 02, 2014

Clip All function for Publix Digital Coupons

Happy New Year!

Sadly, it's been over a year since my last post.  To make up for not contributing for so long, I'll provide a little gift for those of you who have resolved to save more in the new year.  In particular, you need to live in the southeastern United States and do your grocery shopping at Publix.

Last year, Publix introduced a digital coupon site. This site provides a collection of coupons that you can "clip" and then when you're at the checkout lane, you enter your phone number on the credit card reader keypad and it will automatically apply any coupons you have clipped that apply to the groceries you have purchased.  The problem with the site is that they have not provided a "Clip All" function, so you need to look through several pages of coupons and clip any coupon you're interested in one at a time.  This can be a very time consuming process as many pages of coupons can be added each week.

To rectify this problem, I created a bookmarklet that provides a "Clip All" function.  It will clip all on the current page of coupons and continue to navigate through all available pages of coupons and clip them all.  The bookmarklet also works from mobile devices (at least iPads) so you can even quickly clip all the digital coupons while you're in Publix using their WiFi.

Please go to for installation instructions, and please drop me a comment here if you try it out to let me know how it works for you.

Monday, October 29, 2012

Ruby 1.8.7 vs 1.9.3 performance

There are plenty of Ruby 1.8 to 1.9 benchmark results out there, and this is by no means as thorough as most.  I thought I'd share the results for one of my websites when I upgraded it from Ruby 1.8.7 to Ruby 1.9.3 as demonstrated in my New Relic report for the site. Conveniently, I upgraded the site on a Monday morning, and since that's also when New Relic reports switch over, it provided a fairly clean week-to-week comparison (perhaps 1/3 of Monday 10/22 was still Ruby 1.8.7).

High Level Summary

With no other changes, other than fixes required to allow the application to work with Ruby 1.9.3, simply upgrading Ruby resulted in the overall response time average for the week dropped from 304ms to 72ms (a 76.32% drop in response time).

Unfortunately, the week immediately before the upgrade was a bit of an anomaly.  The week before that had a 153ms average response time, which is more in line with typical weekly results.  However, that's still a 53% reduction in response time from 1.8.7 to 1.9.3.

Here's a daily comparison for the 3 weeks:

Ruby 1.8.7 

Ruby 1.9.3

Keep up the good work, Ruby development team!

attachment_fu as a gem for Rails 3.2

As I've mentioned before, I develop the web site for St. Francis Society Animal Rescue.  As I've also described in that earlier article, it started as a Rails 1.2 app, then Rails 2.1, then 2.3.  Right now it's in Rails 3.1, but I'm about to switch it to Rails 3.2.  Having some history, it was developed to use attachment_fu to upload all the images for the cats and dogs.  While I know many people have abandoned attachment_fu for paperclip, or carrierwave, or dragonfly, etc. attachment_fu has continued to work just fine for me so if it ain't broke, don't fix it.  Plus, there are currently over 13,000 animal images that have been uploaded, and I don't really want to hassle with converting them over to a new attachment system.

Enter Ruby 1.9.x

The last official update to the attachment_fu github repository was on April 25, 2009.  While that update is for Ruby 1.9 compatibility fixes, if you try to use it as is for Ruby 1.9.3, you'll find it won't work.  To that end, I've forked off a new repository that will fix additional Ruby 1.9.3 incompatibilities.  If you want to continue to use attachment_fu as a plugin with Ruby 1.9.x and Rails prior to 3.2, you can use my github repository in your project simply by issuing this command in your project:

git submodule add vendor/plugins/attachment_fu

Enter Rails 3.2.x

attachment_fu has always functioned as a plugin (vendor/plugins), the problem is that Rails 3.2 will give you this error if you continue to use it as a plugin:

DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. 
Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. 
See the release notes for more on this:

To that end, I've also updated my fork of attachment_fu to function as a gem! Simply add this line to your Gemfile
gem 'pothoven-attachment_fu'

I need to acknowledge Christophe Porteneuve for doing most of the gem conversion work. I just pulled in his updates and fixed a few problems with it that I encountered. Please feel free to let me know if you have any problems using the gem.