Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Mostly writing Go!

Ewan Valentine EwanValentine

💭
Mostly writing Go!
View GitHub Profile
View nginx.conf
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
@EwanValentine
EwanValentine / deploy.sh
Created Mar 27, 2017
Go + Docker build script example
View deploy.sh
#!/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" \
View gist:4ee3b97c2505a267423e
package main
import (
"fmt"
)
type Container map[string]interface{}
func (container Container) Add(name string, object interface{}) Container {
container[name] = object
@EwanValentine
EwanValentine / AbstractCommandTestHelper.php
Last active Aug 29, 2015
Symfony2 command unit test helper class.
View AbstractCommandTestHelper.php
<?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;
View gist:5ccf8049979b56a4f29c
<?php
namespace MyBundle\ApiBundle\Entity;
use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/