Skip to content

Instantly share code, notes, and snippets.

View patrickdappollonio's full-sized avatar
👨‍💻

Patrick D'appollonio patrickdappollonio

👨‍💻
View GitHub Profile
@patrickdappollonio
patrickdappollonio / stack.go
Last active April 8, 2016 19:41
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
package main
import (
"fmt"
"sort"
)
type Stack struct {
st []int
ordered []int
@patrickdappollonio
patrickdappollonio / filename.conf
Created January 22, 2016 23:02
Upstart code to daemonize quickly a set of instructions (place them on /etc/init/filename.conf where filename will be the name of the service to be executed, like "service filename start")
#!upstart
description "Place a description here"
author "John Doe"
start on (net-device-up
and local-filesystems
and runlevel [2345])
stop on runlevel [06]