Blog
- Details
- Written by R. Elizondo
- Category: PHP Software Development
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:
- Details
- Written by R. Elizondo
- Category: Virtualization
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.
Prerequisites:
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.
Read more: Vagrant Virtual Machine with CentOS 7, Nginx, MariaDb, NodeJs and PHP 8
- Details
- Written by R. Elizondo
- Category: Cheat Sheets
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 version
Display the Docker client and server versions.
$ docker version
docker info
Display system-wide information about Docker.
$ docker info
- Details
- Written by R. Elizondo
- Category: jQuery
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="https://code.jquery.com/jquery-3.6.0.min.js"></script>
Selecting Elements
To manipulate elements, we need to select them first. jQuery offers powerful selectors similar to CSS selectors.
HTML
<div id="example">
<p>Hello, World!</p>
<p>How are you today?</p>
</div>
jQuery
// 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.
HTML
<p id="my-paragraph">This is some text.</p>
jQuery
Page 1 of 43