This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function computeValidityPeriod($period) | |
{ | |
return date('Y-m-d-H:i:s', strtotime("+$period min")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paypal checkout express, payment type settings for Paypal or Credit Card | |
if ($paymentMethod == 'paypal') { | |
$nvpstr .= "&LANDINGPAGE=Login"; | |
$nvpstr .= "&SOLUTIONTYPE=Mark"; | |
} else { | |
$nvpstr .= "&LANDINGPAGE=Billing"; | |
$nvpstr .= "&SOLUTIONTYPE=Sole"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function randomPassword($length = 6) { | |
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; | |
$password = substr( str_shuffle( $chars ), 0, $length ); | |
return $password; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to install Laravel in Ubuntu 16.04 | |
## basic stuff install (optional) | |
sudo apt-get install git | |
sudo apt-get install zip | |
## LAMP | |
sudo apt-get install tasksel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
// Generates a strong password of N length containing at least one lower case letter, | |
// one uppercase letter, one digit, and one special character. The remaining characters | |
// in the password are chosen at random from those four sets. | |
// | |
// The available characters in each set are user friendly - there are no ambiguous | |
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option, | |
// makes it much easier for users to manually type or speak their passwords. | |
// | |
// Note: the $add_dashes option will increase the length of the password by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$.pluginName = function(element, options) { | |
var defaults = { | |
foo: 'bar', | |
onFoo: function() {} | |
} | |
var plugin = this; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
|---------------------------------------------- | |
| ReadMore Jquery Plugin | |
|---------------------------------------------- | |
| | |
| Created by Cuong Huynh | |
| | |
*/ | |
(function($) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace App\Support; | |
abstract class AbstractValidator | |
{ | |
protected $errors; | |
/** | |
* handle checking data is valid | |
* @return boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Validators; | |
use App\Support\AbstractValidator; | |
class CreateItemDataValidator extends AbstractValidator | |
{ | |
/** | |
* handle checking data is valid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Validators; | |
class ValidationException extends \Exception | |
{ | |
public function __construct($message, $errors, $code = 0, \Exception $previous = null) | |
{ | |
$this->errors = $errros; |
OlderNewer