View FeatureFlagService.php
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 | |
// src/Service/FeatureFlagService.php | |
declare(strict_types=1); | |
namespace App\Service; | |
use GuzzleHttp\ClientInterface; | |
use Symfony\Component\HttpFoundation\Request; |
View .php_cs
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 | |
declare(strict_types=1); | |
$finder = PhpCsFixer\Finder::create() | |
->exclude('Migrations') | |
->in(__DIR__ . '/src') | |
->in(__DIR__ . '/tests'); | |
return PhpCsFixer\Config::create() |
View files_backup_aws.sh
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
#! /bin/bash | |
TIMESTAMP=$(date +"%F-%T") | |
FILES_DIR=/var/www/my_website/web/uploads | |
BACKUP_DIR="/var/backups/files/my_website_backups/$TIMESTAMP" | |
TAR=/usr/bin/tar | |
AWS=/usr/bin/aws | |
mkdir -p "$BACKUP_DIR" | |
$TAR -zcvf $BACKUP_DIR/files.tar.gz $FILES_DIR | |
View files_backup_sftp.sh
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
#! /bin/bash | |
TIMESTAMP=$(date +"%F-%T") | |
FILES_DIR=/var/www/my_website/web/uploads | |
BACKUP_DIR="/var/backups/files/my_website_backups/$TIMESTAMP" | |
TAR=/usr/bin/tar | |
REMOTE_HOST="192.168.1.55" | |
REMOTE_USER="backup" | |
REMOTE_PASSWORD="password" | |
REMOTE_DIR=/home/backup/files_backups/ |
View databases_backup_sftp.sh
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
#! /bin/bash | |
TIMESTAMP=$(date +"%F-%T") | |
BACKUP_DIR="/var/backups/databases/my_website_backups/$TIMESTAMP" | |
MYSQL_USER="root" | |
MYSQL=/usr/bin/mysql | |
MYSQL_PASSWORD="password" | |
MYSQL_HOST="localhost" | |
REMOTE_HOST="192.168.1.55" | |
REMOTE_USER="backup" |
View databases_backup_aws.sh
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
#! /bin/bash | |
TIMESTAMP=$(date +"%F-%T") | |
BACKUP_DIR="/var/backups/databases/$TIMESTAMP" | |
MYSQL_USER="backup" | |
MYSQL=/usr/bin/mysql | |
MYSQL_PASSWORD="password" | |
MYSQL_HOST="localhost" | |
AWS=/usr/bin/aws |
View parse.php
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 | |
// generator is here: | |
// https://funpay.ru/yandex/emulator | |
function parseMessage($message){ | |
//code | |
preg_match("/[' '][0-9]{4}['\n']/", $message, $code); | |
$code = $code[0] ?? ''; | |
$code = trim($code); |
View gist:9d07e666b8f3e427c84c024e4417da2e
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 | |
ob_start(); | |
phpinfo(); | |
$phpinfo = ob_get_clean(); | |
$startPos = strpos($phpinfo,'<tr><td class="e">System </td>'); | |
$endPos = strpos($phpinfo,'</tr>',$startPos); | |
$output = substr($phpinfo, 0,$startPos); |
View gist:a720c37007ac6ef459cf1155c0429d19
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 Antonshell\OrdersWebhooks\Services; | |
use Antonshell\OrdersWebhooks\Observer\MOrderSaveObserver; | |
use Magento\Framework\Event\ConfigInterface; | |
use Magento\Framework\Event\InvokerInterface; | |
use ReflectionClass; | |
use Symfony\Component\Console\Output\ConsoleOutput; |
View gist:3ca2772fbe4c46abfbbfe58fa5bb71d8
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 | |
$parser = new \antonshell\EgrulNalogParser\Parser(); | |
// parse for Individual Entrepreneur | |
$pathPe = __DIR__ . '/nalog_pe.pdf'; | |
$results = $parser->parseNalogPe($pathPe); | |
// parse for Organization | |
$pathOrg = __DIR__ . '/nalog_org.pdf'; |
NewerOlder