Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am mattsenior on github.
  • I am mattsenior (https://keybase.io/mattsenior) on keybase.
  • I have a public key whose fingerprint is 5444 8CB7 5738 9EA7 A63E 74AB 5020 C2D8 992B 3088

To claim this, I am signing this object:

@mattsenior
mattsenior / gist:0493e486612efafa337e
Last active August 29, 2015 14:23
DataScript backwards relation
var d = require('datascript');
var db = d.db_with(
d.empty_db({
'chicken': { ':db/valueType': ':db.type/ref' }
}),
[
{ ':db/id': 1, 'name': 'Chicken' },
{ ':db/id': 2, 'name': 'Egg 1', 'chicken': 1 },
{ ':db/id': 3, 'name': 'Egg 2', 'chicken': 1 }
@mattsenior
mattsenior / DataContext.php
Last active December 15, 2015 11:58
Just a very basic snippet of purging entities and loading fixtures with Nelmio\Alice within a BehatContext
<?php
namespace Context;
use Behat\Behat\Context\BehatContext,
Behat\Symfony2Extension\Context\KernelAwareInterface;
use Nelmio\Alice as Fixtures;
// ...