Agile Programming

Programación

Written on August 10th, 2010

Restore files and dirs from previous commits in Git

Captura de pantalla gitg gnome system tools master 1 Restore files and dirs from previous commits in GitWhen I met git, I fall in love in the moment. You can read any apointments I wrote previously here, and here (in spanish) but today I’ll explain how to restore files and directories from previous commits that it was deleted by a mistake or intentionally in the past.

It’s quite easy to revert or reset a single file from history, but what about pulling an entire directory out of the history?

The solution is simple:

git checkout ID_of_commit -- /path/to/dir

This will restore the directory from the given “commit with ID” in the /path/to/dir. Read the rest of this entry »

Written on July 15th, 2010

How to setup a LAMP server with less than 100 characters

lamp How to setup a LAMP server with less than 100 charactersOne of the reasons cause I love the GNU/Linux for developing is its easy and quick setup.
So if you’re a LAMP-dev you can setup a LAMP server with less than 100 chars.
With the next command you will have a apache2+php5+mysql on Debian based systems with the bonus of phpmyadmin for administer your databases.
sudo apt-get install phpmyadmin lamp-server^

Dont forget the trailing ‘^’ char.

Quick post, quick solution. Isn’t it?

Written on October 11th, 2009

Rotar imágenes y elementos solo con CSS

Sabías que se pueden rotar imagenes (y cualquier elemento HTML) utilizando solo CSS?
Añade estas clases CSS a tus elementos HTML para rotarlos en pasos de 90 grados.

.rot0 {
	-webkit-transform: rotate(0deg);
	-moz-transform: rotate(0deg);
	rotation: 0deg;
	filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0);
}
.rot90 {
	-webkit-transform: rotate(90deg);
	-moz-transform: rotate(90deg);
	rotation: 90deg;
	filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
}
.rot180 {
	-webkit-transform: rotate(180deg);
	-moz-transform: rotate(180deg);
	rotation: 180deg;
	filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
}
.rot270 {
	-webkit-transform: rotate(270deg);
	-moz-transform: rotate(270deg);
	filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}

Read the rest of this entry »

Written on September 4th, 2009

Getting things done algorithm

# Make sure all inboxes are empty.
def process (inboxes)
  inboxes.each { |inbox|
    inbox.each { |item|
      if item.requires_action? then
        if item.takes_epsilon_time? then
          item.do()
        elsif item.can_be_delegated? then
          item.delegate
          waiting_for.append(item)
        else
          deferred.append(item)
        end
      elsif item.is_needed_later? then
        filing_system.append(item)
      elsif item.maybe_wanted_later?
        someday_maybe.append(item)
      else
        trash.append(time)
      end
    }
  }
end

Taked from http://paste.ubuntu.com/263929/ and translated to Ruby language.