Skip to content

Instantly share code, notes, and snippets.

View suzuken's full-sized avatar

Kenta SUZUKI suzuken

View GitHub Profile
package main
import (
"log"
"time"
)
func do(d time.Duration, f func(time.Time)) {
for x := range time.Tick(d) {
f(x)
package main
import (
"flag"
goose "github.com/advancedlogic/GoOse"
)
func main() {
var (
rawurl = flag.String("url", "http://edition.cnn.com/2012/07/08/opinion/banzi-ted-open-source/index.html", "url for parsing")
// original: http://blog.golang.org/pipelines
package main
import (
"crypto/md5"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
@suzuken
suzuken / fan.go
Last active February 5, 2016 04:39
// original: http://blog.golang.org/pipelines
package main
import (
"fmt"
"sync"
)
func main() {
done := make(chan struct{})
// original: http://blog.golang.org/pipelines
package main
import (
"fmt"
)
func main() {
for n := range sq(sq(gen(2, 3))) {
fmt.Println(n)
package main
import (
"fmt"
)
func main() {
var s []int
fmt.Println(s == nil)
s = nil
package main
import (
"fmt"
"html"
"net/http"
)
func main() {
http.HandleFunc("/foo", handler)
package main
import (
"fmt"
"golang.org/x/net/html/charset"
"io"
"io/ioutil"
"net/http"
"unicode/utf8"
)
/* fork from MacDown/Styles/GitHub2.css */
body {
font-family: "ヒラギノ角ゴ Pro W3","Hiragino Kaku Gothic Pro","MS Gothic","MS ゴシック",monospace,Helvetica, arial, sans-serif;
font-size: 100%;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }