Skip to content

Instantly share code, notes, and snippets.

View marijn's full-sized avatar

Marijn Huizendveld marijn

View GitHub Profile
@marijn
marijn / entities.js
Created November 10, 2010 17:04
Formatted list of XHTML entities (credit: WYMEditor / wymeditor.org)
var _entities = { " "" : " "
, "¡" : "¡"
, "¢" : "¢"
, "£" : "£"
, "¤" : "¤"
, "¥" : "¥"
, "¦" : "¦"
, "§" : "§"
, "¨" : "¨"
, "©" : "©"
@marijn
marijn / Asiadam-bespaar 52% in Amsterdam (20110728).png
Created July 29, 2011 21:25
Data captured from Groupon website
Asiadam-bespaar 52% in Amsterdam (20110728).png
config/vhost.conf
logs
documents
vendor

Connect to server

$ ssh -l <username> -p <ssh-port> <domain>

Connect to MySQL server

@marijn
marijn / post_commit
Created January 23, 2012 18:03
Post commit hook for a multiple branch Sismo setup.
#!/bin/sh
sismo --quiet build `git name-rev --name-only HEAD | xargs -I {} echo "Pink Tie/CoreBundle/{}" | tr '[A-Z]' '[a-z]' | tr "/" "-" | tr " " "-"` `git log -1 HEAD --pretty="%H"` &
<?php
final class BlogPost
{
private $created;
private $publish;
public function __construct()
{
$this->created = new DateTime('now');
@marijn
marijn / event.sql
Created February 22, 2012 12:49
Event and snapshot queries
SELECT e.* FROM event e WHERE e.aggregate_id = ?1 ORDER BY e.playhead ASC
@marijn
marijn / README.markdown
Created March 20, 2012 16:10
Finite state machine for locks
@marijn
marijn / Example.php
Created April 3, 2012 16:53
An example on sorting Doctrine\Common\Collection\ArrayCollection elements
<?php
$collection = new Doctrine\Common\Collection\ArrayCollection();
// add objects to the collection that contain a getCreated method returning a DateTime instance
$iterator = $collection->getIterator();
$iterator->uasort(function ($first, $second) {
if ($first === $second) {
<?php
class DateTimeTest extends PHPUnit_Framework_TestCase
{
private $dateTimeZone;
public function setUp()
{
$this->dateTimeZone = new DateTimeZone("UTC");
}