Rails 4: Disable assets caching for development/test environments

Ruby on Rails by default caches pre-compiled assets (sass, coffeescripts) to tmp/cache/assets directory in development and test environments. It makes page loading in development and running test faster (when assets are already precompiled), but may cause some weird bugs.

For example, when I was upgrading my Rails 3.2 application to Rails 4, I noticed that there are deprecation messages on CI server, but not on my local machine...

Protecting staging/testing site area

It seems, that the easiest way to protect staging/testing version of the (rails) application from search engines and undesired users is using HTTP Basic Authentication. Configuring it for nginx is very easy and well documented.

First, enable HTTP Basic Authentication and specify passwords file location...

Offline documentation for Ruby, Rails and your project's gems

I am going to work for a couple weeks on my Ruby on Rails project without broadband internet connection, so decided to research, how to get browseable and nice looking offline copies of Ruby's, Rails' and some other gems' (like RSpec and Capybara) documentation.

Here I'll show, where to get and how to build offline copies of:

  1. Ruby Core and Std-lib html documentation (offline copy of http://ruby-doc.org/) 2...

Testing authorization using RSpec parametrized shared examples

I have a rails app, that uses Devise for authentication and CanCan for authorization. There is a group of controllers in my application, that should be accessible by administrators only. I was thinking about a DRY way to test these resources and their accessibility by administrators only (using request specs with RSpec and Capybara)...

Using console vim as vim:// protocol handler in Ubuntu

Do you want your browser to launch console vim and open specified file on specified line when you click link like this: vim:///etc/hosts&line=10? This article will show how to register console vim as vim:// protocol handler in Ubuntu 11.10. Just follow these steps:

1. Create vim launcher script

We'll need small vim launcher script, which will handle vim://... uri...

Broadcasting your rhythmbox in ubuntu 11.10

Once I decided to setup my rhythmbox broadcasting into local network (so my wife or home media player could connect and listen), and didn't find any comprehensive guide, so I decided to write my own when I managed to configure it.

I found a couple rhythmbox plugins for that, but they didn't work for me, so I stopped on icecast plus darkice.

Installing and configuring icecast

Icecast is free server software for streaming multimedia...

Calling GNOME/KDE default application from NERDTree

Sometimes it is really nice to be able to call system default application for file or directory from vim. For example open Document Reader for a pdf file or browse directory with images with Nautilus. I didn't find working solution for NERDTree, which I use for file system navigation in vim, so I wrote simple [plugin][1] for it.

What it does, it simply creates new menu item e(x)ecute in NERDTree menu, which executes system default application for selected file or directory...