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...
Multiple file upload with Rails 3.2, paperclip, html5 and no javascript
Today, I was looking for a simple multiple file upload solution for Ruby on Rails 3.2 with paperclip 3.0.4 and found several jQuery and Flash solutions, like Uploadify or jQuery-File-Upload, buy they seemed to be too heavy and complicated for my case...
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:
- 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...
Navigating your Rails project codebase with vim
When you work with source code, it is always nice to have the abilty to quickly jump to class/method definitions for either your own code or code from one of your ruby gems. This articles describes how to do this in vim with exuberant ctags, guard, and guard-ctags-bundler.
Tags
A tag is an identifier that appears in a "tags" file...