Igor Alexandrov

Programming and something else…

The Way to Wiselinks-1.0

| Comments

More then half a year has passed since Wiselinks-0.1 has been released. A lot of work has been done since that. From one hundred lines of code CoffeeScript plugin Wiselinks became a Swiss Army knife for browser state management.

For those, who don’t know anything about Wiselinks: it makes following links and submitting forms in your web application faster. You may find it similar to Turbolinks or Pjax, but Wiselinks works as a whitelist rather than blacklist.

Facts:

Wiselinks-1.0.0 is out, what was done for this release?

We fixed all problems with URL encoding in all browsers (even in IE, which is not a browser, but the pain for us).

History.js was updated to 1.8, and with release we got ability to drop rather ugly _suid parameter in HTML4 browsers. So instead of this in IE:

http://192.168.0.2:3000/#./catalog?&_suid=1373486813312051452925907933

you will get:

http://192.168.0.2:3000/#./catalog

Looks good yes? Wiselinks has grown to stable and wide spread solution, it has maintainers, community and goals for future.

Thank you!

Using Git Subtree to Share Code Between Rails Applications

| Comments

For different reasons (mainly NDA) I cannot write real project names in this post. To make all things clear, let’s say that we have one project called FooLog (Rails 3.2) and we have to create new project called FooMarket (Rails 3.2 too) that uses data and ROI algorithms from FooLog.

As it usually happens at the beginning of the development, FooMarket seemed to us a very simple project with a pair of controllers and five or eight models. We wanted to add simple API to FooLog and authorise FooMarket to load data from FooLog through this API (with OAuth for example). After a couple of conference Skype-calls with our customers we understood that we are doing something bigger then two controllers and five models and I said – “OMG! We are trying to create another FooLog here! Why we cannot just add another section to FooLog and call it FooMarket?”. The answer was: “Because of marketing. FooLog and FooMarket are two different investment projects and should work separately”.

ipgeobase.ru Support in Geocoder Gem

| Comments

For some reason geocoder gem don’t have support of ipgeobase.ru out of the box.

You may don’t know this, but ipgeobase.ru is leading ip-geocoding service in Russia and Ukraine. Its accuracy of coordinates detection for Russian ip-addresses is much higher then in the freegeoip.net. For example, I live in Tver and my home ip-address is 213.5.102.43; freegeoip tells me that I am in Moscow, ipgeobase tells me that I am in Tver, about 150 kilometres difference!

That’s why I decided to add support of ipgeobase to geocoder.

Rails Presenters and Filters

| Comments

Part 1: Introduction and Filters

How ofter do you use Presenter Patter in your Rails applications? I do it when I have really complex views and want to move all logic from template file to some Ruby class. Usually this can be done when you have listing of items with paginations, per page selector sorting and filter for these items. In this post I want to show you my approach for such situations.