Skip to content

Instantly share code, notes, and snippets.

View adrenalinkin's full-sized avatar
:octocat:
Enjoying the creation of something new

Viktor Linkin adrenalinkin

:octocat:
Enjoying the creation of something new
  • @comdi
  • Moscow
View GitHub Profile
@adrenalinkin
adrenalinkin / .an-instruction.md
Last active February 6, 2023 16:27
Simple docker-compose.yaml configuration for run any open source PHP project from the container

Supports PHP ^7.2 || ^8.0

Add into .gitignore_global folder .docker where we will locate our files

echo '.docker' >> ~/.gitignore_global

Add an alias to the host machine for more convenient use

echo 'alias docker-compose-bundled="docker-compose --env-file .docker/.env"' >> ~/.bash_profile
@adrenalinkin
adrenalinkin / symfony-optimization-for-mac-os.md
Last active June 7, 2021 19:27
Docker for Mac OS. Symfony cache clear optimization

How ist's work?

Leave cache and logs out of synchronize with host machine and we have zero cost overhead when cache has been recalculated

Add ENV variables

PROJECT_NAME=my-project-name

# for linux
@adrenalinkin
adrenalinkin / 1. instruction.md
Last active November 12, 2019 08:15
Usage example for Swagger Resolver Bundle
@adrenalinkin
adrenalinkin / docker-nfs-for-mac.md
Last active January 17, 2023 10:19
Docker NFS optimization for MAC

Install docker for mac.

  • Edit /etc/nfs.conf:

     nfs.server.mount.require_resv_port = 0 
    
  • Edit /etc/exports (create if not exist):

    Execute command and Put result of command execution into /etc/exports.:

We have some DTO which implements DtoResolverInterface:

interface DtoResolverInterface
{
    /**
     * Inject custom resolver
     *
     * @param OptionsResolver $resolver
     */
    public function injectResolver(OptionsResolver $resolver);
@adrenalinkin
adrenalinkin / submodule-sync.sh
Last active December 1, 2017 11:15
Batch git submodule sync by received branch name
#!/bin/bash
set -e
RES=$(echo -en '\033[0m')
RED=$(echo -en '\033[00;31m')
GREEN=$(echo -en '\033[00;32m')
YELLOW=$(echo -en '\033[00;33m')
root=$PWD
@adrenalinkin
adrenalinkin / deploy.php
Created August 1, 2017 12:28
Symfony2 deployment by Github webhook which provides logging in file and integration with slack.
<?php
// main deployment commands registration
$commands = [
'git pull',
'git status',
'rm -rf app/cache/*',
'export SYMFONY_ENV=prod; export HOME=~; php composer.phar install',
'php app/console doctrine:migration:migrate -n',
];