Skip to content

Instantly share code, notes, and snippets.

View ArtemioVegas's full-sized avatar

Artyom Kotov ArtemioVegas

  • Bank 131
  • Armenia, Yerevan
View GitHub Profile
@ArtemioVegas
ArtemioVegas / TicketRepository.php
Last active April 28, 2023 10:12
Модификация списка товаров
<?php
declare(strict_types=1);
interface TicketRepositoryInterface
{
public function load($ticketID): Ticket;
public function save($ticket): void;
public function update($ticket): void;
public function delete($ticket): void;
@ArtemioVegas
ArtemioVegas / ComplexNumber.php
Created February 7, 2020 09:43
Complex Number Class
<?php
declare(strict_types=1);
namespace common\modules\catalog\frontend\components;
/**
* Класс для работы с комплексными числами
*
* @author Котов Артём <kotov.as2@dns-shop.ru>
@ArtemioVegas
ArtemioVegas / nginx_commands.txt
Created March 4, 2019 09:24
nginx usefull commands
sudo service php5.6-fpm reload
sudo nginx -t
sudo nginx -s reload
sudo /etc/init.d/nginx restart
service --status-all
@ArtemioVegas
ArtemioVegas / git_commands.txt
Created March 4, 2019 09:03
git usefull comands
--- Создает коммит который отменяет изменения указанного коммита, аттрибут m требуется если это мердж коммит - указать какого родителя (первый, второй и тд)
git revert <commit_hash> -m 1
--- удаляет последний коммит, если он еще не запушен
git reset --hard HEAD~1
--- сливает ветки, но не коммитит
git merge --no-commit merge_branch
git merge --no-commit --no-ff merge_branch
@ArtemioVegas
ArtemioVegas / mysql_commands.txt
Created March 4, 2019 08:59
mysql usefull commands
SHOW GRANTS
SHOW GRANTS FOR CURRENT_USER;
-- выключить кэш для текущей сесси
SET SESSION query_cache_type = OFF;
SET SESSION query_cache_limit = 0;
SET SESSION query_cache_size = 0;
SET SESSION query_cache_type = 0;
SET SESSION query_cache_size = 0;
@ArtemioVegas
ArtemioVegas / php_commands.txt
Created March 4, 2019 08:54
usefull php commands
-- Kill all php-fpm processes
sudo kill -9 `sudo ps -ef | grep php-fpm | grep -v grep | awk '{print $2}'`
killall -KILL php-fpm
ps -aux | grep php-fpm
--- получить юзера от которого запущен пхп
$processUser = posix_getpwuid(posix_geteuid());
print $processUser['name'];
-- установить дефолтнтный интерпетатор пхп
@ArtemioVegas
ArtemioVegas / findPolindrom.txt
Created February 15, 2019 09:28
поиск палиндромов
https://ru.wikipedia.org/wiki/Поиск_длиннейшей_подстроки-палиндрома#.D0.90.D0.BB.D0.B3.D0.BE.D1.80.D0.B8.D1.82.D0.BC_.D0.9C.D0.B0.D0.BD.D0.B0.D0.BA.D0.B5.D1.80.D0.B0
https://habr.com/ru/post/276195/
https://gist.github.com/esase/56a249658a5dfe38228447b1af2723d6
https://github.com/search?l=PHP&q=Manacher&type=Repositories
@ArtemioVegas
ArtemioVegas / patterns.txt
Last active February 11, 2019 14:21
Solid & Patterns
https://devconf.ru/data/devconf2016/ppt/108.pdf
https://habr.com/ru/post/208442/
https://sourcemaking.com/design_patterns
https://refactoring.guru/ru/design-patterns
https://phptherightway.com/pages/Design-Patterns.html
https://designpatternsphp.readthedocs.io/ru/latest/README.html
https://habr.com/ru/company/mailru/blog/412699/
@ArtemioVegas
ArtemioVegas / ShowAction.php
Created January 31, 2019 09:43
add symfony forms
<?php
namespace App\Http\Action\Blog;
use App\ReadModel\PostReadRepository;
use Framework\Template\TemplateRenderer;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Zend\Diactoros\Response\EmptyResponse;
@ArtemioVegas
ArtemioVegas / info.txt
Created January 28, 2019 13:29
my symfony app
http://artemio-todo.herokuapp.com