Skip to content

Instantly share code, notes, and snippets.

View pavlakis's full-sized avatar

Antonios Pavlakis pavlakis

View GitHub Profile
@pavlakis
pavlakis / dns-issue-acme.sh-certs
Last active August 30, 2021 18:00
acme.sh keep LetsEncrypt CA
# Should be running acme.sh v3
~/.acme.sh/acme.sh --upgrade
# Set the default CA to LetsEncrypt
~/.acme.sh/acme.sh --set-default-ca --server letsencrypt
# Issue a certificate using AWS Route 53
~/.acme.sh/acme.sh --issue --dns dns_aws -d example.com
# Install certificates and restart web server
@pavlakis
pavlakis / docker-compose.yml
Created February 26, 2021 11:54
Basic LEMP setup with PHP 7.2
version: '3'
services:
phpminds-nginx:
image: phpminds/nginx:1.10
restart: always
depends_on:
- db
ports:
- 8080:80
@pavlakis
pavlakis / gist:88330bb6662072716635fee4cccf9503
Created December 6, 2019 09:10
Access route paths from Behat
default:
suites:
api:
paths: [ "%paths.base%/features/api" ]
contexts:
- ApiContext:
entityManager: '@doctrine.orm.default_entity_manager'
routingExtension: '@twig.extension.routing'
extensions:
@pavlakis
pavlakis / running-phpstan-on-yii-framework.md
Created October 25, 2018 23:16
Running PHPStan on a legacy Yii project

Running PHPStan on a legacy Yii project

Yii Framework

The Yii Framework (version 1) is compatible with PHP 7.2 (as of 1.1.20) and can also use composer. However, as a legacy project many still run it on older PHP versions.

To run PHPStan against it, I am using a Docker image with PHP 7.2 and Composer.

Composer

@pavlakis
pavlakis / symfony3-integration-tests.md
Created May 18, 2018 08:05
Writing integration tests with fixtures for Symfony 3.4

Writing integration tests for Symfony 3.4

These are some of my notes on writing integration tests for Symfony 3.4 as it was a task which had some gotchas and took me some time to get it working.

Access to the container

In order to access the container of a Symfony project, our PHPUnit tests should extend KernelTestCase.

@pavlakis
pavlakis / single-click-no-jump-double.js
Created November 28, 2017 12:37
Handling double-click on single click events
function bindMessageButton() {
"use strict";
var $msgButton = $('a.msg');
$msgButton.attr('href', '#');
$msgButton.on('click', function (e) {
e.preventDefault();
$msgButton.unbind();
$msgButton.removeAttr('href'); // fix for double click jump
// ... do stuff ...
@pavlakis
pavlakis / mockery-omitted-optional-values.php
Created November 9, 2017 11:01
Mockery fails on with() with omitted optional values
class MyClass
{
public function doStuff($param, array $optional = [])
{
// some logic
return true;
}
}

Keybase proof

I hereby claim:

  • I am pavlakis on github.
  • I am pavlakis (https://keybase.io/pavlakis) on keybase.
  • I have a public key whose fingerprint is 7781 6883 4771 F024 D1A0 8A97 38D0 A714 0A8F C4F8

To claim this, I am signing this object:

@pavlakis
pavlakis / centos7-vagrant-export.md
Last active February 15, 2017 09:17
Creating a Centos7 vagrant box
@pavlakis
pavlakis / remote-phpunit-xdebug-vagrant.md
Last active August 5, 2016 14:15
Remote CLI Xdebug through PHPUnit and Vagrant