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 | |
use Carbon\Carbon; | |
$targetDate = '2023-08'; | |
$today = Carbon::parse(); | |
$target = Carbon::createFromFormat('Y-m', $targetDate)->endOfMonth(); |
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\Libraries; | |
use Carbon\Carbon; | |
class DateRangeConverter | |
{ | |
public static function humanReadable($startDate, $endDate) | |
{ |
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
// 1. Given an array of [4,1,5,6], write a function that returns to me the lowest number. | |
// 2. Given an array of strings ['apple', 'banana', 'orange', 'apple'], return an object with the count of each element in the array. | |
{ 'apple': 2, 'orange': 1, 'banana': 1 }. | |
$a = [4,1,5,6] | |
sort($a) | |
$a[0] | |
$b = ['apple', 'banana', 'orange', 'apple'] | |
json_encode(array_count_values($b)) |
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 | |
// put in into .config/valet/Driver/Yii2ValetDriver.php | |
class Yii2ValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName |
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 | |
// put in into .config/valet/Driver/Yii2AdvanceValetDriver.php | |
class Yii2AdvanceValetDriver extends ValetDriver | |
{ | |
/** | |
* Determine if the driver serves the request. | |
* | |
* @param string $sitePath | |
* @param string $siteName |
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 | |
Route::redirect('admin/.env', 'url_here'); | |
Route::redirect('administrator/.env', 'url_here'); | |
Route::redirect('ads.txt', 'url_here'); | |
Route::redirect('atom.xml', 'url_here'); | |
Route::redirect('config/.env', 'url_here'); | |
Route::redirect('core/Database/.env', 'url_here'); | |
Route::redirect('core/app/.env', 'url_here'); | |
Route::redirect('cron/.env', 'url_here'); |
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
// CSS | |
/*block ui loading*/ | |
.blockui > .boxes { | |
--size: 32px; | |
--duration: 800ms; | |
height: calc(var(--size) * 2); | |
width: calc(var(--size) * 3); | |
position: relative; | |
-webkit-transform-style: preserve-3d; |
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
$data = [ | |
'AFB' => 'AFFIN BANK', | |
'ALB' => 'ALLIANCE BANK', | |
'AMB' => 'AMBANK', | |
'BMB' => 'BANK MUAMALAT', | |
'BIM' => 'BANK ISLAM MALAYSIA', | |
'BRB' => 'BANK RAKYAT', | |
'CIM' => 'CIMB BANK', | |
'NULL' => 'EON BANK BERHAD', | |
'HLB' => 'HONG LEONG BANK', |
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 | |
public static function getAll() | |
{ | |
return Cache::remember('status:all', 60, function () { | |
return Status::all(); | |
}); | |
} | |
/** |
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
table.table.table-striped.table-bordered>(thead>tr>th{head}*3)+(tbody>tr*5>td{datum}*3)+tfoot>tr>td{total}*3 |
NewerOlder