There is no magic, indeed.

January 14th, 2010

I’ve just read ”Do You Believe In Magic?” and the following quote resonated particularly well:

“It’s not magic. There is no magic involved. It’s just, if you never learnt Lisp, then you never learned to program, and Ruby’s power is exposing a deficiency in your skills.”

I find it to be very true, and I suppose one of the reasons I’m so happy about Ruby is that I learned Lisp and Scheme before.

Even though I didn’t use Lisp for any sizable project. I tried, but I found it to be quite unfriendly and ‘hairy’ in setup, environment and library support. Ruby solved all that for me w/o sacrificing almost anything power vise.

Yeah, I know, MVC is the “Only True Way™”. But sometimes, just sometimes, you need your link_to or html helpers working in the model.

For example, sometimes the cleanest way to implement something is to have to_html in the model (widgets anyone?). Doing this will most probably require generating some urls, and you need a controller for that. Usually I solved this by passing controller to the to_html function, but it always felt wrong.

Read the rest of this entry

Clicktale is a service that allows you to record and later playback behavior of your users while they are using your site. And Rails is Rails, you know. And those two are getting along just fine, until the user logs in. After that clicktale service is cut out of the html pages this user gets and can’t record the session. But it just started to get interesting…

This plugin brings back the connection between Clicktale and Rails even for those closed pages. You’re going to get your better usability after all.

Read the rest of this entry

Thanks a lot to Amit Hurvitz for providing a file of Virtual Disk Image (VDI) of VirtualBox, containing an up and running JRuby on Rails on Glassfish with Mysql. Image also contains some examples (actually solutions to the code camp exercises), all running on top of an OpenSolaris guest OS (can be run on many host systems).

Grab the image ~1.5GB archive.

Grab the exercises ~9.7MB archive.

We participated in JRuby on Rails with GlassFish Code Camp hosted by Sun Microsystems Inc. I was speaking about the framework in general trying to infect Java developers with Ruby On Rails. Slides are available.

Amit Hurvitz gave exciting presentation about GlassFish and short introduction into DTrace. Find out more details about the Code Camp.

Rediscovering HAML

February 11th, 2009

I was the last person in our company working with ERB to render templates. While all the rest switched to HAML. At the beginning it was quite hard for me to read HAML comparing to ERB. HAML looked for me like some completely alien thing with weird percent marks all over the place and the significant whitespace never did it for me. On the other hand ERB felt like warm home after years we spent together.

Until I did the switch.

Read the rest of this entry

Recently we looked for video transcoding/hosting solution to use in one of our client’s projects.

The best thing we’ve found is Panda. It runs on Amazon stack of services including ec2, s3, and simpledb.

Using amazon has many advantages. no contracts, pay as you go, easy and fast scaling in case your site explodes :)

Unfortunately the image that is refered in the Getting Started (ami-05d7336c) is not safe for production – it has openssh version with a serious security bug, but don’t worry, we will explain how to fix it.

Read the rest of this entry

Deployment process requirements

December 17th, 2008

This blog-post is mostly targeted at non-Rails developers. Rails devs should know all this by heart :) Many times we need to explain to our customers what is ‘proper deployment’ and why their current one sucks :) Now we’ll be able to just point them to this post…

Proper deployment is almost not found anywhere. At least anywhere we looked. Very few places really ‘get’ it and assign enough importance to it. Some project owners just don’t know how it is supposed to be, so they accept their developer’s practice of ftp sync to production server :)

If you are a developer, make sure you implement it all.

If you have a project developed for you, then this is a checklist that you can bring to your developers/consultants and require ‘yes’ to every single one.

If your deployment procedure misses any of the qualities listed below, you are asking for trouble.

Production deployment must be:

Read the rest of this entry

Being Lazy with Ruby

June 4th, 2008

On one of our projects we needed to do some caching for an action with an expensive db query. Fragment caching took care of the rendering but we needed a way to skip the db if we have a cache hit. And checking for an existence of the fragment file in the controller just didn’t seem right.

Lazy evaluation to the rescue.

Read the rest of this entry