Sometimes we need to deal with heavy images that could make page load to slow down. This PHP script will help you to easily process and scale down all images in a directory and its sub directories recursively. The script can very easily be ported to any PHP framework just inserting the functions in a class and calling them as showed here:

Once you have up and running Vagrant and VirtualBox in your machine you need to follow these steps to create a VM and install all necessary dependencies to run PHP Projects.


 vagrant vm

Step 1. Go to the Directory where you have the Vagrantfile and then execute

$ vagrant suspend

 this will stop the VM if it is running.

Here's a comprehensive cheat sheet of Docker commands along with an example of each one. If you need more details on a particular command, just type the command and --help.

 docker commands


docker version

Display the Docker client and server versions.

$ docker version


docker info

Display system-wide information about Docker.

$ docker info

DOM (Document Object Model) manipulation with jQuery allows you to easily interact with and modify HTML elements on a webpage. jQuery simplifies these tasks by providing a convenient and efficient way to select elements and perform various operations on them. To get started, make sure you have included the jQuery library in your HTML file.


You can do this by including the following script tag in the <head> section or just before the closing <body> tag

<script src=""></script>


Selecting Elements

To manipulate elements, we need to select them first. jQuery offers powerful selectors similar to CSS selectors.


<div id="example">
  <p>Hello, World!</p>
  <p>How are you today?</p>


// Selecting by tag name
var paragraphs = $('p');

// Selecting by ID
var exampleDiv = $('#example');

// Selecting by class
var someClassElements = $('.some-class');

// Selecting by attribute
var inputElements = $('[type="text"]');


Modifying Element Content

You can change the content of HTML elements using jQuery.


<p id="my-paragraph">This is some text.</p>