Skip to content

Instantly share code, notes, and snippets.

View yariksheptykin's full-sized avatar

Iaroslav Sheptykin yariksheptykin

View GitHub Profile
@yariksheptykin
yariksheptykin / skeleton.php-cs-fixer.php
Created March 27, 2024 15:44
skeleton-rules.php-cs-fixer.php
<?php
return [
'@Symfony' => true,
'@Symfony:risky' => true,
'@PHP82Migration' => true,
'@DoctrineAnnotation' => true,
'@PHPUnit84Migration:risky' => true,
'blank_line_after_opening_tag' => false,
'declare_strict_types' => true,
'single_line_throw' => false,

How to Practice Git Rebase

This guide will walk you through practicing git rebase on a local repository. We'll start by creating a simple repository and make some commits, then practice rebasing a branch onto the updated main branch.

1. Initialize an empty repository:

Open your terminal and navigate to the directory where you want to create the repository. Then, run:

git init
@yariksheptykin
yariksheptykin / pimcore-check-build.php
Last active March 14, 2023 16:21
A simple php script to check if pimcore is build for production
#!/usr/bin/env php
<?php
/**
* This file checks if pimcore is correctly built for production mode.
* Execute it with `php -d zend.assertions=1 check-build.php`.
* Or from the web: `wget -qO- https://gist.githubusercontent.com/yariksheptykin/4eb979490fa51df77309e02f32173d69/raw/pimcore-check-build.php | php -d zend.assertions=1 --`.
*/
declare(strict_types=1);
// Enable assertions.
services:
db:
image: ubuntu:22.04
volumes:
- "${SSH_AUTH_SOCK:?SSH configuration is incomplete}:/ssh-agent"
environment:
SSH_AUTH_SOCK: '/ssh-agent'
PROXY_SSH_SERVER: '${PROXY_SSH_SERVER:?SSH configuration is incomplete}'
PROXY_SSH_USER: '${PROXY_SSH_USER:?SSH configuration is incomplete}'
REMOTE_MYSQL_HOST: ${REMOTE_MYSQL_HOST:?Database configuration seems to be missing}
; Official docs from pimcore: https://pimcore.com/docs/pimcore/current/Development_Documentation/Installation_and_Upgrade/System_Setup_and_Hosting/Performance_Guide.html#page_Performance-Best-Practice-Guide
; PHP 8 OPcache and JIT compiler
opcache.enable=${OPCACHE_ENABLE}
opcache.enable_cli=${OPCACHE_ENABLE}
opcache.jit_buffer_size=256M
; Use the OPcache class preloading
opcache.preload_user=www-data
opcache.preload=${OPCACHE_PRELOAD_PATH}
@yariksheptykin
yariksheptykin / pimcore-demo.sh
Last active December 9, 2021 14:40
Spin up pimcore demo
#!/usr/bin/env bash
set -eu
# A bash script to spin up pimcore demo locally using docker.
# The script follows the README instructions for docker.
# See: https://github.com/pimcore/demo
# Usage:
# curl -s https://gist.githubusercontent.com/yariksheptykin/9eaa93910c5ef9360697a507cd01488a/raw/pimcore-demo.sh | bash -s [up|down] <project-name>
@yariksheptykin
yariksheptykin / git-rev-name.sh
Created July 7, 2021 11:23
git revision name in english
#!/usr/bin/env bash
COMMIT_ID=$(git rev-parse --short ${1:-HEAD})
NOUNS=$(curl --silent https://raw.githubusercontent.com/hugsy/stuff/22dadc624c32cdc8f33c6e7f45022a45fb073bfd/random-word/english-nouns.txt)
NOUN=$(echo "$NOUNS" | sed -n "$((16#$COMMIT_ID % $(echo "$NOUNS" | wc -l) ))p")
ADJECTIVES=$(curl --silent https://gist.githubusercontent.com/hugsy/8910dc78d208e40de42deb29e62df913/raw/eec99c5597a73f6a9240cab26965a8609fa0f6ea/english-adjectives.txt)
ADJECTIVE=$(echo "$ADJECTIVES" | sed -n "$((16#$COMMIT_ID % $(echo "$ADJECTIVES" | wc -l) ))p")
@yariksheptykin
yariksheptykin / composer-pimcore.sh
Last active November 18, 2019 20:22
alias for runnung composer inside pfaffenbauer's pimcore container
alias composer='docker run --rm --interactive --tty --volume $PWD:/var/www/html --user $(id -u):$(id -g) --volume $HOME/.composer:/.composer dpfaffenbauer/pimcore:PHP7.2-apache composer'
@yariksheptykin
yariksheptykin / find-root-versions.sh
Created July 24, 2019 12:23
finds root owned pimcore versions
ls -la var/versions/object/ | awk '{print $NF}' | xargs -I % sh -c 'echo var/versions/object/% && ls -la var/versions/object/% | grep root'
ls -la var/versions/object/g530000 | grep root | awk '{print $NF}' | xargs -I % chown -R www-data:www-data var/versions/object/g530000/%