Test HTTP Requests Tools Blog PHP Quiz API Log In With Github
Test HTTP Requests Tools Blog PHP Quiz API Log In With Github
We have updated the website and our policies to make sure your privacy rights and security are respected.
Click here to learn more about the way our website handles your data.

Remove this message.

Sync Audio with text using JavaScript

Daniel Gheorghe Difficulty: 30 / 50
sound-waves

A client of mine wanted a way to highlight text on a page as audio was playing, thus helping children that had difficulties reading along. In this tutorial I will show you the solution I implemented.

The code makes use of the timeupdate event and it uses the data from the JSON to sync audio with the text.

Read Full Article...

How to mix PNG files together while preserving their transparency, using PHP and GD Library

Daniel Gheorghe Difficulty: 30 / 50

Today we're going to learn how to use the GD Library to merge 3 or more png files into one while preserving transparency

We start with 3 png files that look like the ones below and what we want to achieve is a fourth image that represents the 3 initial png files one on top of the other, while preserving their transparency.

The tricky part when mixing png files is keep the transparency or alpha levels intact. To do that you need to know that when creating an image resource in PHP you have to make it "remember" the alpha state and fill the new resource with a transparency by using the imagecolorallocatealpha() function.

Read Full Article...

Using PHP to create new subdomains, databases and email accounts on a cPanel driven server

Daniel Gheorghe Difficulty: 30 / 50
control panel button

Many hosting providers use cPanel and this tutorial comes as a helper for those of you who need to manage various server aspects with PHP. I will show you how to create new sub-domains, databases and email accounts on a cPanel driven server, from your PHP code.

Read Full Article...

Send emails with attachments using JavaScript

Daniel Gheorghe Difficulty: 15 / 50
mail-with-javascript

A few days ago a client asked me if I could send out emails with attachments using client side code only. At first I laughed, asking myself why would anyone want to do that, but then I thought: "Who cares! Whatever the client wants!". In the end I did find out that this was caused because of the hosting environment that he used which didn't allow any type of server-side code to be executed (Sooo weird!).

Read Full Article...

How to backup Ubuntu and restore it using "dd"

Daniel Gheorghe Difficulty: 20 / 50
Codepunker-dead-hard-drive

DD is a Unix and Unix-like utility that is primarily used to convert and copy files. One really useful use-case for dd is that it can "pack" entire partitions into one single image file, thus allowing users to recover entire disks by "unpacking" and restoring a file-system in case of hardware failure.

To create a full backup for a partition the command you need to run is straight-forward. The size of the resulting image file will be the same as the size of your partition so make sure you have enough free space on the drive you are placing your backup... also, please avoid placing your image file on the same drive that you're backing up.

Read Full Article...

1 2 3