Skip to content

Instantly share code, notes, and snippets.

@haswalt
haswalt / gist:5a7725278cc6a5f2830e
Created February 18, 2016 19:53
aws-uploader-simple
;(function() {
'use strict';
function Uploader() {
AWS.config.update({
accessKeyId: '',
secretAccessKey: ''
});
AWS.config.region = 'us-east-1';
@haswalt
haswalt / gist:0d02a16a5cd79b97eeaa
Created October 24, 2015 10:49
Compose circle
# circle.yml
machine:
services:
- docker
dependencies:
override:
- sudo pip install --upgrade docker-compose==1.3.0
- ./compose-development build
@haswalt
haswalt / .gitconfig
Created February 4, 2013 18:00
My global git config
[user]
name = Harry Walter
email = ***********
[branch "master"]
remote = origin
merge = refs/heads/master
[color]
diff = auto
@haswalt
haswalt / TestWrapper.php
Created August 3, 2012 14:09
Stream wrapper to funit testing
<?php
namespace Versionable\Ration\Stream;
/**
* Dummy stream wrapper for unit tests
*
* @author Harry Walter <harry.walter@lqdinternet.com>
*/
class TestWrapper
protected function parseResponse($raw)
{
$raw = trim($raw);
$response = null;
switch (substr($raw, 0, 1)) {
case '-':
throw new ResponseException(substr($raw, 4));
break;
case '+':
{% for competition in competitions %}
<tr>
<td>{{ competition.title }}</td>
<td>{{ competition.searchPhrase }}</td>
<td>{{ competition.openAt|date }}</td>
<td>{{ competition.closeAt|date }}</td>
<td>{{ competition.total }}</td>
</tr>
{% endfor %}
<?php
namespace \Acme\Bundle\ExampleBundle\Entity;
use \Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="product_variants", indexes={
* @ORM\index(name="variant_name_idx", columns={"name"})
@haswalt
haswalt / gist:1416066
Created December 1, 2011 11:37
Subclass from Mapped superclass example
<?php
namespace UKWM\Bundle\DictionaryBundle\Entity;
use \Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="dictionary_colours", indexes={
* @ORM\Index(name="text_idx", columns={"text"})
@haswalt
haswalt / gist:1416060
Created December 1, 2011 11:36
Mapped Superclass example
<?php
namespace UKWM\Bundle\DictionaryBundle\Entity;
use \Doctrine\ORM\Mapping as ORM;
/**
* @ORM\MappedSuperclass
*/
class Definition
@haswalt
haswalt / SearchListener.php
Created May 4, 2011 16:22
Doctrine event listener
public function getSubscribedEvents()
{
return array(Events::postPersist);
}
public function postPersist(LifecycleEventArgs $args)
{
$em = $args->getEntityManager();
$uow = $em->getUnitOfWork();