Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* This is the clock interface. It's really simple, you write it once, use it anywhere.
* Cool extra things you can do:
* - have it return custom value objects
* - separate method for currentDate() without time part
*/
interface Clock
{

“How We Talk About Tech” - Show Notes

Slides

I don’t think the slides are very useful on their own but you can find them here: http://rosstuck.com/dpc2016/#/.

(I was unable to create a decent PDF export, hence the self hosting).

Video

The talk was recorded but I don’t know when it will be released.

@rosstuck
rosstuck / 1-cookiejar.feature
Last active May 24, 2017 12:03
Behat / ES Helper
Feature: Cookie Jar
Scenario: The last cookie put in the jar is the first eaten
Given I put a raisin cookie in the jar
And I put a chocolate cookie in the jar
When I eat a cookie
Then I should have eaten a chocolate cookie
Scenario: I eat multiple cookies
Given I put a raisin cookie in the jar
<?php
namespace Derp;
abstract class Enum
{
protected $value;
protected static $possibleValues;
protected static function getPossibleValues()
@rosstuck
rosstuck / keybase.md
Created September 22, 2014 19:30
keybase.md

Keybase proof

I hereby claim:

  • I am rosstuck on github.
  • I am rosstuck (https://keybase.io/rosstuck) on keybase.
  • I have a public key whose fingerprint is A689 BB42 7A18 84FE 410B C170 2D05 8561 B39E D426

To claim this, I am signing this object:

@rosstuck
rosstuck / FormSet.php
Last active January 5, 2017 11:28
Symfony Formset
<?php
use \Symfony\Component\Form\FormInterface;
use \Symfony\Component\HttpFoundation\Request;
class FormSet
{
/**
* @var SplObjectStorage|FormInterface[]
*/
@rosstuck
rosstuck / EventGenerator.php
Created March 20, 2014 16:04
Simple EventGenerator trait that you might use with domain events
<?php
trait EventGenerator
{
protected $pendingEvents = array();
protected function raise($event)
{
$this->pendingEvents[] = $event;
}
@rosstuck
rosstuck / gist:3481910
Created August 26, 2012 17:40
cheese om nom nom
Hello PFC!
@rosstuck
rosstuck / gist:2972413
Created June 22, 2012 12:17
Bootstrapping JMS
use Metadata\MetadataFactory;
use JMS\SerializerBundle\Serializer\Handler\DeserializationHandlerInterface;
use JMS\SerializerBundle\Serializer\Handler\SerializationHandlerInterface;
use JMS\SerializerBundle\Serializer\VisitorInterface;
use JMS\SerializerBundle\Serializer\XmlDeserializationVisitor;
use JMS\SerializerBundle\Serializer\Construction\UnserializeObjectConstructor;
use JMS\SerializerBundle\Serializer\JsonDeserializationVisitor;
use JMS\SerializerBundle\Serializer\Handler\ObjectBasedCustomHandler;
use JMS\SerializerBundle\Serializer\Handler\DateTimeHandler;
use JMS\SerializerBundle\Serializer\Handler\DoctrineProxyHandler;
@rosstuck
rosstuck / Javascript part
Created May 26, 2012 08:58
Redis pub/sub
var redis = require("redis");
var client = redis.createClient();
client.on("message", function (channel, message) {
console.log(channel + ": " + message);
});
client.subscribe("broadcast");