Easy server provision for PHP environments using ServerPilot

Learn how to use a very simple and efficient service called ServerPilot for provisioning a web server to host your next PHP project or blog.

Provisioning a well-configured web server for a PHP application is not an easy task. You can have experience doing that, but this is not my strongest skill, I admit. So I’m always looking for new services and tools to make this job easier for me, and faster.

I’m a big fan of Laravel Forge and the company I run for years was (and is) a very happy Forge customer. Unfortunately, my goal, for now, was to find a place to host my blog, after some changes I’ve made in the last weeks.

I run my blog using Jekyll and GitHub Pages for years, but I was writing less then I expect. I like the WordPress platform, and mainly writing on its editor, so I decided to move back to WP. Then I create a new droplet on DigitalOcean using their LAMP box. The droplet was running well, but sometimes Apache could not handle everything well, then I needed to add an NGINX reverse-proxy to make things easier. There’s when I discovered ServerPilot.

Continue reading Easy server provision for PHP environments using ServerPilot

Invest in yourself. Be searchable!

Being really good in your field is important, but more important than that is to seem to be good. Invest in yourself. Be searchable!

How many times did you search your name on Google? How many times did you search some keywords related to you? Did you like the results you got? Can them be better? They should.

We, developers and engineers, built the Web like it is today, but sometimes we forgot how important we are, and mainly, how important we should be. This is something that – believe me – happens more than you think. We like to code for others, to create software, to make money, but we forget to invest in ourselves images, and how people think we are.

This is not about your work, this is not about your job. This is about you, your image, and how you take care of it.

Continue reading Invest in yourself. Be searchable!

Why you should contribute to open source projects

Open source can change your life. It has changed mine with Corcel, an open source project I started in 2013 that changed who I am, and how I live.

The first title I gave to this post was How open source can change your life for the better. That was a good title too, but I think the main reason I wrote this post is to encourage you to start (or continue) working and contributing to open source projects, that’s why the title changed.

You can think: “open source cannot give me any money”. The fact is: directly no, maybe a few. Contributing to (or creating) open source projects show your code to the world. And that’s the point! It’s when your life starts changing, believe me.

My life started changing in 2013, and because of open source. In that year I was running my company, an advertising agency. I was the one responsible for all the web and development fields. Actually, the company started in 2007 and I was in the heart of the development team for many years.

Continue reading Why you should contribute to open source projects

Using XDebug with PHPUnit in PHPStorm

Learn how to configure XDebug and PHPUnit in PHPStorm, allowing you to write better tests and fix bugs faster.

Test Driven Development (TDD) is an old topic, I know, but it seems many people don’t understand how it makes you write better code. The point here is that one of the most important benefits it’s to use debugging tools together with tests, making your flow more efficient.

I started using TDD on the command line, and still use it sometimes, but since I started using PHPStorm and decided to try how it handles tests, and that’s amazing! When you add debugging tools – like XDebug – to it everything starts making sense, then you have the feeling you’re on the right path.

PHPStorm has a dedicated interface to run and debug tests, almost in the same window, what makes the process of writing code safer and easier.

Continue reading Using XDebug with PHPUnit in PHPStorm

Using Ruby on Rails Ajax adapter with any project, even PHP (like Laravel)


Every project you have to make some requests using Ajax, right? I know that jQuery has done a very good job and almost all project you start it is present there, together with your Javascript files. So you can make Ajax calls any time, where you want, just making the call using Javascript.

I developed some projects using Ruby On Rails some time ago, and I start to think about using AJAX in a different way. Rails uses a custom jQuery adapter to allow you to do things like that:

link_to("Destroy", user_path(@user), method: :delete, remote: true)

Continue reading Using Ruby on Rails Ajax adapter with any project, even PHP (like Laravel)

Why WordPress is your best option for creating websites

Hi everybody!

Here I’m again to write my first post in 2015. Last year I’ve wrote less and this year I have plans to write much more, telling about my experience with web development. I have plans to start screencasting too, but this is just plans 😀

I decided to start this year writing about WordPress. Last year I thought WordPress helped me and my company to develop websites faster with a bunch of nice features, making a better job and with less time I spent before.

So, today I’m starting a series about using WordPress to create websites. First I’m going to write about why you should use WordPress to develop your next website and after how you can do that, which plugins you can use and how to use them, one by one.

Continue reading Why WordPress is your best option for creating websites

Working with Laravel 4 or 5 and WordPress together

Hi everybody!

Updated Mar 3rd 2015: Are you using Laravel 5? Check these changes!

Updated May 11th 2014: Using Corcel project

Currently I am working on a project where I had to make some choices about technologies and how work with them together. First this project will be developed using WordPress only. It’s a College Group site, where we had to work with 13 schools around the world and each one must has the control of your own content.

This could be made with WordPress, but I think when the site is not so small maybe you can use another CMS or Framework, because I particularly prefer to work with MVC. So because some decisions inside the company we decided to use WordPress Admin Panel, that is a very good, use its architecture and its database. So WordPress will be used to the application back-end, with user control, user permission, etc.

To the front-end we decided to work with Laravel. To query information from the WordPress database we’ve used the WordPress functions inside Laravel, so it’s much better to work with a MVC WordPress.

Continue reading Working with Laravel 4 or 5 and WordPress together

Generating IDs like Youtube or Bit.ly using PHP

Let’s supose you want to develop your own URL shortener, like Bit.ly for example.

You can, of course, use the ID as a integer, like, 1, 2, 3, etc. If you have 12.345 rows in your database table, you will need 5 digits, like http://example.com/12345. Large applications like Youtube, have much more entries, so, to use numbers, the URL will be very long, like http://youtube.com/watch?v=231268318276783.

Because that, these websites, like YouTube, t.co, bitly.com or even vine.co, are using a generated ID using uppercase letters, lowercase letters, digits and sometimes underscore (_) and hyphen (-). You can check that given a YouTube video URL where you will find something like http://www.youtube.com/watch?v=2Z4m4lnjxkY. You can see they’re using the “2Z4m4lnjxkY” as ID.

Continue reading Generating IDs like Youtube or Bit.ly using PHP

Managing assets with Laravel 4

Generally assets are stored in your public directory, right? They are public, so anyone can get access to them. But nowadays the performance is a very important factor when deploying a new app. I strongly recommend you to minify and cache your assets, like CSS files, Javascript files and Images.

If you are using 11 javascript files in your app you don’t have to make 11 requests on the server, one per JS files. You can easily join all files and minify them, so you will have just one minified file. This is easy to do using Laravel 4! I’ve found four Laravel 4 assets managers:

We will work with codesleeve/asset-pipeline package. It’s easy to use and simple to understand.

Continue reading Managing assets with Laravel 4

Working with PHP 5.4+ built-in server with Laravel 4

One of the best improvements of the PHP 5.4 was the built-in web server. Like in Ruby On Rails, now you do not need Apache or Nginx inside your development machine.

To start a web server is easy:

php -S localhost:8000

Continue reading Working with PHP 5.4+ built-in server with Laravel 4