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 | |
$yii = dirname(__FILE__) . '/framework/yii.php'; | |
$config = dirname(__FILE__) . '/protected/config/main.php'; | |
if (isset($_SERVER['REMOTE_ADDR']) && in_array($_SERVER['REMOTE_ADDR'], array('127.0.0.1'))) { | |
defined('YII_DEBUG') or define('YII_DEBUG', true); | |
ini_set('display_errors', 'on'); | |
error_reporting(E_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
<?php | |
// ISO 3166-1 alfa-2 | |
// Polish names of countries of the world | |
// Polskie nazwy krajów świata | |
$countries = [ | |
'AF' => 'Afganistan', | |
'AL' => 'Albania', | |
'DZ' => 'Algieria', | |
'AD' => 'Andora', | |
'AO' => 'Angola', |
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 | |
return [ | |
'Africa/Abidjan', | |
'Africa/Accra', | |
'Africa/Addis_Ababa', | |
'Africa/Algiers', | |
'Africa/Asmara', | |
'Africa/Asmera', | |
'Africa/Bamako', |
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 | |
/** | |
* CsNumberValidator class file. | |
* @copyright 2014 Paweł Bizley Brzozowski | |
*/ | |
/** | |
* CsNumberValidator is the same as CNumberValidator but allows comma instead of dot before decimals. | |
* So now 123,45 is valid number. |
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
/** | |
* Join array elements with a string. | |
* This method works with multidimensional arrays. | |
* | |
* @param string|array $glue the string for the array to be joined with or | |
* the array itself if $array is null | |
* @param array|null $array array to implode or null if array is provided as | |
* first parameter. | |
* @return string imploded array | |
* @throws \yii\base\InvalidParamException |
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 | |
$countries = [ | |
'AF' => Yii::t('app/countries', 'Afghanistan'), | |
'AL' => Yii::t('app/countries', 'Albania'), | |
'DZ' => Yii::t('app/countries', 'Algeria'), | |
'AS' => Yii::t('app/countries', 'American Samoa'), | |
'AD' => Yii::t('app/countries', 'Andorra'), | |
'AO' => Yii::t('app/countries', 'Angola'), | |
'AI' => Yii::t('app/countries', 'Anguilla'), |
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 sortByDependency($input) | |
{ | |
$output = []; | |
$checkList = []; | |
$inputCount = count($input); | |
// while not all items are resolved: |
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
let currentTime = Math.floor(Date.now() / 1000); | |
let tokenExpiration = pm.environment.get("token_expiration"); | |
if (tokenExpiration && tokenExpiration <= currentTime) { | |
let apiUrl = pm.environment.get("api_url"); | |
let refreshToken = pm.environment.get("refresh_token"); | |
if (refreshToken) { | |
pm.sendRequest( | |
{ | |
url: 'http://' + apiUrl + '/oauth/v2/token', | |
method: 'POST', |
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
version: '3.7' | |
services: | |
reverse-proxy: | |
restart: always | |
networks: | |
- dev | |
container_name: traefik | |
image: traefik # The official Traefik docker image | |
command: --api --docker # Enables the web UI and tells Traefik to listen to docker | |
ports: |
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 | |
/** | |
* Simple php cache using var_export generated files | |
* | |
* @author Marco Pivetta <ocramius@gmail.com> | |
*/ | |
class Ocramius_PhpCache { | |
const DEFAULT_TTL = 3600; |
OlderNewer