Wednesday, June 27, 2012

Affiliate system in Ruby on Rails

Ruby on Rails shines all around, but especially when you consider community of high quality developers and architects that was build around it.

There is plenty of code and gems written for it, but surprisingly not that many open source products that you could use "out of the box". For example, recently my client needed an affiliate system. My first call was to google it. Plenty of systems in php, but none in RoR. Anyone?

Tuesday, June 19, 2012

Validating non-persistent models in Rails 3

Some times it happens that we need to validate entity that is short lived and not persisted anywhere. It is very easy to do in Rails 3 - just include
include ActiveModel::Validations
in your model and that's it - you can call
now to test it's correctness.

keep your heroku dyno up

I have many apps that use single dyno. The problem with such apps is, that after 1h of inactivity heroku puts them to sleep, and waking up process takes from 5 to 30 seconds depending on your slug size. To avoid your first visitor wait for heroku to spin up your dyno I use that pings specified url every 5 minutes.

Monday, April 30, 2012

Installing eLance Tracker on 64bit Ubuntu 12.04 Precise Pangolin

I recently struggled with installing Elance Tracker on my new laptop. Here is what I have done to make it work.

Install i386 libs

sudo apt-get install ia32-libs
Download and install AdobeAir (latest supported version at the time was 2.6)
chmod +X AdobeAIRInstaller.bin
If it complaints about missing gnome-keyring:
sudo ln -s /usr/lib/i386-linux-gnu/ /usr/lib/
sudo ln -s /usr/lib/i386-linux-gnu/ /usr/lib/
Install Tracker
sudo dpkg -i TrackerSetup.deb