martes, 22 de marzo de 2011

XGN en Santiago de Compostela

Los próximos 15, 16 y 17 de Abril estaré en la XGN presentando algunas charlas junto a Alfredo Casado. La verdad es que tengo muchas ganas de estar por allí con todos los demás participantes (la gente de axilmente, las agile girls, los agilismo.es, los funius, los 1up talent, etc). Vamos a aprender mogollón y nos lo vamos a pasar piruleta :)

He podido cotillear algunas de las charlas propuestas por algunos de estos cracks y son realmente alucinantes :) Nosotros intentaremos mantener el nivel, que no va a ser fácil. Para ello, estamos preparando:

  • Convierte tu vida profesional en una lan party: software craftsmanship
  • Teo crea su primera aplicación web (con Rails, Git y Heroku)
  • ¡Si funciona no lo toques!, ¿o sí?

Además, si todo lo que os he contado no os termina de convencer, se está organizando un openspace para el sábado en el que seguiremos hablando de desarrollo, agilismo, etc.

Si no tenéis reservada la fecha, reservadla ya. En serio, nos lo vamos a pasar piruleta.

PS: Iré publicando por aquí pequeños spoilers de las charlas para ir abriendo boca :P

viernes, 11 de marzo de 2011

Elige tu propia aventura

Tras un par de semanas algo turbulentas, hoy ha sido mi último día como edenita.
El tiempo que he formado parte de Eden ha sido espectacular. Estoy muy agradecido a todos y cada uno de mis compañeros por creer en mi y por hacerme crecer tanto en lo personal como en lo profesional :) De verdad, muchas, muchas gracias por haberme brindado esta oportunidad.

Supongo que os preguntaréis qué ha pasado. Tranquilos, no he suspendido durante mi aprendizaje :P De hecho, voy a seguir siendo aprendiz de Aimee (¡yuju!). Simplemente, a veces las cosas no salen como uno espera y entonces es cuando tenemos que abrazar el cambio :D
Ahora empieza otra aventura :D Me voy a quedar en Inglaterra mejorando mi inglés y trabajando como autónomo. Después de mi internship pense en hacerlo en España, pero no terminé de atreverme. Ahora sí que me voy a lanzar :D Todavía no tengo muy claro los pasos a seguir (tengo bastante lectura acumulada para el fin de semana :D ), pero tengo compañeros que me van a ayudar en esta nueva etapa del largo camino (y también tengo un cliente :P ).

¡Nos vemos!

PS: Mañana tenemos code retreat en el taller :D Ya os contaré que tal.

My Vim configuration. Part 3 - Vim shortcuts

Continuing with my explanation of my Vim configuration (you can have a look at my view settings and my plugin settings), today is the day of the shortcuts :)

Everyone of us love the shortcuts our favorite IDE has. Vim is no less and you can define whatever shortcut you need :)

How to define a shortcut in Vim
It is very easy to define a shortcut in Vim, you only need to map the key combination you one to use with the actual command you want to execute.
To map a combination you can use map or noremap (and all the variants for each mode, like imap, inoremap, nmap, nnoremap, etc...). The difference between map and noremap is that the second one is not recursive. You have a very good explanation here.
You can see an example of a shortcut definition:

This shortcut closes Vim without saving the file and can be executed by pressing the keys 'c', 'l', 'o', 's' and 'e'

Leader
The previous example is more or less a "hard code" shortcut :) A better way to map commands is using the leader variable, so you start your shortcut by pressing your leader combination.
To define your leader combination you only need to do something like this:

In this case, my leader combination is just the ',' key :)

It is important to define your leader combination because a lot of the existing plugins for Vim use it for their own shortcuts (mappings).

My shortcuts
Ok, now that we have defined the leader, let's have a look to my actual shortcuts.
The first one I want to show you is how to change between the actual buffer and the alternative buffer (If you don't know anything about Vim buffers, take a look at this video, it is great!)

What I'm doing here is mapping ',' and '6' to ':b#' (:b# is what you have to type to switch buffers when in normal mode. means that, after the command, I want to press 'return', executing the command). I'm using nnoremap for this shortcut because I want to use it only in normal mode (the first n of nnoremap) and because if some of my plugins map any ':', 'b' or '#' key to any command I don't want to execute that shortcut (not recursive), I just want to execute ':b#'.

The next shortcuts are related to some plugins I use:

I just map the NERD tree to ',d' and a little bit of help every time I want to use ack (only in normal mode) :P

Then, I have two shortcut for removing the extra spaces (at the end of the line) and to change tabs with 2 spaces :)

I also have a shortcut that changes the ruby hashes (with a symbol as key) from 1.8 syntax to 1.9 syntax:

And last, but not least, I map the tab as a match bracket finder:

I probably change all of this shortcuts in the future, when I get more experience with Vim, but I hope it shows you how powerful (and customizable) Vim is :)

PS: I know that the gist are not visible on google reader. Sorry about that! I want to move my blog and fix that :)

martes, 8 de marzo de 2011

Sass is so cool!

I have to admit that I didn´t know almost anything about CSS six months ago. I was an API developer and I never needed it. But now, everything has changed (I know, it should have changed before, but it didn´t). I need to improve my CSS skills and I need to do it quickly!

The thing is, I don't really like CSS. I find it a bit confusing and, every time I try to do something I end up doing a mess. What can I do? I need to learn SASS (Syntactically Awesome StyleSheets)!

SASS to the rescue
This is the first line you can read on the SASS page:
Sass makes CSS fun again.
And, do you know what? It is true!

What makes SASS funny
For me, SASS is funny because it brings programming concepts to CSS, and I love programming :D

Variables in SASS
Corey Haines said on Twitter that this year's color was #CB6586. If I start to use this color on my CSS I have two problems:
  1. If I want to change it on january 1st of 2012 with the 2012 color I'm going to find all the places I'm using it (DRY violation).
  2. I am not a color machine. #CB6586 does not mean anything to me (Not readable).
SASS solves those two problems with variables. We can define our color as:

And we can use that variable everywhere we want:

Mixins in SASS
Another DRY violation that I used to do with CSS is when I have to define effects (round borders, shadows, gradients, etc...) to the elements. I end up writing the same more than once (probably because I don't know almost anything about CSS, but probably because it is a very easy thing to do with CSS). SASS helps me to define mixins so I don't repeat my "code" every now and then.
An example of how to define a mixin to apply a gradient can be this one:

And we can use it like this:

Did you notice it? Mixins accepts arguments! How awesome is that?

More SASS awesomeness
You can find more cool SASS features on the official page. It is very simple and very useful!

Enjoy it!

domingo, 6 de marzo de 2011

My Vim configuration. Part 2 - Vim plugins

I was supposed to talk about shortcuts in Vim, but I've changed my mind :P I'm going to talk about how to install plugins for Vim :)

Vim plugins
Vim has a lot of plugins, a lot :D So, how do I choose the plugins I need? Well, fist of all, you have to know what you need. This is very important, you shouldn't use a plugin if you're not sure about why you need it!

Once you've decided which plugins do you want you only need to install them!

How to install a vim plugin
Vim plugins are just scripts and to install them you only need to copy the script file in the right directory. Ok, this looks very similar to the way we add color schemes to our Vim, doesn't it? Yes, the only thing we need to change is the directory. When we install a plugin, we have to add the script file to the 'plugin' (or 'ftplugin' if it is a file-type-dependent script) directory in our .vim directory. Sooo easy :D

Yes, so easy. But, do I have to do that every time I get a new plugin or every time I update an old one? Cannot this process be automated? Yes, it can! There are a lot of tools to manage your plugin dependencies. I am using Vundle right now.

Vundle
Vundle is a plugin management tool for vim. It is very easy to set up and it is very easy to use. You only need to follow their instructions to "install" it. Once you have everything in its right place, you have to add those two lines to your .vimrc file:

This makes bundle available while you're using Vim :D

Vim plugins
Ok, so, how do I install plugins with Vundle? You only need to add the plugins you want to your .vimrc file (with the Vundler format). I have those:

As you can see, you can ask for the plugin by its "official" name or you can linked it to its github repository.

Once you've defined the plugins you want you only need to type:

on Vim to install or update your plugins :D

Ok, that's all for today. Soon on your screens "How to create shortcuts with Vim" (Although maybe I'll talk a little bit about why I choose those plugins)