Skip to content

Instantly share code, notes, and snippets.

@shadowhand
shadowhand / ddd_cqrs_event-sourcing_in_php.md
Created October 18, 2016 14:38 — forked from jsor/ddd_cqrs_event-sourcing_in_php.md
DDD, CQRS and Event Sourcing in PHP

DDD, CQRS and Event Sourcing in PHP

  • Broadway - Infrastructure and testing helpers for creating CQRS and event sourced applications
  • EventCentric.Core - Event Sourcing and CQRS in PHP
  • LiteCQRS - Small convention based CQRS library for PHP
  • predaddy - Common DDD classes including an annotation driven message bus and tools for CQRS and Event Sourcing
  • ProophEventSourcing - Provides basic functionality for event-sourced aggregates
  • ProophEventStore - PHP 5.4+ EventStore Implementation
  • ProophServiceBus - PHP Enterprise Service Bus Implementation supporting CQRS and DDD
@shadowhand
shadowhand / phpunit-alias.sh
Created October 12, 2016 14:46
Shell alias for enabling xdebug when running phpunit
# This assumes you have installed php56 and php56-xdebug, and installed phpunit
# globally. Replace php56 with php71 or whatever version you use. For example:
#
# brew install php56 php56-xdebug
# composer global require phpunit/phpunit
#
# After installing xdebug, you will need to disable xdebug from always loading:
#
# $EDITOR /usr/local/etc/php/5.6/conf.d/ext-xdebug.ini
#
@shadowhand
shadowhand / example.php
Last active August 31, 2016 13:54
Private object hydration via closure
<?php
use function Magic\hydrate;
class Foo
{
private $cute;
private $clever;
public function __construct(array $values)
@shadowhand
shadowhand / keybase.md
Last active May 26, 2018 17:11
keybase.md

Keybase proof

I hereby claim:

  • I am shadowhand on github.
  • I am shadowhand (https://keybase.io/shadowhand) on keybase.
  • I have a public key whose fingerprint is 40AF B4CD AB73 94B4 67DF E1E4 25A1 4BF1 4DEB 29D1

To claim this, I am signing this object:

@shadowhand
shadowhand / .gitconfig
Created March 9, 2016 02:34
You just need a bigger hammer!
[alias]
fixlock = ! git reset HEAD -- composer.lock && git co -- composer.lock && composer update --no-scripts && git add composer.lock

OWASP Top 10 Notes

p: login redirect -> credential capture

  • whitelist allowed

p: components with known vulnerabilities

  • security checker package

p: cookie passthrough

@shadowhand
shadowhand / equipit.sh
Created January 6, 2016 03:43
Spark -> Equip
#!/bin/bash
replace() {
for file in $(git grep -l $1); do
sed -i '' -e "s/$1/$2/g" $file
done
}
replace "Spark" "Equip"
replace "sparkphp\/spark" "equip\/framework"
<?php
function array_key_first(array $arr)
{
reset($arr);
return key($arr);
}
function array_key_last(array $arr)
{
@shadowhand
shadowhand / closed-incorrect-branch.md
Last active December 30, 2015 21:02
Standard PR thank you with note about rules

Thank you for contributing! The branch you made this PR against is no longer accepting patches. This probably happened because we didn't merge your changes fast enough. 😭

Please create a new PR against the current default branch if you want to see these changes merged.

class RedirectResponder implements Responder
{
public function __invoke(
Request $request,
Response $response,
Payload $payload
) {
if ($this->hasRedirect($payload)) {
$messages = $payload->getMessages() + [
'status' => 302,