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
#laravel | |
alias pa="php artisan" | |
#git | |
alias gi="git init" | |
alias gs="git status" | |
alias ga="git add" | |
alias gc="git commit -m" | |
alias gac="git add .;git commit -m" | |
alias gp="git push" |
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\Http\Controllers; | |
use Illuminate\Foundation\Bus\DispatchesJobs; | |
use Illuminate\Routing\Controller as BaseController; | |
use Illuminate\Foundation\Validation\ValidatesRequests; | |
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; | |
use Illuminate\Validation\Validator; |
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 | |
if (!function_exists('abbrv')) { | |
function abbrv($value) | |
{ | |
$removeNonAlphanumeric = preg_replace("/[^A-Za-z0-9 ]/", '', $value); | |
$removeVowels = str_replace( | |
['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', ' '], | |
'', | |
$removeNonAlphanumeric); |
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
[ | |
{ | |
"name": "New Years Day", | |
"date": "01/01/2017", | |
"states": [ | |
"Kuala Lumpur", | |
"Labuan", | |
"Malacca", | |
"Negeri Sembilan", | |
"Pahang", |
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 | |
/** | |
* I use abbrv() function in https://gist.github.com/nasrulhazim/df8f4046cceb37ab61fa5d5c0c65dba6 | |
* And for str_random() from Laravel Framework | |
**/ | |
if (!function_exists('generate_reference_number')) { | |
function generate_reference_number($module_label, $module_component = null) | |
{ | |
if (empty($module_label)) { |
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 | |
/** | |
* Created by PhpStorm. | |
* User: hafiq | |
* Date: 21/04/2019 | |
* Time: 7:17 PM | |
*/ | |
namespace App\Http\Traits; |
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 | |
class Fpx { | |
public $merchant_id; | |
public $prefix; | |
public $order_number; | |
public $user_email; | |
public $description; | |
public $amount; | |
public $exchange_id; |
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 | |
/** | |
* Created by PhpStorm. | |
* User: hafiq | |
* Date: 28/02/2018 | |
* Time: 9:30 AM | |
*/ | |
namespace App\Library; |
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\Http\Middleware; | |
use Closure; | |
class MinifyHtml | |
{ | |
/** | |
* Handle an incoming request. |
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
var ic = '090303086521'; | |
if(ic.match(/^(\d{2})(\d{2})(\d{2})-?\d{2}-?\d{4}$/)) { | |
var year = RegExp.$1; | |
var month = RegExp.$2; | |
var day = RegExp.$3; | |
console.log(year, month, day); | |
var now = new Date().getFullYear().toString(); |
OlderNewer