Making friends: NVM and nodejs deployment

Basically, there are two more or less normal ways of how to deploy nodejs application: shipit and flightplan. They both are not as good as such tools like capistrano for ruby or deployer for php. But, if you desire to use the same ecosystem for deployment as you use for development then you don't have much choices.

Comparing shipit and flightplan, I can say that the first one is more modular and has some good plugins and also supports "rolling releases" feature out of the box, while the last one is simpler.

Both on remote and in local environment I got used to use nvm to switch nodejs versions. And here I faced a problem.

PHP deployment: the right way

Recently I prepared a presentation about how to deploy PHP application properly. I spoke about major problems which we have to handle when we deploy an application. Also I prepared a list of different deployment tools in PHP (and not only) and gave some tips on how to deploy with Rocketeer.

You can find my presentation here (note, that you can use not only left/right arrow keys for navigation, but also up and down arrow keys).

Pretty git log with colors and graphs

I work with git in console pretty often. Commits, pulls, pushes, checking out branches, diffs — I do all that stuff. Of course, more complicated operations, like merge, I perform with GUI tools (IntelliJ IDEA is pretty good for that). Sometimes it's pretty useful to be able to check history log in a readable view without switching from console to some other program.

I configured an alias for pretty git log output with colors, dates, branches, etc. Since sometimes there is a case when I need to restore that config setting (e.g. when I move to another computer), I decided to put it into public. Maybe it'll be useful for someone besides me.

Simple XML-RPC client for PHP

Once I needed to make some XML-RPC method calls, but faced with the lack of simple implementation of it.

I tried to use different libraries, but they are too complicated. For, example PEAR's xml-rpc implementation is quite difficult to install on Windows and not always possible to install on Linux shared hosting. And XML-RPC for PHP at sourceforge have some problems with UTF-8 characters encoding. So I created my on simple XML-RPC client.

Localized routes in Rails: tips and tricks

  scope "/:locale", locale: /#{I18n.available_locales.join("|")}/ do
    resources :posts
    root to: redirect("/%{locale}/posts", status: 302)
  root to: redirect("/#{I18n.default_locale}", status: 302), as: :redirected_root
  get "/*path", to: redirect("/#{I18n.default_locale}/%{path}", status: 302), constraints: {path: /(?!(#{I18n.available_locales.join("|")})\/).*/}, format: false

Let's take a look at the above code sample from config/routes.rb and will study what it does line by line.

Ruby on Rails admin area scaffolding

Each and every Ruby on Rails website typically has its own admin area. Ryan Bates (a well-known person in Rails world) says in one of his first railscasts that it is a good idea to have the same code base for admin and public area of the website. Another approach could take place, I think. And this is why:

  • usually, admin area has more actions in controllers and more complex data output with variety of fields;
  • public area usually has simpler output;
  • having common code base for admin and public area leads to code complexity and increases the amount of access permission checks.

Thus, it is more sensible to separate admin area from public area. This way public area code will be simpler and cleaner and admin area code will do only what it's meant for. Of course, there are gems, such as activeadminrails_admin, etc. They allow to generate full-featured admin area. But implementation of your own custom admin area sometimes is more suitable, rather than customization of existing complex mechanism.

I'd like to tell you how to separate admin area from public area by example.

Life management

I'd like to share with you a system, tools and materials which I use to improve the quality of my life.

If you'd like to read more detailed version of this article, you can find it on the russian version of my website.

The system.

Your goals and plans should cover all areas of life:

  • family
  • health
  • work
  • personal improvement
  • social life
  • private projects and so on

About goals:

  • 3 main goals for every period you plan
  • should be reachable
  • should be measurable
  • should have a deadline


Today I'm starting English version of my website!

I'm really happy to introduce myself in both languages — English and Russian.

I plan to create new posts in 2 languages, though some older posts may not be translated.