The Freelancer Dilemma

It is said that we all need to sell ourselves, e.g., in order to get a job. However getting a conventional job was never my favorite dream, I’ve always preferred to be on my own, I’m very independent and like to arrange my stuff my way and decide how where and when to work.

While probably a minority, many people are like me, and if you are, you probably also hate office politics and corporate paternalism. One obvious solution for our plight is going freelance, which is what I’ve done for a number of years.

If this is also your case or aim, I don’t have to elaborate on the advantages of freelancing, and you’ll probably know or guess a number of disadvantages. About the later I venture to say that the most common difficulty with being a freelancer is to get enough of good clients/gigs in a consistent manner. In other words the self-marketing problem.

As an employee you sell yourself once, and provided you’re reasonably good at your job (or just average depending on the case), you probably won’t need to sell yourself again in a number of years. Yet as a freelancer you need to sell yourself again and again.

So there’s a need here, and thus on answer to it a number of books and courses have emerged on “how to get clients” as an independent professional. That’s great, I always like to learn new skills and that’s clearly a valuable one. And yet, while I’m learning how to get clients I’m not getting paid, so if for some reason I can’t get a gig with my so-far limited self-selling skills, I’d have to maybe get back to applying for conventional jobs… and then I’ll have very limited availability if I do manage to secure some freelance project. Trapped in a catch 22.

Contractor agencies

In some countries there are agencies that freelancers can use to get a contract job. This may work nicely in many cases but has also a number of disadvantages for those who truly love the freelancer lifestyle. Just to name a few:
  • There’s a conflict of interest, because agents most of the time are not “your” agent, they have many other potential candidates and they will push you or not to the client depending on their own interest, mostly the commission they expect to get.
  • Most agents know little about your job, they don’t understand your qualifications (often they won’t even read your CV) and their pre-selection job is just one of matching keywords they don’t know what they mean.
As a consequence of the above agencies are as much of a help as they are a hindrance.

Furthermore a contract job is typically very similar to an employee job: although you don’t participate in office politics, you still have to work in an office setting, be there during rigid office hours, attend to some useless meetings and so on. Most importantly, depending on where you live, you may have to move to another city or country in order to access proper opportunities according to your qualifications. While I’ve done it a few times and enjoyed it, I would prefer the freedom to choose where to work from.


It’s a well known fact that there’s a general shortage of highly qualified labor, particularly in technology-related jobs. And yet many freelancers struggle to get an steady inflow of relevant projects. Isn't there another alternative for a talented professional that wants to work independently?

Probably not until recently, but fortunately some entrepreneurs detected this market niche and they have setup an innovative service for some kinds of freelancers (mostly designers, coders & tech consultants). They do the hard work to find high quality clients for you but, unlike contractor agencies, they make a much more serious attempt to find the right professional for the client. This results in the following advantages:
  • there’s no conflict of interest because there are no agents acting as gatekeepers every time you apply for a project
  • they are technically conversant (the founders are engineers themselves) and make proper matches
Now how easy is to get into their network? Here’s the good thing: it’s not easy at all! they have an exhaustive pre-screening process so only the best get through it. In fact I’m in the process of applying and still don’t know if I’ll make it.

Of course this is good because you have the chance to demonstrate your value, and sell yourself but, like an employee who applies for a job, you have to do it only once. If you get approved you’ll get access to high quality projects and can work as a freelancer without having to hunt for clients and distracting your resources in selling yourself every single time. 

Plus you get to work not only as a freelancer but as a remote one. Therefore not only you can be located anywhere in the world, you may work for companies worldwide, and thus you’re not limited to a particular country or area or forced to relocate in order to get a good deal. I suspect this also acts as a filter of innovative companies, because they must have the technical and organizational structure in place to integrate remote workers. That shows a minimum of sophistication and open-mindedness, therefore the kind of companies I’ll probably enjoy the most to work for.

Now let’s see how this turns out to be! I’m excited about the prospect of becoming part of the Toptal Web Developers Group !

Symfony 3 on MAMP with Mercurial VCS and Eclipse IDE - part 2

Part 1

As it already "does something" we will continue with the demo app.


  • Next step: mercurial repository. Initialize:
cd /Users/MyUser/Workspace/symfony_demo_01
hg init
  • set at least user name parameter for Mercurial
vi .hg/hgrc

username = myself
  • Define files to be ignored -- Mercurial similar format than git, just remove trailing slash "/" on every line
cp .gitignore .hgignore
vi .hgignore
  • initialize repository
hg addremove
hg commit

Eclipse & debugger

Create Project

  • File - Import... - Mercurial - Projects from local Mercurial repository

You may now commit the newly created .project file


MAMP already comes with xdebug but it has to be enabled:
  • activate it in the currently used MAMP php-ini file: uncomment the loading of the extension and enable remote debugging
vi /Applications/MAMP/bin/php/php5.6.7/conf/php.ini

xdebug.remote_enable = On
  • Now you can create a debug configuration in Eclipse. In my case it worked with the following settings
    • server - Base URL: http://symfony_demo_01.loc:8888
    • server - Path Mapping: / -> /Users/MyUser/Workspace/symfony_demo_01
    • file: app.php

YAML files

The default installation uses YAML files for configuration options. There's an Eclipse YAML editor called Yedit, but I couldn't make it work so I just associated the .yml extension to the default text editor.

Symfony 3 on MAMP with Mercurial VCS and Eclipse IDE - part 1

I use MAMP+Mercurial+Eclipse as PHP development environment on Mac OS X. These are instructions for this environment adapted from

  • As the Symfony 3 installer uses the default system php command, we will first make sure that it takes the one from MAMP we want, in this case PHP version 5.6.7. For this we will create an alias which for convenience you’ll probably want to add to .bashrc: 
alias php=/Applications/MAMP/bin/php/php5.6.7/bin/php

  • Check the PHP version you are using with: 
php --version
  • you may also check the php.ini file being used in case some change is required
php --ini

  • As admin user:
sudo curl -LsS -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/symfony

  • As your regular user:
symfony new symfony_test_01
  • app is installed on user’s home page. You may want to move it to some other folder

mv /Users/MyUser/symfony_test_01 /Users/MyUser/Workspace/

  • run it

cd /Users/MyUser/Workspace/symfony_test_01
php bin/console server:run

you should get this:

 [OK] Server running on                                                                                                                                                                                             

// Quit the server with CONTROL-C.
  • Point the browser to the URL shown by the last command and verify it works

With this we've verified it works with the PHP's built-in server.
For a number of reasons I prefer to setup an Apache virtual host instead of using it, even if this requires more work.
  • For that we create a virtual host configuration file for Apache. This file may contain something like this:
########## symfony_test_01.loc

<VirtualHost *:8888>
DocumentRoot "/Users/MyUser/Workspace/symfony_test_01/web"
ServerName symfony_test_01.loc
ErrorLog "/Users/MyUser/Workspace/symfony_test_01/var/logs/apache-error_log"
CustomLog "/Users/MyUser/Workspace/symfony_test_01/var/logs/apache-access_log" common
<Directory "/Users/MyUser/Workspace/symfony_test_01/web">
DirectoryIndex app.php
  • We save this file as apache_vhost.conf
  • Now we make a Apache-MAMP to load this file. For that you can do something like:
echo "Include /Users/MyUser/Workspace/symfony_test_01/apache_vhost.conf" >> /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf 
Note that I included a fake domain name "symfony_test_01.loc". This is to allow several projects to run on the same server (localhost)
  • So for this domain name to work we'll add it to /etc/hosts. As admin:
sudo sh -c "echo ' symfony_test_01.loc' >> /etc/hosts"
  • Start MAMP
  • Now we verify it works by pointing the browser to the URL
  • Then check if there's some configuration issue worth fixing:
  • Managing components in Symfony is easier with the composer package manager, so here's how to install it if you don't have it
curl -sS | php
sudo mv composer.phar /usr/local/bin/composer
composer about
  • Update packages that may have newer versions
composer update
  • Yet another check
php bin/console security:check
Now we will try with a demo app that implements a list or articles (= a barebones blog without comments)
cd /Users/MyUser/Workspace
symfony demo
mv symfony_demo symfony_demo_01
  • and repeat some of the previous steps top make it work

PHP + Ruby Development Environment on Mac OS X

Note: This article is about PHP only, in a forthcoming one I will include Ruby.

There are many possible tools, this is the stack I use:
  • Mac OS X 10.6 Snow Leopard/10.7 Mountain Lion
  • MAMP 2.2
  • Ruby - rvm
  • Aptana Studio 3.4.2
  • Mercurial
  • [Dropbox for manual sync between two computers (e.g. desktop & laptop)]
And these are my particular reasons for it:
  • I'm already familiar with Eclipse, and Aptana comes with built-in support for Ruby, Python, PHP and JavaScript.
  • I develop/maintain a number of applications in Ruby and PHP, and I prefer to use the same tool for both languages.


Create a PHP project

  • Create a project on Aptana with your PHP application. 
    • I typically use File->Import-> Existing Folder as New Project
    • Let's assume you use the folder /Users/myuser/Workspace/PHPProject
    • If you haven't created a Mercurial repository, you can do it now from the terminal:
cd /Users/myuser/Workspace/PHPProject/
hg init
Open the project on Aptana (right click) and you should see:

  • For this example let's create a public/ folder and a index.php file in it with the following content:
    header("Content-Type: text/plain");
    echo "Hi, I'm your newborn PHP project";
    • Add a virtual host in apache. Edit /Applications/MAMP/conf/apache/httpd.conf & uncomment the line:   
    # Virtual host
    Include /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
    •  Edit /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf
      • We will use the first sample entry,
      • Change the DocumentRoot directive to point to the public folder of this project.
      • Also change port 80 to 8888
    NameVirtualHost *:8888
    <VirtualHost *:8888>
        DocumentRoot "/Users/myuser/Workspace/PHPProject/"
        ErrorLog "logs/"
        CustomLog "logs/" common
    </VirtualHost> localhost
      • Verify it works
    $ ping
    PING ( 56 data bytes
    64 bytes from icmp_seq=0 ttl=64 time=0.063 ms
    64 bytes from icmp_seq=1 ttl=64 time=0.022 ms
    64 bytes from icmp_seq=2 ttl=64 time=0.112 ms
    Hi, I'm your newborn PHP project
      If you're not familiar with Mercurial, this is my minimal cheatsheat.

      This is our first version of this application. We commit it to the Mercurial repository: Right click, Team, Commit...


        • Uncomment at the end of the php.ini (see its location in the phpInfo page), plus add the line below to enable "remote" (Apache) debugging
        xdebug.remote_enable = On
        • Restart MAMP, refresh phpInfo page and verify that now an xdebug section appears.
        • Aptana:

          • Aptana:
            • Window -> Open Perspective -> Debug
            • Bug Icon, Debug preferences, New_configuration
            • Set PHP server:

            •  Set the starting PHP script index.php, unset "Auto Generate" and empty the field at right

          We are ready to debug our "application". Press the "Debug" button and a new browser window should popup showing our magnificent message:

          Now we can set a breakpoint, and debug again; execution should stop at the breakpoint (browser window waiting) and should finish by pressing F5.

          The easy way to convert XML into PDF

          J4L FO Designer is a productivity tool that helps you to convert XML files into PDF by using Apache FOP, the open and free implementation of the XLS-FO standard.

          As a productivity tool, our product intends to save you a significant amount of your time, and spare you the difficulties of a manual process. As explained in my previous post “How to create PDF files from XML with Apache-FOP”, XSL-FO and Apache-FOP provide a free and standard way to create PDF files in a language independent manner.

          But there are a number of disadvantages with that approach, e.g.:

          • you have to learn XSL-FO (and therefore also XPath and XSL).
          • even if you know XSL-FO you do not want to be writing FO templates using a text editor.
          • there is some logic that cannot be easily defined using XSL-FO. For example, grouping of data requires you to use the so called Muenchian method , which isn't straightforward to understand.

          In order to overcome these drawbacks, at J4L Components we have developed J4L FO Designer. The designer is a Visual (WYSIWYG) editor that will generate XSL-FO files for you. This makes the start into the XSL-FO world very easy, and it is also a useful tool for experienced developers since you can create and test XSL-FO files very quickly.

          Additionally, it will also implement the algorithms for data grouping and running subtotals. Even though the tool has been created and tested for Apache FOP, the generated XSL-FO files would work with other FOP implementations.

          Last but not least, we have added additional features to the FOP server (this is outside the standard) such as digital signatures and creation of PDF interactive forms.

          You can download the evaluation version here.


          In the previous post we have seen how to create a "Hello World" PDF file by using XSL-FO files. The following instructions explain how the same PDF file can be created using J4L FO Designer:

          1) We use the same persons.xml file:

          <?xml version="1.0"?>





          2) Open the designer, select the "Test Data" section on top of the left column and load persons.xml

          the content of the file will be shown in the tool

          3) We will now create an XML schema. In the XML schema you will see the structure of your file. Select the "XML Schema" section on the left column then use also the persons.xml file to create it on the fly.
          4) In the next step we associate the detail section to the /persons/person node, so we will get one line for each person. Click on the Detail area header, then set XML node property to /persons/person.
          5) As last step we add a field in the detail area. Click on the "Aa" button on top to select the field tool, then click somewhere in the detail area to add the field there. Finally we set the Xpath property. In this example we use the concat function to concatenate the text ‘Hello’ and the name of the current person (this could also be done with two separate fields):
          6) Click on the PDF button
          and the report.pdf file will be created.

          Usar Gmail para cuentas de correo que no son de Google.

          Este procedimiento sirve para cuando tenemos una cuenta de Gmail y queremos usar Gmail como servicio para gestionar otras cuentas que no son de Google, sin tener que decir a nuestros contactos que hemos cambiado de correo. Es decir para nuestros contactos no cambia nada: siguen usando nuestra dirección de correo que conocen. Para nosotros cambia que usamos el servicio de Gmail para gestionar este correo y, aunque sigue activo, ya no necesitamos usar el servicio del proveedor original.

          Repitiendo este procedimiento se pueden integrar varias cuentas externas en una ÚNICA cuenta gratuita de Gmail. También se puede repetir usando varias cuentas independientes de Gmail gratuito. Si se desea un servicio unificado para la gestión de diversas cuentas de una organización con Gmail, deberá contratarse el servicio de pago "Google Apps".


          1. Tener una cuenta de Gmail
          2. Tener otra cuenta de correo que queremos utilizar con Gmail (cuenta externa)
          3. Que la cuenta de correo externa admita redirección o reenvío automático de todos los mensajes recibidos
          4. Disponer de los datos conexión SMTP segura (TLS ó SSL) que funcione con esta cuenta (servidor, puerto, usuario, contraseña)


            1. Obtener los datos de conexión de nuestra cuenta externa y averigüar cómo activar la redirección de correos entrantes. Esto puede estar disponible a través de un panel de control o bien tendremos que contactar con nuestro proveedor.

            2. En nuestra cuenta de Gmail realizaremos los siguientes pasos:
              • Entrar en la configuración de la cuenta

              • Clic en Cuentas y en el apartado "Enviar mensaje como" , clicar en Añadir otra dirección de correo tuya

              • En la ventana emergente introducir:
                • Nombre del remitente que se desea usar al enviar mensajes con la cuenta externa
                • La cuenta de correo externa
                • IMPORTANTE: desmarcar la casilla "tratar como un alias"
                • Clicar en botón "paso siguiente"
                • "Enviar el correo a través de tu servidor SMTP
                    • Introducir los datos correspondientes y clicar el botón "Añadir cuenta".
                    • En caso de problemas comprobar que los datos son correctos / consultar el proveedor de nuestro correo.

                  • Verificar tu dirección de correo electrónico
                    • Clicar en botón "Enviar Verificación"
                  • Espera a que te llegue el correo de verificación e introduce el código.
                  • Se cierra la ventana y se actualiza la página de configuración con la nueva cuenta externa añadida. Haz clic ahora en el enlace correspondiente "establecer como predeterminada" junto a la cuenta que acabas de añadir. 
                  • Resultado final:
                • A partir de este momento, al redactar un correo nuevo aparecerá tu cuenta externa como remitente en vez de la de Gmail. Si en algún caso quieres usar la de Gmail podrás desplegar el campo del remitente y elegirla.
                • Activar la redirección de nuestro correo externo al correo de gmail

                • Comprobar con otra cuenta que el envío y recepción funcionan correctamente: enviar un correo desde gmail, comprobar que se recibe con el remitente correcto, responderlo y comprobar que la respuesta llega a nuestra cuenta de gmail

                New J4L FOP Server professional edition - run as a Windows service

                We have a new product, an improvement over the free FOP server, an optional companion product to J4L FO Designer.

                The main new feature is that it can be run as a Windows service, and therefore is more suitable for production environments. As a commercial product it also includes 6 months support.

                Relevant links:
                J4L FOP Server
                J4L FOP Server versions
                J4L FO Designer
                Purchase J4L FO Designer / J4L FOP Server Professional

                How to create PDF files from XML using Apache-FOP


                Nowadays, XML is the native format of many applications, Oracle APEX for example, partly bases its reporting systen on XML. Middleware as Oracle BPEL, SAP PI, IBM Websphere and of course many Web services are also XML based. XML is also being used as exchange format in business to business transactions, for example for e-Invoicing. In these and many other environments there is often the need to create PDF files from XML.


                In the past PDF files would be created using proprietary reporting tools that would use a database as data source. Additionally these tools are programming language specific. Later on the XSL-FO standard allowed for a better way to do it in many cases.

                What is new about XSL-FO?
                - it is programming language neutral.
                - it is a standard so you are not tied to a vendor.
                - it uses XML as data source.

                Apache FOP

                One implementation of the XSL-FO standard is Apache FOP. One important aspect about this implementation is that the Apache license model allows to use it in commercial environment.

                Many free/open source products have a license model that puts strong restrictions on the way you may use the software. Not surprisingly there are software companies that do not allow the use in their code any open source software other than Apache Foundation one. So if you use Apache you know you are on the safe side.


                Once you have installed Apache-FO, let's see how we can create a very simple PDF file. Initially we will use the file for this. The output will contain the lines “Hello John” and “Hello Mary”. It is not the the aim of this article to present XSL-FO language in detail, there is a good tutorial here,  but you can see the hight level structure is made of the document layout (red lines) and the page content (blue lines). 


                <?xml version="1.0" encoding="UTF-8"?> 
                <fo:root xmlns:fo=""> 

                <fo:simple-page-master margin-right="2cm" margin-left="2cm" margin-bottom="1cm" margin-top="0.5cm" font-family="sans-serif" page-width="21cm" page-height="29.7cm" master-name="main">

                <fo:region-body margin-bottom="1cm" margin-top="4.0cm"/>
                <fo:region-before extent="1.5cm"/>


                <fo:page-sequence master-reference="main">
                <fo:flow flow-name="xsl-region-body">
                <fo:block>Hello John</fo:block>
                <fo:block>Hello Mary</fo:block>




                Using Apache FOP command line utility you can convert this file to PDF. For instance:

                fop hello.pdf

                You could automatically create the file by different means, however the recommended way to create this file is by putting the data (persons’ names) in a XML file like for example this one:

                File persons.xml:

                <?xml version="1.0"?>





                ...and then creating a XSLT (XSL transformation) which takes the XML data as input and composes the file.

                File hello.xsl:

                <?xml version="1.0" encoding="iso-8859-1"?>

                <xsl:stylesheet version="1.0" xmlns:fo="" xmlns:xsl="">

                <!-- Page layout information -->

                <xsl:template match="/">
                <fo:root xmlns:fo="">

                <fo:simple-page-master master-name="main" page-height="29.7cm" page-width="21cm" font-family="sans-serif" margin-top="0.5cm" margin-bottom="1cm" margin-left="2cm" margin-right="2cm">
                <fo:region-body margin-top="4.0cm" margin-bottom="1cm" />
                <fo:region-before extent="1.5cm" />


                <fo:page-sequence master-reference="main">
                <fo:flow flow-name="xsl-region-body" >
                <xsl:apply-templates select="persons/person" />



                <xsl:template match="persons/person">

                Hello <xsl:value-of select="name" />




                With these two files, the Apache FOP command to create the PDF file would be:

                fop -xml persons.xml -xsl hello.xsl -pdf hello.pdf

                This command is performing 2 steps in one call:

                • Processing the XSLT to create the FO file
                • Creating the PDF from the FO file

                As we have seen, if your data native format is XML, you can create user friendly PDF files with no programming. This is vendor independent and it is being used today in many situations and products.

                With this procedure you are however involved with XSLT and XSL-FO languages and files, which you may prefer to avoid learning and mastering. If that is your case you may be interested in my related post The easy way to convert XML into PDF.

                J4L Barcodes 1D for Ruby

                I was intrigued about all the buzz around the Rails framework and the Ruby language, so I thought it was the time to check it out by myself and start by learning Ruby. So, as I usually do, I assigned myself some specific learning task: in this case porting the J4L barcoding software from PHP (which in turn was ported from Java).

                Here's the result
                (only 1D barcodes at the moment)

                From a commercial point of view, I wonder if this product will work well because there are already some open source solutions, most notably Barby, and the Ruby community appears to be very focused on open source and have do-it-yourself attitude.

                If you're a Rubist and have considered to use this product and/or some other alternative, I'd appreciate your thoughts. These are the advantages that I think this product offers, compared to Barby:

                • Most importantly, you don't need to struggle to make this component work: it should work out of the box and if it doesn't you will have direct support from me.
                • Low non-Ruby requirements: only the GD libray
                • More complete feature set:
                  • More supported symbologies
                  • It generates not only the barcode itself but also the "human readable interpretation", this is, the text/code in plan ASCII characters below (or above) the bars.
                  • You can specify: bar measures, margins, colors, and other parameters for the graphic output.
                  • Better support of the symbologies characteristics.
                    • For instance length optimization: in Code 128 (and GS1-128) it will select the appropiate code set (A, B or C) and switch between them in order generate the shortest possible symbol, depending on the data to be encoded. In Barby you have to pre-select a code set that will be used for all the data.
                    • Or in GS1-128, J4L Barcodes will recognize the "Application Identifiers" and interpret the data accoding to their length as per specification. E.g. "11654321" will show as "(11)654321", this is A.I. 11, data 654321.

                Money transfer adventure

                During 2010 I worked mostly on this this project. J.M.E., the web designer, and I worked with Iker Marcaide to develop the first version of the international money transfer web application, which was launched around June, just in time to win the "HiT Barcelona global technological innovation summit". 

                As clients started requesting transfers we refined the user interface until October, moment at which the result was compelling enough for investors to pour into the project its first million dollar funding.

                Until this point the service was a generic person-to-person money transfer service. With the new investment and subsequent hiring of the first group of employees, the business focus specialized on tuition payments, and a new application was started with a very different workflow.

                This initial web application was developed using the Zend Framework.

                It was very exciting to participate in this project and contribute to its early success!