martedì 2 aprile 2013

Here's a nice collection of Ruby one-liners. Having a few of these formulas at hand, may save you lots of work...

mercoledì 27 marzo 2013

Creating a remote git repo

Assuming you have a project in your local machine and console access to a remote server (and git installed on both), these instructions will accomplish the following:

  1. turn your local copy into a git repository
  2. push it to the remote server

venerdì 25 maggio 2012

Finding out where a ruby method is defined

To find out the source file/line of a ruby method definition, do something like the following:

Post.all.method(:all).source_location
Post.first.method(:save).source_location

Here's the source of this tip.

lunedì 18 luglio 2011

Unencrypting home directory in Ubuntu

In an Ubuntu install, I once requested home folder encryption. Bad idea.

To revert to regular file management I followed these instructions, which involved commenting out a line in each of the /etc/pam.d/common* files.

During a subsequent aptitude safe-upgrade, those lines were restored, not sure why.

I have again commented them out.

martedì 14 giugno 2011

UTF-8-related warning from rack

After a recent bundle update (early June 2011), the following warning shows up while running specs:

GEM_PATH/rack-1.2.3/lib/rack/utils.rb:16: warning: regexp match /.../n against to UTF-8 string

This post addresses the problem, although it's strange that the problem in my case appeared just now.