Let’s stop creating alcoholics in PHP

Note: I am referring to the PHP world because this is what I know. Based on comments I received from readers, it appears it is a general problem in other IT communities.

You may already have guessed what this post is about, I am sure there will be lots of people that will disagree with it, but I am in need to share this.

PHP and alcohol (and more specifically beer) are almost synonyms. Lots of PHP developers love beer. And it has become a very common practice to have beer (lots) at PHP events, user groups, conferences, etc.

But don’t get it wrong, they love to drink high quality beer as someone would love to drink a very fine wine or whisky. They do it carefully. Many of them actually brew their own beer as a craft, a hobby. They don’t drink to get drunk.

I like beer, I don’t love it, but I enjoy one or two when I am at a conference. I like wine more. And I have drank more than I should have more than once. Usually I realize this the day after. But I don’t enjoy getting drunk.

Unfortunately, not everybody has a strong self-control, and many times, they end up drunk, and you know, when people are drunk, bad things may happen.

When people get drunk, the most minor thing that may happen is that they will make a fool of themselves, sometimes without even realizing it. Everybody laugh and have a good time. But the borderline between this harmless fun and a bad moment is blurry and very thin, and very subjective to the moment. And if this happens frequently, they will be known and the fun person that drinks a lot, would that be a good thing?

Already we had instances where things went south. Someone says the improper thing, and it may ruin the whole conference experience for one or more people. If this is your first time at one of these events, you may not come back again. But even if you are a “pro” of the conference circuit, you will remember this one time episode forever. As a conference organizer, this is a nightmare come true.

Then you have the people that don’t drink, for whatever reason. Not everybody likes alcohol. They don’t like the taste, they don’t like the feeling, they know people had issues with it, they are trying to stay in shape, it does not go along with their religion, etc. If a conference is promoting drinks, these people may feel excluded.

We are not in the drinks industry, we are professional developers, we have an obligation to produce high quality work for our employers or customers. So heavily promoting alcohol in events feels wrong.

I go to a lot of conferences. I love going to them. I love being part of the PHP community, meeting new people, hanging out with all the friends I have made over the years. And a lot of the fun activities outside the talks take place in a bar or around drinks.

Recently I started hearing about, or seeing episodes where people have problems due to alcohol. Some are aware of the issues, and are speaking out and asking for help. They should be commended. And some don’t realize what is happening. This may lead to alcoholism if not addressed on time.

I think it is time we stop encouraging people to drink at conferences. As mature individuals we should be able to enjoy one or two drinks. But we need to have limits. We need to put more emphasis on promoting healthier activities and lifestyles. As the PHP community matures, like it or not, we, the individuals that make this community, are getting older, fatter, less healthier. Alcohol does not help. Due to our work, we spend lots of time on a chair. We should be promoting walks, running, sports, etc.

Let’s stop creating alcoholics before it becomes a problem and something serious happens. If it does, we will be partially responsible.

Checkout this post by @dcousineau on how to conference organizers can try to be more inclusive to non-drinkers and still allow everyone to have a good time.

Posted in PHP Tagged with: ,

Symfony Live 2014 NYC recap

sflive_nycLast week I had the honor and privilege of speaking at Symfony Live 2014 in New York City. This was my second opportunity to speak in Symfony Live in the US (last year was in Portland when Symfony Live shared the venue with DrupalCon).

The conference was a single track and I was scheduled to speak at the first day, first slot right after Fabien’s keynote. No pressure. The room was quite full, about 90% so I estimate between 100 and 150 attendees.

Fabien’s keynote was informative, speaking about the Symfony 2.6 upcoming release, and giving hints of what to expect for Symfony 3. For the first time, it was mentioned that the target release date will be November of 2015, probably around the 2015 edition of SymfonyCon. Now, don’t get too excited. With the main focus on avoiding backwards compatibility unless really needed, don’t expect anything as revolutionary as Symfony2 when it was announced back in 2012. He also introduced the new Best Practices document which has made the rounds of Twitter early this week.

My talk followed and in my opinion went quite well. I have given this presentation in previous conferences, but for this occasion I included quite a few updates. But I was a bit concerned with the fact that the slot was only of 40 minutes. This is 10 or 20 minutes less than other conferences, so I had to trim some fat and make sure I stayed on track. I think the result was very good. And the confirmation is that today I received the news that I will be giving this talk in SymfonyCon in Madrid, Spain!

Before the lunch break, Kris Wallsmith presented “The view from inside” where he shared his experience of going through an accelerator/incubator program while building a startup and mobile app. It was full of stories and reflections that many of us are or have shared. Something that stuck with me was a a quote that went something like “while building this company, you will lose your friends, your wife, etc”. Having gone through a startup and successful business, I can assure you this is very true. I have not lost my wife, but many times it’s been quite close, and without her endless patience, it would surely happened.

Brent Shaffer gave a great talk about building APIs with Symfony and Jeremy Mikola presented “Developing Beautiful, Measurable Software” where he shared tips on how to make sure our code quality stays in check as the application grows.

To close the first day of talks, we had a set of lightning talks. Most of the sponsors got an opportunity to share their products, but of course we got a chance to have Jeremy Mikola on stage for his lightning talk about lightning which never gets old, in fact, every time I see it there is something new. Remarkable!

After the conference, a bunch of us headed to have a quick bite before heading to the official bar for the Cocktail party. It was quite crowded and loud, and I was quite tired (having arrived from Europe the day before, I was still jetlagged) so I went back to the hotel.

The second day started with David Zuelke from Heroku talking about the Twelve Factor App. David is a great presenter and his talks are always fun and full of good content, and it was great to see his awesome work in action at Heroku. Before lunch, Lukas Smith shared ways to create APIs using the FOSRestBundle and friends. Even though I have been using this for a few APIs, I was able to learn of a few new bundles that have been released recently.

One of tIMG_2331he highlights of the second day was the talks from Ryan Szrama about “Solving the Hard Parts of eCommerce”. Ryan comes from the Drupal world where he is part of the team behind Drupal Commerce. His presentation style was really nice, and talked about a bunch of the hard parts, reminded me how lucky I am not having to deal with those things.

The last talk of the day was by Ryan Weaver where he shared his views about helping developers get more productive through the The Developer Experience (DX) Initiative that he has spearheaded.  Ryan is one of my favorite speakers and it was a great way to close the conference. He even got his shoes off before getting started.

The last activity of the day was the Karaoke party nearby which unfortunately I could not attend.

I think it was a great conference. I had the opportunity to meet a bunch of new people, while going back to New York, one of the coolest cities in the world. Looking forward to SymfonyCon Madrid in November, not too long ahead.

Posted in Symfony Tagged with: , ,

Creating PHAR files with Box

PHAR files are the “executable”‘s of the PHP world. It allows you to create a package of your application for easy delivery. The most popular projects providing PHAR files are PHPUnit and Composer, but there are many more, and if you have a project that contains command line tools, you should too.

The process boils down to a few basic steps:

  • create a PHAR compiler
  • collect all files that need to be packaged
  • produce PHAR file and sign it

The Box project provides an easy way of creating a PHAR file for your project. Installation is simple:

curl -LSs http://box-project.org/installer.php | php

I like putting all phar and other custom commands that I use regularly in my ~/bin directory. If you do so, make sure you add the directory to your PATH environment variable:

# edit .bash_profile or .profile
export PATH=~/bin:$PATH

Then, create a box.json file which will be used to configure box and create your PHAR file. The content could be something like this:

{
    "directories": ["src"],
    "finder": [
        {
            "name": "*.php",
            "exclude": ["Tests", "tests"],
            "in": "vendor"
        }
    ],
    "main": "bin/command",
    "output": "your.phar",
    "stub": true
}

This configuration will create a file named your.phar, and will run bin/command when it is executed. It will include in it all files inside the directories src and vendor (except Tests).

Once you are done with this, run the build command:

box build -v

Compiling a PHAR with box

Posted in PHP Tagged with: ,

Copy SSH keys for easy and quick access to servers

SSH keys are great. It allows you to login to servers and SSH-based serveices without using passwords.

Before using SSH keys, you need to create an key:

ssh-keygen -t dsa

Answer a few questions, and then you will have a new pair of keys. Now, copy the key to the remote server:

ssh-copy-id user@remote-host

If you are on OSX, you can install the utility with homebrew:

brew install ssh-copy-id

Or download it using the following command from this github repo:

curl -L https://raw.githubusercontent.com/beautifulcode/ssh-copy-id-for-OSX/master/install.sh | sh

If you are on Windows, you can use the following command (credit to Andres Gonzalez):

cat ~/.ssh/id_rsa.pub | ssh user@remote-host “mkdir ~/.ssh; cat <<; ~/.ssh/authorized_keys”

Posted in devops Tagged with: