Bogdan Gusiev's blog

How to make good software for people


Benchmark your performance patches
01 May 2012

After a dozen performance patches to many gems want to share some practical experience I gain. Tools I’ve picked up was perftools.rb and ruby built-in benchmark library. They are fit well for cases when optimization stays at Ruby level and doesn’t require to fix something in native extensions or dig into IO operations.

gem contribution performance callgraph patch


Web Forms 2.0: Submit with Ajax and Client Side Validation
01 Mar 2012

Web 2.0 world force us to build Forms in a new level of quality. AJAX and dynamic HTML changes a way how forms should work internally. Let’s call it Forms 2.0. And of course this facts bring a lot of complexity every time we deal with forms. Sometimes such form makes a real problem comparing to regular Web 1.0 form. Here will be a talk how to make Forms 2.0 as simple as Forms 1.0.

javascript ajax forms validation html jquery


New Rails Release with a few features from me
23 Jan 2012

Upcoming Rails 3.2 release has many useful features.

Some of them are coming from me:

  • ActiveRecord #pluck method
  • Strict validation concept
  • Customizable mass assignment sanitizer behavior
  • Gotcha for select[multiple] tag

Here is a more detailed description than in the Changelog.

rails changelog contribution


New release of Datagrid: Mongoid, Rails Engines and HTML columns support
10 Jan 2012

Datagrid version 0.5.0 has been released.

Datagrid is a Ruby on Rails plugin that helps you to build and represent table-like data with:

  • Customizable filtering
  • Columns
  • Sort order
  • Localization
  • Export to CSV

Here are some major features from new release.

datagrid gem rails changelog


Improve your Email delivery code with Mailtrap
18 Nov 2011

Today, I want introduce the Mailtrap web service aimed to help developers build and improve their email delivery functionality.

Usually people use same SMTP settings for all environments, but this actually creates many problems in Staging and Development environments. Mailtrap is a special SMTP service for these environments aimed to solve specific problems.

smtp development service environment


Slides: Fighting with fat models
11 Nov 2011

Here are my slides from RubyC conference.

This presentation covers a hot topic for projects that are more than a year old - it’s fat models. The problem appear naturally as models are the best place to allocate business logic code. There are number of existing techniques to manage large amount of code in Rails application. But they are suitable only in a half of use cases. For the rest of them we can use Traits pattern that is described well in this presentation.

Fighting with fat models

model service dry slides rails


Resque-way
17 Oct 2011

My article about Resque was posted on Engine Yard last week. It has very good notes from EY engineers and doesn’t have my regular grammar mistakes. Enjoy your reading.

resque framework contribution


Advanced RSpec Techniques presentation
08 Jul 2011

I’ve always pay attention to Rspec and posted some articles about Advanced Rspec features. Right now about 2k tests written by me personally in 3 years of development with Rails.

Here is the slides from my talk about all invented patterns and best practices:
Do rspec: fogotten features of RSpec

subject rspec context behavior dry slides


Reporting made easy by Datagrid gem for Rails
26 Jun 2011

4 years ago I was working on some enterprise projects with a lot of reports. From that time I was thinking about perfect report gem that would provide easy DSL for making filters and sortable columns to build reports and make it all reusable with standard OOP techniques. Since that time this idea never left my head and now finally I have enough knowledge and opportunities to build such tool.

rails activerecord datagrid gem report


Patching dbext vim plugin to support Rails naming conventions
30 May 2011

dbext is an excellent vim plugin that allows you to execute SQL queries directly from vim. For example: select * from <word under cursor>. When dbext is used with Rails there is a problem that you can work with some variation of table name like:

  • UserRole
  • user_role_id
  • user_role_ids
  • user_role

But still wants to use it as table name in your database queries so that you won’t type it manually.

rails vim dbext patch convention sql