Skip to content

Instantly share code, notes, and snippets.

View taion809's full-sized avatar
:shipit:
what are statuses for?

Nicholas Johns taion809

:shipit:
what are statuses for?
View GitHub Profile
package main
import (
"fmt"
"github.com/gorilla/mux"
"net/http"
)
func HomeHandler(w http.ResponseWriter, r *http.Request) {
fmt.Println("Home handler called.. wooo")
@taion809
taion809 / gist:10730486
Created April 15, 2014 12:59
crappy gorilla tutorial.
Getting Started With Gorilla MUX
===============
###### [Rough Draft.. stop sucking at writing]
I used to have a ton of time. My responsibilities were minimal and I was working remotely from home. Since moving back to The United States I find I have a lot less time. I commute into New York City, which eat's up 2 hours per day, upon returning home I help my wife take care of our son, then I often pass out and start the cycle anew. With that being said, I am now trying to break out of my routine and explore new avenues in programming. Hopefully this series on getting started with the Gorilla Toolkit will be useful to someone else.
Ok, enough of the useless let's get to the useful!
### What are we going to do?

Dockerizing your PHP application

Why?

Why would you want to utilize Docker to package and deliver your application? The most compelling reason, in my mind, is the idea of immutable infrastructure. The ability to run the same exact software on the same infrastructure each time you deploy regarless of when you deploy. I once posted an article describing how I used Docker to contain and deliver a legacy nodejs application. That same application still runs and can be easily deployed to another server and run exactly the same as it did the very first day.

Sounds great, so what do you do?

The first thing is get familiar with the documentation. This article will not discuss the basics of using Docker.

@taion809
taion809 / User.orm.yml
Created January 18, 2015 16:54
FOSUserBundle User Mapping (YAML)
# src/AppBundle/Resources/config/doctrine/User.orm.yml
AppBundle\Entity\User:
type: entity
table: users
id:
id:
type: integer
generator:
strategy: AUTO
@taion809
taion809 / TypeResolver.php
Created February 19, 2015 03:30
Type resolver
<?php
/**
* Created by PhpStorm.
* User: njohns
* Date: 1/4/15
* Time: 9:49 AM
*/
namespace Rql\Types;
func startServing() {
listener, err := net.Listen("tcp", ":11300")
if err != nil {
log.Fatal(err)
}
for {
conn, err := listener.Accept()
if err != nil {
log.Fatal(err)
http://stackoverflow.com/questions/1057564/pretty-git-branch-graphs
@taion809
taion809 / thing.sh
Created August 11, 2015 23:01
No BS nodejs install
# fuck i hate using curl http://shitty-url.com/something.sh | sudo bash -
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
deb https://deb.nodesource.com/node_0.12 trusty main
deb-src https://deb.nodesource.com/node_0.12 trusty main
sudo apt-get update
sudo apt-get install nodejs
@taion809
taion809 / udp_client.go
Created October 21, 2015 00:16 — forked from reterVision/udp_client.go
A dummy UDP hole punching sample in Go
package main
import (
"encoding/json"
"fmt"
"log"
"net"
"os"
"time"
)
@taion809
taion809 / Dockerfile
Last active December 21, 2015 13:49
Dockerfile for building an nginx webserver from nginx.org's mainline repo
# nginx mainline from the nginx.org apt repository as of this gist 1.5.3
#
#
# Version 0.1
#
# Build instructions:
# sudo docker build -t="nginx" .
#
# Usage:
# sudo docker -d nginx