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\Resources; | |
use Illuminate\Database\Eloquent\Builder; | |
use Illuminate\Http\Resources\Json\JsonResource; | |
class FilteredJsonResource extends JsonResource | |
{ | |
public static function collection($resource) |
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.5' | |
services: | |
ldap: | |
image: osixia/openldap | |
ports: | |
- 389:389 | |
ldap_admin: | |
image: osixia/phpldapadmin |
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\Listener; | |
use Doctrine\ORM\Event\LoadClassMetadataEventArgs; | |
use Doctrine\ORM\Mapping\ClassMetadataInfo; | |
class TablePrefixListener | |
{ | |
protected string $tablePrefix = ''; |
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 | |
$userHashKey = 'password'; | |
$privateUserPayloadData = [ | |
'userId' => 1, | |
'exp' => (new \DateTime('+5 hours'))->getTimestamp() | |
]; | |
// Generate Token | |
$token = JWT::encode($privateUserPayloadData, $userHashKey,'HS256'); |
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 | |
/** | |
* ChoiceType "preferred_choice_twice" Extension | |
* | |
* @author Ramazan APAYDIN <[email protected]> | |
*/ | |
class ChoiceTypeExtension extends AbstractTypeExtension | |
{ | |
public function buildView(FormView $view, FormInterface $form, array $options) |
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\Service; | |
use Doctrine\Common\Collections\ArrayCollection; | |
use Doctrine\ORM\Query\Parameter; | |
use Symfony\Component\Process\Process; | |
/** | |
* Async SQL Query |
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 | |
/** | |
* Add Working Day with Holidays | |
* | |
* @param \DateTimeInterface $first | |
* @param int|null $weekDay | |
* @param \DateTimeInterface[]|null $holidays | |
* | |
* @return \DateTimeInterface |
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 | |
/** | |
* Hex to RGBA | |
* | |
* @param string $hexColor | |
* @param string|int|double $opacity | |
* | |
* @return string | |
*/ |
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
import time | |
import os | |
import subprocess | |
import re | |
from watchdog.observers import Observer | |
from watchdog.events import FileSystemEventHandler | |
def outputCmd(cmd): | |
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | |
stdout,stderr = proc.communicate() |
NewerOlder