Skip to content

Instantly share code, notes, and snippets.

@mattn
Created November 1, 2013 07:52
Show Gist options
  • Save mattn/7262126 to your computer and use it in GitHub Desktop.
Save mattn/7262126 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"net/http"
)
func main() {
c := 1
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/reset" {
c = 1
http.Redirect(w, r, "/", http.StatusFound)
return
}
if r.URL.Path != "/" {
http.NotFound(w, r)
return
}
fmt.Fprintf(w, `<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>ぐるぐる</title>
<style>
#guruguru {
-moz-transform: rotate(%fdeg) scale(%f,%f);
-webkit-transform: rotate(%fdeg) scale(%f,%f);
-ie-transform: rotate(%fdeg) scale(%f,%f);
transform: rotate(%fdeg) scale(%f,%f);
}
</style>
</head>
<body>
<img src="http://a3.twimg.com/profile_images/1379864305/3f2beb73b92a9fcefb3391a90043d5f5.png" id="guruguru">
</body>
</html>
`,
float64(c)*5.0, float64(c)/100.0, float64(c)/100.0,
float64(c)*5.0, float64(c)/100.0, float64(c)/100.0,
float64(c)*5.0, float64(c)/100.0, float64(c)/100.0,
float64(c)*5.0, float64(c)/100.0, float64(c)/100.0)
c++
})
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment