Skip to content

Instantly share code, notes, and snippets.

View meigwilym's full-sized avatar

Mei Gwilym meigwilym

View GitHub Profile
@meigwilym
meigwilym / server.sh
Created March 17, 2020 10:53
Bash file to manage a simple docker nginx server
#!/bin/bash
start() {
echo "starting the docker server..."
docker run --name docker-nginx -p 80:80 -d -v ~/Code/macbryde-click-map-demo:/usr/share/nginx/html nginx
}
stop() {
echo "stopping the docker server..."
docker stop docker-nginx
@meigwilym
meigwilym / index.md
Last active March 11, 2020 13:45
Gary Delaney's advice to comics

Gary Delaney's advice to comics

https://twitter.com/GaryDelaney/status/1237328585142263808

"Sometimes young comics ask me for advice. Here's some I gave in a recent interview which they seem to have printed pretty much in full. It might be useful to a few of you. Feel free to disagree on it of course. My map may not be your map."

As for the advice I would give to younger comedians starting out, it would be to say that talent is abundant, the willingness to work hard is rare. Write every day. Gig every night. You'll progress.

Don't speak too fast, stick to your time, do a litte pause before the funny bit, don't waffle, fake confidence, hold the mic near your mouth, be polite, and stay in the light.

@meigwilym
meigwilym / AbstractDTO.php
Last active November 23, 2022 14:41
An abstract DTO class I've been experimenting with recently.
<?php
namespace App\DTO;
use Illuminate\Support\Str;
use Illuminate\Contracts\Support\Jsonable;
use Illuminate\Contracts\Support\Arrayable;
/**
* An abstract class to provide out of the box functionality for DTO objects.
@meigwilym
meigwilym / AbilitySeeder.php
Last active January 31, 2020 14:39
Using Bouncer to check abilities
<?php
use App\Client;
use App\User;
use App\Site;
use App\Plot;
use App\SalesStatus;
use Silber\Bouncer\BouncerFacade as Bouncer;
use Illuminate\Database\Seeder;
@meigwilym
meigwilym / index.md
Created November 28, 2019 08:52
Notes on stitcher.io's Laravel beyond CRUD

Laravel beyond CRUD

stitcher.io

A blog series for PHP developers working on larger-than-average Laravel projects

Written for projects with a development lifespan of six to twelve months, with a team of three to six developers working on them simultaneously.

Chapter 1: Domain oriented Laravel

@meigwilym
meigwilym / readme.md
Last active September 4, 2019 16:07
Notes from Ollie Read's article Laravel multi-tenancy, avoiding over engineering
@meigwilym
meigwilym / index.md
Last active June 26, 2019 16:04
Ultra Pen Llyn 2019 - 80km

Gwefan y ras.

Llwybr y daith.

Mae'r map yn cynnwys Check Points (coch) a Honesty Books (glas).

Dwi'n anelu am 13 awr. Dyma'r check points/amseroedd yn fras:

CP Ble Amser
@meigwilym
meigwilym / CQRS.md
Last active October 21, 2024 18:22
CQRS, Task Based UIs, Event Sourcing agh!

CQRS, Task Based UIs, Event Sourcing agh!

Posted by gregyoung on February 16, 2010

Many people have been getting confused over what CQRS is. They look at CQRS as being an architecture; it is not. CQRS is a very simple pattern that enables many opportunities for architecture that may otherwise not exist. CQRS is not eventual consistency, it is not eventing, it is not messaging, it is not having separated models for reading and writing, nor is it using event sourcing. I want to take a few paragraphs to describe first exactly what CQRS is and then how it relates to other patterns.

CQRS Command and Query Responsibility Segregation

Starting with CQRS, CQRS is simply the creation of two objects where there was previously only one. The separation occurs based upon whether the methods are a command or a query (the same definition that is used by Meyer in Command and Query Separation, a command is any method that mutates state and a query is any method that returns a value).