Find all cities that have no photos

Last week I noticed quite good example to illustrate the problem of finding records with empty association, i.e. when particular has_many association returns zero records.

In this post I’d love to go a little bit further into proposed solution and figure out why it actually works.

Read on →

Pow for Linux

In the previous post I shared advantages of Pow based on my experience, however there is one significant problem: It does not run on Linux :(

Sadly yes, but I’ve seen some alternatives, for example:

Prax

Rack proxy server for development

http://ysbaddaden.github.io/prax/

Invoker

Invoker is a utility belt for managing processes in development environment. Use it for managing multiple processes with ease.

http://invoker.codemancers.com/

Conclusion

While Prax seems closer to Pow, the Invoker goes far beyond the Pow ideas and allows to manage all kind of processes, however it also adds extra complexities.

Though I don’t know how well those replaces Pow. If you had any experience please let me know how it was.


2 years with Pow

I’ve used the Pow for a quite long time so it become de-facto standard way for running all kind of Rack based applications(Sinatra/Rails/etc) for me.

Perhaps it could be good idea to share my experience now :)

Alternative to hosts with ability to run multiple projects at once is something intuitively comes to the mind and Pow really does it great, but not limited to.

Read on →

Opscode Chef: Install or Upgrade packages in recipes?

Chef comes with a handy package resource that helps to manage packages on the target machine. In this post I’m going to focus on the two major actions which are :install and :upgrade. While the difference is obvious it is not always easy to consider which one is better when writing your first recipe.

So, let’s figure out when to use one or the other :)

Read on →





Helper function to start new tmux session with the name of current directory

There are many promising tools that helps with bootstrapping tmux sessions, but this simple function, originally shared by Chris Toomey from thoughtbot, beat them all :)

1
2
3
4
5
6
7
8
9
10
function tn() {

    if [ -z "$1" ]; then;
        session_name=$(basename `pwd`)
    else
        session_name=$1
    fi

    tmux new-session -s $session_name -n 'main'
}

Once added to ~/.zshrc or ~/.bashrc, etc., you can start new tmux session as simply as typing the following:

> tn

And it will take the name of current directory.

Enjoy!


php-fpm 0.6.2 cookbook released

With the help of all great contributors and particularly @ameir we reached 0.6.2 release today, which, among others changes and fixes, introduces definitions similar to LWRPs, so, no more testpool automatically setup ;)

Please, make sure to checkout updated Usage section in README.

Enjoy!