Working with combined expressions in WHERE clauses in Laravel 4

When retrieving records from tables in our database, you often have to write combined expressions in WHERE clauses like [sourcecode language=”sql”] SELECT * FROM users WHERE status=1 AND (fname = ‘John’ OR lname=’Doe’) [/sourcecode] The query above is pulling out all users who’s status is set to 1, and fname is equal to ‘John’ or … Continue reading Working with combined expressions in WHERE clauses in Laravel 4

How to enable some useful text formatting options in TinyMCE in WordPress

Most of the time default TinyMCE editor in WordPress is pretty adequate for everyday text formatting. However, there are a lot of extra formatting options which are hidden out of the box. Enabling these options will give you extra formatting features that will be useful for many of us. In this article, I will show … Continue reading How to enable some useful text formatting options in TinyMCE in WordPress

How to enqueue javascript files properly in the WordPress admin panel

You’d probably have answered the question already, won’t you? We all know that the correct answer is to do that we have to write a function that hooks the “admin_enqueue_scripts” and inside that function we will have to load the script via wp_enqueue_scripts() function. That’s the correct answer, but when it comes to the best … Continue reading How to enqueue javascript files properly in the WordPress admin panel

Upgrading PHP to 5.5 in a CentOS 6 server with Vesta CP

Vesta CP comes with PHP 5.4 by default. If you want to upgrade it to 5.5, follow these steps 1. Stop Apache and Remove current PHP [sourcecode language=”shell”] service httpd stop yum -y remove php [/sourcecode] 2. Add remi repository [sourcecode language=”shell”] #For 32 Bit OS wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm #For … Continue reading Upgrading PHP to 5.5 in a CentOS 6 server with Vesta CP