Skip to content

Instantly share code, notes, and snippets.

View EwanValentine's full-sized avatar
💭
Mostly writing Go!

Ewan Valentine EwanValentine

💭
Mostly writing Go!
View GitHub Profile
<?php
namespace MyBundle\ApiBundle\Entity;
use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
@EwanValentine
EwanValentine / AbstractCommandTestHelper.php
Last active August 29, 2015 14:20
Symfony2 command unit test helper class.
<?php
namespace Ladbible\BaseBundle\Tests\Command;
use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Bundle\FrameworkBundle\Console\Application;
package main
import (
"fmt"
)
type Container map[string]interface{}
func (container Container) Add(name string, object interface{}) Container {
container[name] = object
@EwanValentine
EwanValentine / deploy.sh
Created March 27, 2017 09:39
Go + Docker build script example
#!/bin/bash
source ~/.bashrc
echo "Building"
# Build Go binary in Docker image
docker run --rm \
-e "GOPATH=/go" \
-e "CGO_ENABLED=0" \
-e "GOOS=linux" \
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;