When will you release the next version/software?

In the software world no one knows the software release or update date in advance, maybe two weeks maybe two months, maybe more...

Continue reading

How to check if an email from an educational institution?

This PHP snippet (function) allows you to check if an email address from an educational institution.


<?php
/**
 * @title          Check if it is a valid and university email address.
 *
 * @param          string $sEmail
 * @return         boolean
 */
function isUniversityEmail($sEmail)
{
    return preg_match('/^[a-z0-9_\-]+(\.[_a-z0-9\-]+)*@([_a-z0-9\-]+\.)+edu$/i', $sEmail);
}
?>

Example of usage:


if (!isUniversityEmail('you@post.harvard.edu'))
    exit('You must have a valid and .edu email address to register for an account.');

Good code! ;-)

Continue reading

How to check if Apache's mod_rewrite is installed? | PHP Snippet

Hi everyone!

This is a snippet (function) that lets you know if the mod_rewrite of Apache is installed on a Web server.


<?php
/**
 * Check if Apache's mod_rewrite is installed.
 * 
 * @return boolean
 */
function isRewriteMod()
{
    if (function_exists('apache_get_modules'))
    {
        $aMods = apache_get_modules();
        $bIsRewrite = in_array('mod_rewrite', $aMods);
    }
    else
    {
        $bIsRewrite = (strtolower(getenv('HTTP_MOD_REWRITE')) == 'on');
    }

    return $bIsRewrite;
}
?>

How to use this?

Very simple, just look this example below:


if (!isRewriteMod()) exit('Please install Apache mod_rewrite module.');

Good code! ;-)

Continue reading

Get the favicon of a website | PHP Script Snippet

Here's a little feature that allows you to easily retrieve the favicon of a URL


<?php
/**
 * Get favicon from a URL.
 * 
 * @param string $sUrl
 * @return string The favicon image.
 */
function get_favicon($sUrl)
{
	$sApiUrl = 'http://www.google.com/s2/favicons?domain=';
	$sDomainName = get_domain($sUrl);
	
	return $sApiUrl . $sDomainName;
}

/**
 * Get domain name from a URL (helper function).
 * 
 * @param string $sUrl
 * @return string $sUrl Returns the URL to lower case and without the www. if present in the URL.
 */
function get_domain($sUrl)
{
        $sUrl = str_ireplace('www.', '', $sUrl);
        $sHost = parse_url($sUrl, PHP_URL_HOST);
        return $sHost;
}
?>

How to use this


<a href="http://www.php.net/manual ...

Continue reading

Easily generate documentation of your projects with JavaScript YUIDoc

YUIDoc is one of the best solutions to easily generate documentation for your projects JavaScript.

The syntax is nice and clear and allows easily documenting your JavaScript files.

Here is a small example to document a method of a JavaScript class (code taken from the YUIDoc website).


/**
* My method description. Like other pieces of your comment blocks,
* this can span multiple lines.
*
* @method methodName
* @param {String} foo Argument 1
* @param {Object} config A config object
* @param {String} config.name The name on the config object
* @param {Function} config.callback A callback function on the config object
* @param {Boolean} [extra=false ...

Continue reading

Server: That means "LFD" and "CSF" in cPanel

When you or your hosting company uses cPanel or another Web hosting control panel, you often hear unfamiliar abbreviations, here are two most popular abbreviation:

  • LFD = Login Failure Daemon
  • CSF = Config Server Firewal

Continue reading

Photobooth.js : New JavaScript framework to use the webcam with HTML5

Photobooth.js : New JavaScript framework to use the webcam with HTML5

Photobooth is a new JavaScript framework to integrate in a website fairly easily making a webcam photo exploiting the latest HTML5 API "WebRTC" W3C.

Sites: Photobooth.js website | Demo | Repository

Continue reading

Check your Internet connection | PHP Script Snippet

To check if your Internet connection is enabled, a simple solution is this function:


<?php
/**
 * Check Internet Connection.
 * 
 * @param string $sCheckHost Default: http://www.google.com
 * @return boolean
 */
function check_internet_connection($sCheckHost = 'http://www.google.com') 
{
    return (bool) @fopen($sCheckHost, 'r');
}
?>

A function is a little more advanced:


<?php
/**
 * Check Internet Connection.
 * 
 * @param string $sCheckHost Default: www.google.com
 * @return boolean
 */
function check_internet_connection($sCheckHost = 'www.google.com') 
{
    return (bool) @fsockopen($sCheckHost, 80, $iErrno, $sErrStr, 5);
}
?>

Example of use:


<?php
$bIsConnected = check_internet_connection();
$sText = ($bIsConnected) ? '<p style="color:green">You are currently connected to the Internet.</p>' : '<p style="color:red">You are ...

Continue reading

Deleted comments

Hello to all!

Following a large number of spam via the commenting system, we decided to remove all the blog comments (3028 comments in total).

We are very sorry for contributions from you and we make every effort to ensure that this occurs more inconvenience.

Again thank you for your opinion by comment, it makes us very happy and do not hesitate to post your comments again;)

Continue reading

Install MySQL database server

Install MySQL server

1) Download the latest version of MySQL on this page:
http://dev.mysql.com/downloads/mysql/
and unzip the archive, then you put in the folder.

2) Install MySQL with the following commands in your terminal:

./configure --prefix=/usr/local/mysql
make
sudo make install

3) Change permissions if necessary (MySQL Directory and database).

4) Check if the MySQL installation was successful by typing this command
mysql -V
You should get a message similar to this one:

mysql  Ver 14.14 Distrib 5.5.28, for Linux (x86_64) using readline 5.1

5) Add a password for ...

Continue reading