Tristan's Blog


Circumventing the Heroku idler
December 28, 2012, 5:39 pm
Filed under: Grails, Groovy, Heroku, PaaS, Programming

One of the main problems with running a Grails based webapp on Heroku is the amount of time that it takes to start your (free) instance after it’s been set to idle by the Heroku routing mesh. This is because Spring takes a while to start up/configure everything and during this period, your users are staring at the screen waiting for your site to load.

One workaround is to setup a server elsewhere that pings your site, but if I wanted to setup a server elsewhere, I’d probably just run my webapp there instead of on Heroku. I had initially also tried using Pingdom to make 1 request per minute, but the Heroku routing mesh is smart and will idle your instance even if the Pingdom bot is trying to request it (or so it seemed).

Finally, I ended up with a solution that has kept my instance for jsonblob up for quite a while (as seen by Pingdom). All you have to do is make a HTTP endpoint that will return a varying amount of bytes in each response and configure Pingdom to request that endpoint.



FizzBuzz in Scala
July 27, 2012, 4:34 pm
Filed under: Programming, Scala

Coding for fun Fridays

Have you ever been asked “FizzBuzz” in an interview? If not, you can read about FizzBuzz here.

Here’s a simple solution in Scala:



Automatic Entity registration with ObjectifyFactory using a Spring FactoryBean
April 5, 2012, 4:52 am
Filed under: Google App Engine, Java, Objectify, Programming, Spring

I’ve been doing a lot of work lately with Google App Engine/Objectify on a Spring project and found it was becoming cumbersome to always create an ObjectifyFactory whenever I need to interact with the datastore. (more…)



My first open source contribution
January 6, 2011, 5:23 am
Filed under: Java, Programming, Scala, Spring

I’ve intended to contribute to an open source project for a quite a while, but had never made the effort to find a project to work on. Recently at work we’ve started using the Scalate templating engine with Spring MVC. Up until my change, the Spring MVC support in Scalate was very rudimentary, however the ScalateViewResolver now supports the order, prefix and suffix properties similarly to the InternalResourceViewResolver.

(more…)



Great Customer Service Emails
December 29, 2010, 5:58 pm
Filed under: Uncategorized

A few days ago I ordered a Trackpad Slip from Waterfield Designs for the Magic Trackpad I received for Christmas. The order confirmation I got from them had a nice human touch:

Hi Tristan,

Thanks very much. I just want to let you know that your order (#XXXXXX) will ship fresh from our San Francisco factory on the evening of 27-Dec-2010 via US First Class Mail.

Thanks for tracking us down and giving us a shot. I hope we meet your expectations.

If there’s anything else I can do for you, just let me know.

Best regards,
Gary

PS: By the way, this is what we’re sending you:

1 -Trackpad Socket $12.00

Product Total: $12.00
Sales Tax: $0.00
Shipping: $2.00
Grand Total: $14.00

Even though this is probably automatically generated, it increased the chance that I’ll buy another product form them because it feels like there is a human connection to the purchaser. I wish more companies would send simple confirmation emails like this.