/Blog

Set up OAuth2 server using Laravel Passport

Laravel is one of my favorite frameworks, not because it is the best but it provides far better developer experience compared to any other frameworks. Laravel 5.3 comes with a handful of new features like Passport, Scout, Notifications, etc. that...

Knapsack - Collection Pipeline for Fun and Profit!

PHP has this powerful data structure called array, which we can use to handle any collection of data. We can then traverse them using for or foreach and process the data. The introduction of Closures in PHP 5.3 made the collection processing a bit...

Export selected rows from MySQL table

As a programmer or system admin, taking database backup is an inevitable task that we have to do. mysqldump is the de-facto tool for exporting data from MySQL server. It allows us to easily export databases or selected tables very easily. For...

Stress-free refactoring with Scientist

I love refactoring. It is highly risky and challenging as I might break the production system and loose business. At the same time, it's a rewarding experience to improve the code which is less performing or buggy. For the past couple of months, I...

Setting up Let's Encrypt SSL in Ubuntu 14.04 with Nginx

Or in other words, Zero to SSL in three minutes I was really excited about the Let's Encrypt free ssl service since their first announcement. But I never tried to install it, mainly as I found the documentation a bit difficult to follow. Today,...

Installing PHP 7 on Mac using Homebrew

Here is a quick way to install PHP7 on Mac, in three easy steps. brew update brew install homebrew/php/php70 export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH" Alternatively you can add export PATH="$(brew --prefix...

Automatic construction injection in Slim 3

In the previous blog post we have discussed how to replace the default Pimple Container with Aura.DI in Slim framework 3. Aura.DI gives us more flexibility in terms of managing dependencies. We saw one most useful feature in Aura.DI, Inheritance of...

Slim 3: Replacing Pimple with Aura.Di

Slim framework is my go-to micro framework for all small projects because of it's simplicity and easiness to use. The new version of this cool framework is just around the corner and they have released RC-1 a few days back. Slim 3 have some very...

HaPHPy 20th Birthday PHP!

Today is the 20th birthday of PHP. Rasmus Lerdorf announced first version of PHP on 8th June 1995. It's been an amazing journey since then. Now as a language that powers 80% of the web, including most popular websites like Facebook, Wikipedia, etc....

Human friendly date-time formatting for Symfony and Twig

KnpLabs/KnpTimeBundle is a really simple Bundle which converts date time strings to human friendly "ago" dates with support to many languages out of the box. Here is how you can use it in your Symfony projects. First things first. Before you use...