Or anything else from Github.
git clone https://github.com/me/my-project.git
chown -R www-data:www-data my-project
cd my-project
composer install
/** | |
* Highlights a string in another. | |
* | |
* This methods wrap the portion of ${search} found in ${str} with a ${tag} with class ${className}. | |
* If ${search} was not found, ${str} is returned | |
* | |
* @example highlightString('Hello World !', 'world') // "Hello <span class="highlight">World</span> !" | |
* @example highlightString('Hello World !', 'foo') // "Hello World !" | |
* @example highlightString('Hello World !', 'world', 'test', 'div') // "Hello <div class="test">World</div> !" | |
* |
composer create-project --prefer-dist laravel/laravel projectname
cd projectname
CREATE PROCEDURE `MyProcedure`( | |
/*IN `in_field_a` INT, | |
IN `in_field_b` VARCHAR(255)*/ | |
) | |
BEGIN | |
/*DECLARE a_variable BOOLEAN DEFAULT TRUE; | |
DECLARE b_variable DATE DEFAULT NULL; | |
SET b_variable = NOW();*/ | |
<?php | |
// @link http://itman.in/en/how-to-get-client-ip-address-in-php/ | |
function getRealIpAddr() | |
{ | |
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet | |
{ | |
$ip=$_SERVER['HTTP_CLIENT_IP']; | |
} | |
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy | |
{ |
<?php | |
use Parsedown as ParsedownBase; | |
/** | |
* Extends [Parsedown](https://github.com/erusev/parsedown) with : | |
* - Replacement of [ ] by checkbox | |
* - Replacement of tags by other (only closing tags). | |
* Usage : | |
* $Parsedown = new Parsedown(); |
<?php | |
/** | |
* Random password generator | |
* | |
* @param int $length Desired length (optional) | |
* @param string $flag Output type (NUMERIC, ALPHANUMERIC, NO_NUMERIC, RANDOM) | |
* @return bool|string Password | |
*/ | |
function passwdGen($length = 8, $flag = 'ALPHANUMERIC') | |
{ |
#!/bin/bash | |
# dump-tables-mysql.sh | |
# Descr: Dump MySQL table data into separate SQL files for a specified database. | |
# Usage: Run without args for usage info. | |
# Author: @Trutane | |
# Ref: http://stackoverflow.com/q/3669121/138325 | |
# Notes: | |
# * Script will prompt for password for db access. | |
# * Output files are compressed and saved in the current working dir, unless DIR is |