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
// @flow | |
// LocalForage: https://github.com/localForage/localForage | |
// npm i -S localForage | |
/** | |
* @author Junaid Atari <mj.atari@gmail.com> | |
* @link https://github.com/blacksmoke26 | |
* @since 2020-08-05 | |
*/ |
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
// @flow | |
/** | |
* @author Junaid Atari | |
* @link https://github.com/blacksmoke26 | |
* @since 2020-09-20 | |
*/ | |
// npm i -S debounce |
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 | |
// Todo: Place this snippet into your Model class. | |
/** | |
* Get random model(s) from table | |
* @see \yii\db\ActiveQuey | |
* @param array|string|null (optional) $columns Columns to be fetched (default: all columns) | |
* @param array $options Additional options pass to function<br> | |
* <code> |
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 | |
$listOfTimeZones = [ | |
'Africa'=> [ | |
'Africa/Algiers'=>'Algeria (+01:00)', | |
'Africa/Gaborone'=>'Botswana (+02:00)', | |
'Africa/Douala'=>'Cameroon (+01:00)', | |
'Africa/Bangui'=>'Central African Republic (+01:00)', | |
'Africa/Ndjamena'=>'Chad (+01:00)', | |
'Africa/Kinshasa'=>'Democratic Republic of the Congo (+01:00)', |
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 | |
/** | |
* Divide an array into a desired number of split lists | |
* @author Azspot | |
* @link http://www.php.net/manual/en/function.array-chunk.php#75022 | |
* @param array $list The Array | |
* @param integer $size Partition Size | |
* @return array Output array | |
*/ |
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 | |
function rawUrlEncode ( $str ) | |
{ | |
$encoded = ''; | |
$length = mb_strlen ($str); | |
for ( $i = 0; $i < $length; $i++ ) | |
{ | |
$encoded .= '%'.wordwrap ( bin2hex( mb_substr($str,$i,1) ), 2, '%', true ); |
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 | |
/** | |
* Autoload Register the Directory's PHP Classes | |
* | |
* @author Junaid Atari <mj.atari@gmail.com> | |
* | |
* @param string Path to direcetory | |
* @param string Files extension | |
* @return bool TRUE on registered | FALSE |