Skip to content

Instantly share code, notes, and snippets.

View michalkleiner's full-sized avatar

Michal Kleiner michalkleiner

View GitHub Profile
@michalkleiner
michalkleiner / integration-manager-repository-hooks.md
Created March 9, 2021 00:57 — forked from hujuice/integration-manager-repository-hooks.md
Integration manager repository Git hooks for a PHP project

Here are suggested hooks for integration manager repository, in a composer based PHP project.

The IM has all the developer hooks, more the prepare-commit-msg to intercept unwanted merges.

@michalkleiner
michalkleiner / Developer-repository-hooks.md
Created March 9, 2021 00:57 — forked from hujuice/Developer-repository-hooks.md
Devs Git hooks for a PHP project

Here are suggested hooks for a developer repository, in a composer based PHP project.

The pre-commit avoids direct commits in masterbranch and performs quality checks (qa script) on changed files, blocking the poor quality code.

The post-merge install new versions of packages on composer.lock changes and perform a new QA check on incoming code.

The quality checks are based on PHP Mess Detector and PHP CodeSniffer

@michalkleiner
michalkleiner / EditorConfig.php
Created March 18, 2020 22:59 — forked from adrexia/EditorConfig.php
Set up various TinyMCE Editors
<?php
namespace App\Config;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
class EditorConfig
{
public static function setAllEditors()
@michalkleiner
michalkleiner / EditorConfig.php
Created March 18, 2020 22:59 — forked from adrexia/EditorConfig.php
Set up various TinyMCE Editors
<?php
namespace App\Config;
use SilverStripe\Core\Manifest\ModuleLoader;
use SilverStripe\Forms\HTMLEditor\TinyMCEConfig;
class EditorConfig
{
public static function setAllEditors()
@michalkleiner
michalkleiner / HideFileAndLinkTrackingTabsExtension.php
Created October 23, 2018 22:40
Remove File tracking and Link tracking tabs in SS 4.2
<?php
// Files to create:
// app/src/Extensions/DataObject/HideFileAndLinkTrackingTabsExtension.php
// app/_config/cwp_fix.yml
namespace Chrometoaster\Extensions\DataObject;
use SilverStripe\Forms\FieldList;
use SilverStripe\ORM\DataExtension;
@michalkleiner
michalkleiner / docker-compose.yml
Created May 16, 2018 00:25 — forked from seanhandley/docker-compose.yml
How To Set Up Docker For Mac with Native NFS
version: '2'
services:
api:
volumes:
- "nfsmount:${CONTAINER_DIR}"
volumes:
nfsmount:
driver: local
driver_opts:
@michalkleiner
michalkleiner / ByUrlSegmentQueryCreator.php
Created December 21, 2017 22:31 — forked from maxime-rainville/ByUrlSegmentQueryCreator.php
A simple Silverstripe 4 GraqhQL QueryCreator for returning a single DataObject by some unique field.
<?php
namespace SmartCookie\GraphQL;
use GraphQL\Type\Definition\ResolveInfo;
use GraphQL\Type\Definition\Type;
use SilverStripe\GraphQL\Manager;
use SilverStripe\GraphQL\OperationResolver;
use SilverStripe\GraphQL\QueryCreator;
use SilverStripe\ORM\DataObject;
use SilverStripe\GraphQL\Scaffolding\Util\ScaffoldingUtil;
@michalkleiner
michalkleiner / deploy-stages.php
Created August 15, 2017 06:33 — forked from bummzack/deploy-stages.php
Rsync Deployment setup à la bummzack
<?php
server('live', '{{LiveServer}}', 22)
->user('{{SshUser}}')
->forwardAgent() // You can use identity key, ssh config, or username/password to auth on the server.
->stage('live')
->env('deploy_path', '{{DeployDir}}'); // Define the base path to deploy your project to.
server('staging', '{{StagingServer}}', 22)
->user('{{SshUser}}')
->forwardAgent() // You can use identity key, ssh config, or username/password to auth on the server.
@michalkleiner
michalkleiner / .gitignore
Created August 15, 2017 06:19 — forked from lerni/.gitignore
deploy SilverStripe with PHP-Deployer per git-repo
# ignore everything...
/*
# ...but
# htaccess is ignored since we have a different versions for each stage see in /deploy
!/.gitignore
!/composer.json
!/composer.lock
!/.editorconfig
!/README.md