Skip to content

Instantly share code, notes, and snippets.

View iggyster's full-sized avatar
🧘
Meditating

Ihor Pronin iggyster

🧘
Meditating
  • Ukraine
View GitHub Profile
@iggyster
iggyster / multiple_ssh_keys_settings.md
Last active February 11, 2017 13:56
Multiple SSH keys settings for different GitHub accounts (full guide)
@iggyster
iggyster / phpmd.xml
Created March 31, 2018 17:28
PHP MD Configuration
<?xml version="1.0"?>
<ruleset name="Name">
<description>Name - PHP MD Ruleset</description>
<!-- CLEAN CODE RULES: http://phpmd.org/rules/cleancode.html -->
<rule ref="rulesets/cleancode.xml/BooleanArgumentFlag"/>
<rule ref="rulesets/cleancode.xml/ElseExpression"/>
<rule ref="rulesets/cleancode.xml/StaticAccess"/>
@iggyster
iggyster / .php_cs.dist
Last active September 1, 2020 12:43
PHP CS Fixer config for Symfony 4 projects
<?php
$projectPath = __DIR__ . '/src';
if (!file_exists($projectPath)) {
echo 'Source directory is missed or project path is invalid.';
die(1);
}
return PhpCsFixer\Config::create()
@iggyster
iggyster / PaginateNativeQuerySubscriber.php
Last active July 16, 2024 12:52
How to handle a NativeQuery for the KNP paginator
<?php
declare(strict_types=1);
namespace AppBundle\EventSubscriber;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\NativeQuery;
use Doctrine\ORM\NonUniqueResultException;
use Doctrine\ORM\Query\ResultSetMapping;
@iggyster
iggyster / docker-compose.yml
Created December 16, 2019 17:13
Docker compose example for Symfony apps
version: '3'
services:
composer:
image: composer
working_dir: /var/www/playground
volumes:
- .:/var/www/playground
php:
build:
context: .
@iggyster
iggyster / Dockerfile
Created December 16, 2019 17:14
Dockerfile example for php image
FROM php:7.2-fpm
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
libmemcached-dev \
libz-dev \
libpq-dev \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
@iggyster
iggyster / nginx.conf
Created December 16, 2019 17:15
Nginx conf example for Symfony app
server {
listen 80;
server_name symfony-playground.lm *.symfony-playground.lm;
root /var/www/playground/public;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
location / {
try_files $uri /index.php$is_args$args;
@iggyster
iggyster / xdebug.ini
Created December 16, 2019 17:16
Xdebug conf example
;xdebug.remote_host=127.0.0.1;
xdebug.remote_port=9000
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.idekey=PHPSTORM
xdebug.cli_color=0
xdebug.profiler_enable=0
@iggyster
iggyster / php.ini
Last active November 16, 2020 14:15
A copy of php.ini
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@iggyster
iggyster / defer.js
Created July 8, 2020 10:38
Vue mixin to create deferred components
export default function (count = 10) {
return {
data () {
return {
displayPriority: 0,
}
},
mounted () {
this.runDisplayPriority()