Speeding up Heroku Deploys

Anyone who deploys their Rails 3.x or 4.x utilizing the asset pipeline and doesn’t precompile those assets yet deploys to Heroku, knows it can take a really long time for your deployment.

I searched around a bit and found a great article on how to shave some time off my Heroku deployments.  Alex MacCaw has a nice write up about the process:

If you’re using Heroku, the first step is enabling a Memcache addon. I’ve gone with the memcachier service, as they’ve got a generous free plan (which is all we need at this stage).

heroku addons:add memcachier:dev

Then we need to make sure the environmental variables are available to your app during the pre-compilation stage. Usually this isn’t the case on Heroku, but they’ve got a new labs feature called user-env-compile which will do the trick.

heroku labs:enable user-env-compile

Next you’ll need to add the dalli and memcachier gems to your Gemfile. Finally, the last step is to configure Sprockets.

Since I am using Rails:

With Rails

With Rails, just configure the assets cache store inconfig/environments/production.rb.

config.assets.cache_store =:dalli_store

And the time savings would be….

 An example of time saving with a relatively small project:

Not using the speed-up method, deploy time: 2 minutes 40 seconds

Using the above method: 47 seconds

It is definitely worth the little effort.

Subscribe to Posts Via Email

It seems more and more web sites are offering users to subscribe to updates delivered by email.  If you would rather have posts delivered right to your inbox instead of visiting the site or relying on RSS, you can now subscribe and forget.

Just add your email to the “Subscribe to Blog via Email”, submit and confirm your desire to subscribe in the confirmation email and thats it.  You can unsubscribe any time.

Subscribe

AirPrint Where You Couldn’t AirPrint Before

Our household has several iPads and iPhones. I use my iPad all the time to surf the web, reply to emails and view my Twitter stream, among other things.  Occasionally I find it would be nice to print from the iPad, since it has AirPrint and all, but our Canon MX860 printer doesn’t support AirPrint.

Enter handyPrint….

handyPrint™ v5 is a 64 bit Mac OSX application that allow you to print from your iPods, iPads and iPhones on printers that do not support the AirPrint protocol. v5 has been re-designed as a standard application similar to the ones you would find in the Apple App Store. You simply copy it to the Applications folder and run it from there. Once you turn the application switch to ON it will start on its own every time you login to you user account. No need to manually start the application.

handyPrint is a simple download which is a DMG, just click to install.  It’s an application needs to be running while the user is logged in on the host Mac.  I noticed there’s a Pro version that runs as a service to alleviate this requirement but this didn’t matter to me.

Once installed handyPrint is run and sits in the OS X menu bar after it’s turned on. The user interface is really simple:

HandyPrint

A list of available printers shows up and you just select the ones you enable AirPrint support.  This particular printer is actually wireless, I just happen to have the driver installed on my Mac.

Printing from the iPad is simple.  While you’re in the application you want to print from, just select Print as if you had an AirPrint-supported printer around:

IMG 0001

Select the printer and that’s it.  handyPrinter works seamless.

Thanks to Eric Davis for pointing it out on Twitter. 

How Not To Provide Customer Support

I recently had an interesting interaction with a company’s support team and the results were less than spectacular. Originally, I had a much longer post planned that better detailed the problem, brought attention to the company and gave details of how poorly they handled it.  I felt the approach was less than constructive.

The bottom-line is I had a need to contact a well-reputed company and faced several of the hurdles outlined by Ian Landsman of HelpSpot recently in his post about customer support.  I won’t rehash them here, so you should go read his post right now. Scott Watermasysk of KickoffLabs had bit of follow-up to Ian’s post that you should also read.

I came out of my experience with two additional rules that we follow and you should consider reviewing your work as a person who supports “customers”:

1. It works for me, so it must be you

This one really bothers me, and I’m probably guilty of it over the years.  You have a customer who has a problem, you can’t reproduce the problem so you pass it off as not your problem and close the issue.

I have checked the site via a proxy and it’s showing up correctly:

<useless url to proxy removed>

This issue appears to be local. As a troubleshooting measure, I would recommend restarting your computer. If the site is still having connection issues, I also recommend restarting your router as well. Please let us know if you’re still experiencing connection issues after trying those recommendations.

This goes along with #9 on Ian’s post, Listen Carefully. I had provided a trace route to the support team which clearly showed my request was terminating at the host of the company.  Had this tech read my email (I sent the trace route 3 times by the way) and listened, he would have seen proof the problem was not local. 

2. Passing the buck

It’s really easy to look at problem your customer is facing and not know the answer, saying you don’t know is fine.  One response may be to blame the problem on someone else because you don’t want to continue dealing with it and you want it to pass it on.  This is the exactly how my problem was handled.

I use a utility which is a graphical client to interact with another service, the utility was timing out.  I tried to access the endpoint directly and it was also timing out.  A bit of my own sleuthing revealed my requests were being either dropped or blocked.  Support finally realized that in-fact my IP address was being blocked for unknown reasons.

The tech involved on the ticket decided the utility I was using must be the problem, even after repeated attempts at telling them it was no longer running. This was their response:

Good afternoon Rob,

Thank you for contacting us today.

The reasons that ******** state on their front page for using ******** aren’t very sound. Why would you “avoid being connected to the internet” to make a post when you must connect to the internet to make the post? ** isn’t making a bunch of data calls back and forth while you’re sitting on the post editing page so the network bandwidth consumption would be negligible even if you had to “be connected” to the internet.

With that said, anything that hits our server with multiple connections too quickly from the same IP will be blocked for attacker like activity. My suggestion is to contact the developers of your software and have them work to throttle the connections down or at least offer the option to do so. If they are unwilling to work with you I would request a refund from them and potentially find another plugin to duplicate this functionality.

If you have any further questions please let us know and we’ll gladly assist you.

Gladly assist me?  Hmmm….

The result is a lot of frustration trying to solve this issue.  Normally this company provides great service and they have a great reputation in the community but sometimes a company’s growth and not communicating culture can be negative.

Please don’t do this.

An iPad user tries a Nexus 7

Apple has always been really good at paying attention to the little details, the ones that make their products just that much better than anyone else.  I think people refer to this as being the “best”. 

I cam across this great post by Eric Sink detailing his experience with a Nexus 7 after having an iPad as an appendage since April 2010.  What I found interesting is his use and requirements are almost exactly like mine. I carry an iPhone but I rarely use it except for the occasional phone call or reading Twitter while standing in line somewhere.  

Google is starting to show how it pays attention to those details that really matter to us.  Things like a seamless integration between our devices and the parts of life we care about; calendars, email and photos.

9. Unsurprisingly, Android’s integration with my Google calendar is ridiculously good. On iOS, I use CalenMob Pro, which has sometimes been disappointing. With the Nexus 7, I feel like access to my calendar is fast and reliable. That is an unfamiliar feeling.

10. Ditto for Gmail. Very slick setup. It just works.

I like the Apple hardware still better but the Google hardware is getting better:

Judging the OS and its built-in apps, I gotta say I think Android might be generally better than iOS.

But third-party apps for Android, when they exist at all, are generally worse than their iOS counterparts.

In terms of overall quality of the hardware, the iPad Retina Mini wins. The Nexus 7 feels like quality, but the iPad is just better.

Overall, I am fairly impressed. And surprised (as usual). I can’t describe myself as “immediately hooked”, but I can say that I might stay with an Android tablet for longer than I expected.

Apple needs to pay attention. 

It’s becoming somewhat clear that Apple may be developing a few chinks in their armor.  Some people I know who have labeled themselves iOS developers in the past are gravitating toward Android.  I have been working with Android a bit more myself and spend some time with my Nexus 7 (first gen).  I don’t like it any more than my iPad Mini, it’s just too small for my eyes.  I like my full-size iPad Air but if we see a second generation Nexus 10, then I may give it a fair try.  The apps are getting better and although not all of my iPad apps are on Android, there are usually suitable replacements.  Maybe someday they will be better than their iOS counterpart.

Come on Google, give me the Nexus 10 V2

One of Many Worlds: Another go at Go … failed!

Remember folks, choose the right tool for the job…

You can’t read about programming languages these days without Google’s Go programming language being discussed with much praise.  I agree that Go is good,  but I recently ran across a post addressing some short comings titled Another go at Go…failed!  The criticism is constructive and a good read.  Bottom line:

  • If your problem domain involves patterns that benefit from type parameterization or[2] polymorphism that is easily achievable through inheritance, Go is a poor choice.
  • If you find your Go code evolving into having few interfaces but many higher-order functions (or methods) that resort to frequent type assertions, Go is a poor choice.
  • Go runtime can learn a trick or two from JRE 7 as regards performance.

I thought it was going to be more bashing by a naive developer but it’s far from the case.   It goes to show the point that not all tools are the right tool for the job and not a single programming language is right in all cases.  

Developers tend to use a tool, programming language or framework, and try to fit the problem’s solution to the tool.  It doesn’t always work that way.

What He Said – Tim Bray · Software in 2014

Tim Bray has a great post discussing the state of software development in 2014.  I found myself nodding in agreement virtually all the way through this one, mainly about client-side development for mobile and the web.

The client-side mess · Things are bad. You have to build everything three times: Web, iOS, Android. We’re talent-starved, this is egregious waste, and it’s really hurting us.

A bit about mobile:

Mobile sucks · I’m going to skip the differences between Android and iOS here because they’re just not that significant in engineering terms. Anyhow, here’s the suckage.

  • First of all, you have to do your mobile development twice.
  • The update cycles are slow. Days in the case of iOS, hours for Android (compared to seconds for browser-based apps). What’s worse is that you can’t even count on people accepting the mobile-app updates you send them. Got a critical data-losing account-compromising privacy-infringing bug? Sucks to be you.
  • The devices are memory-starved, CPU-starved, and battery-starved.
  • There are loads of form factors and it’s getting worse.
  • You don’t get a choice of languages; if you hate both Java and ObjC, get another job.

Bottom line, client-side development is a difficult place to live but server-side is more stable.  I have felt this way for a long time, client-side makes me cuss and server-side makes me smile.  

It’s a good read.

Errors Installing the pg Gem When Using Heroku Postgres.app

I’ve been using the PostgreSQL Mac OS X app from Mattt Thompson and Heroku for quite some time now.  If you don’t know what it is, it’s a drop in app bundle for the PostgreSQL database.  There are many ways that work, this just happens to be really simple.

I use PostgreSQL with my Ruby on Rails projects and combine that with the pg ruby gem.  

I ran into a situation where the pg gem would not install because it could not find pg_config in a known location on my Mac.  The error occurred on Rails 3.2 but 4.0 may show the same behavior.  

The Error

The error can come up when running a bundle install or just a straight gem install pg from the command line. The resulting error may look something like this:

Installing pg (0.17.0) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
.
.
.
An error occurred while installing pg (0.17.0), and Bundler cannot continue.
Make sure that `gem install pg -v ‘0.17.0'` succeeds before bundling.

The Solution

I already mentioned the problem is the gem install not finding pg_config during installation.  So let’s find it.

1. First, find where pg_config is located.  Run this command from a terminal window:
which pg_config

Should display something like this:

/Applications/Postgres.app/Contents/MacOS/bin/pg_config

2. You can tell RubyGems where your pg_config file is located:

gem install pg -- --with-pg-config='PATH_TO_YOUR_PG_CONFIG'

For example, pg_config is here on my system:

/Applications/Postgres.app/Contents/MacOS/bin/pg_config

So I would install the gem this way:

gem install pg -- --with-pg-config='/Applications/Postgres.app/Contents/MacOS/bin/pg_config'

The pg gem should now install. I hope this helps.

UPDATE: Scott Watermasysk points out another good solution:

SimpleMailr Coming Soon to Make Email Newsletters a Pleasure

SimpleMailr med

I’ve been working on a SaaS application for the past number of months named SimpleMailr. It has gone through several iterations as I try to convey my intentions for the service.  In a one-liner, SimpleMailr is intended to “Get your newsletter in the hands of your readers easier.”

I’ve tried and used several services such as MailChimp, Constant Contact, Campaign Monitor and others but there is a certain amount of barrier to entry.  I want something simple to setup, simple to get that first newsletter to readers and simple to do over and over.  The end goal is getting content to readers and make it easy.

Using SimpleMailr you will be able to:

1. Easily add an existing list of email addresses.  If you know how to type an email address, copy and paste a list of address or upload an Excel file with email address in it, you will be able to get your list into SimpleMailr.  If you don’t feel comfortable with any means available..simply contact hello@simplemailr.com and we will do it for you. 

2. Easily add newsletter content to get your first issue out the door.  The content of your newsletter is the heart of what you have to share, even if you are familiar with HTML you can add your text and not worry about the details.

3. Send it.  There’s really nothing more involved once you have something to say.  Once your ready, just press the send button and we will do the rest.

4. If you care about stats, stats you will have.  Know how many subscribers you have, how many were sent your content, how many received it and bounce details.  If you want it, we will have it.

I would really like to get feedback on how you use newsletter marketing today as well as how you would like to use it in the future.  What could be better?  What’s missing with your current solution?  Tell me about your ideal solution.  Feel free to send an email to hello@simplemailr.com and start the conversation.  No obligation and I promise not to send any sales pitches your way.  You will be helping me build the best and most useful solution I can.

If you’re interested in following along to launch, you can sign-up to be notified right here:

 

Ratings or No Ratings, It Could be Time for A Change to Apple App Store Rating System

The latest episode of the The Talk Show, Gruber discusses his distaste for apps that ask for a rating. I found the view a bit disappointing. He has a lot of influence and is both a user and an app developer.

I can’t understand this adversity. A developer works hard and wants to know what a user thinks of their work. Is our time too much in demand to leave a bit of feedback? Ratings are supposed to have an effect how apps appear in the store, their rank and eventually their placement. An app without ratings is an app that may never be found, a possible lost soul.

I have responded in every way to the rating dialogs. If I don’t have time or have not had enough time with the app I will request to be asked later. If I just don’t want to rate it, I will respond with a “No thanks” but I do rate the apps I use and like.

This is but one problem with the App Store and users. Giving an application a rating or a review is not easy.  A user has to go to iTunes and the App Store, find the app and rate it.  It’s too much work.

David Smith has a thoughtful piece on his hopes for the future of the app store. I wish I had the same positive view of the future:

I want to believe that the App Store is a special place. I want for it to be the singularly best venue for customers to come and find innovative, well designed, quality software. Software that pushes the boundaries of what is possible and continually amazes and delights its customers. I want for there to be an aspirational pull upwards on my own development. I want to feel like I need to work extra hard to make sure my apps meet the high standards my customers have been trained to expect.

Gruber had a follow-up to David’s post agreeing the App Store and iOS should feel special.

It’s not just the App Store that we want to feel like a special place — it’s iOS itself. Using iOS, on both the iPhone and iPad, dozens of times every day, for stretches long and short, should feel like a platform in pursuit of perfection. Having a de facto standard practice where apps badger you at seemingly random moments with pop-up ads prompting you to rate them is in contradiction to this ideal.

I could be missing something but shouldn’t a user rating an application be helping filter out the bad apps? If a developer can’t ask for a rating, and we know users hardly go out of their way to rate an app, how can ensure we are getting the good apps? Maybe we should remove ratings altogether? Or it could be a time for a change to the way apps are rated; instead of a 1 to 5, a “Like” system such as on Facebook. You can’t dislike something on Facebook, only like it. A viable option?

I don’t think chastising a developer because they are trying to ask the user what they think is fair.  Accept this or don’t, kill off ratings completely or change the procedure.  I think what is there not doesn’t work and is too hard for users to take part.