Skip to content

Instantly share code, notes, and snippets.

View johnhout's full-sized avatar
🏋️
Focusing

John in 't Hout johnhout

🏋️
Focusing
View GitHub Profile
@johnhout
johnhout / OperationPathResolver.php
Created December 12, 2019 14:47 — forked from soyuka/OperationPathResolver.php
Workflow bridge for api platform
<?php
declare(strict_types=1);
namespace ApiPlatform\Workflow\PathResolver;
use ApiPlatform\Core\PathResolver\OperationPathResolverInterface;
final class OperationPathResolver implements OperationPathResolverInterface
{
@johnhout
johnhout / EntityListener.php
Last active February 1, 2019 15:12
Symfony type listener
<?php
namespace YourName\YourBundle\EventListener;
use Doctrine\ORM\Event;
use Symfony\Component\DependencyInjection\ContainerAware;
class EntityListener extends ContainerAware
{
@johnhout
johnhout / docker-functions.sh
Last active January 24, 2023 16:04
Docker snippets
# Inlude in your .zshrc
removecontainers() {
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
}
armageddon() {
removecontainers
docker network prune -f
@johnhout
johnhout / MailtrapTrait.php
Last active October 19, 2018 10:10
Mailtrap test trait for PHPUnit
<?php
namespace Tests;
use GuzzleHttp\Client;
trait MailtrapTrait
{
public $mailtrap;
protected $mailtrap_inbox;
@johnhout
johnhout / SimpleUploadTrait.php
Created June 30, 2015 09:07
Trait for simple file uploading for Laravel.
<?php
use Symfony\Component\HttpFoundation\File\UploadedFile;
trait SimpleUploadTrait {
/**
* Upload the file with slugging to a given path
*
* @param UploadedFile $image
@johnhout
johnhout / Readme.md
Last active November 3, 2023 12:17
Laravel dutch validation translation file.
@johnhout
johnhout / setup_laravel.sh
Last active September 4, 2015 16:32
Laravel 5 quick install bash!
#!/bin/sh
# Laravel 5 new project setup bash script.
# Inspired by Mitchell van Wijngaarden
# Extended by John in 't Hout
projectname=$1
git clone -o laravel -b develop https://github.com/laravel/laravel.git ${projectname} >/dev/null
cd ${projectname}
git checkout --orphan master