Skip to content

Instantly share code, notes, and snippets.

@gavinblair
Created August 23, 2012 11:10
Show Gist options
  • Select an option

  • Save gavinblair/3435651 to your computer and use it in GitHub Desktop.

Select an option

Save gavinblair/3435651 to your computer and use it in GitHub Desktop.
Days until explode($pizza)->event[2]!
package explodepizza
import(
"fmt"
"net/http"
"time"
)
func init() {
http.HandleFunc("/", handler)
}
func handler(w http.ResponseWriter, r *http.Request) {
t := time.Date(2013, time.January, 25, 19, 0, 0, 0, time.UTC)
n := time.Now()
d := (t.Unix() - n.Unix()) / 60 / 60 / 24
fmt.Fprint(w, d, " days until explode($pizza)->event[2]!")
}
@gavinblair
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment