Skip to content

Instantly share code, notes, and snippets.

View yakubenko's full-sized avatar
👽
Eat. Sleep. Code.

Stanislav Yakubenko yakubenko

👽
Eat. Sleep. Code.
View GitHub Profile
version: '3'
services:
apache:
build: ./apache/
ports:
- "8080:8080"
volumes:
- /your/path:/var/www/app/
nginx:
@yakubenko
yakubenko / PasswordComponent.php
Created April 2, 2018 06:48
A password component for CakePHP 3. Allows generating a password which matches a given pattern.
<?php
namespace App\Controller\Component;
use Cake\Controller\Component;
use Cake\Auth\DefaultPasswordHasher;
class PasswordComponent extends Component {
public function generate() {
return $this->create_password('##CcC#C');
}
@yakubenko
yakubenko / JTokensComponent.php
Last active April 2, 2018 06:49
Simple JWT component for CakePHP 3
<?php
namespace App\Controller\Component;
use Cake\Controller\Component;
use Cake\Utility\Security;
class JTokensComponent extends Component {
public $secretKey;
public $algorythm = "HS256";
public $type = "JWT";
public $payload = [];
@yakubenko
yakubenko / locations.php
Created August 23, 2016 05:44
Bitrix get locations group
<?php
function getLocationGroup() {
// из конфига config.php
global $defaultLocationsGroup;
$obCache = new CPHPCache;
if($obCache->InitCache(7200, "cities", "/klamas/all")) {
$locationsCache = $obCache->getVars();
$locations = $locationsCache['cities'];