diff --git a/0-README.slide b/0-README.slide new file mode 100644 index 0000000..2186dde --- /dev/null +++ b/0-README.slide @@ -0,0 +1,18 @@ +README + + + +Vincent Batts +@vbatts +vbatts@hashbangbash.com + +* Overview + - This is a presentation tool from the golang team. + - Slide deck is a single flate file (*.slide) +.link https://godoc.org/golang.org/x/tools/present Present + + +* Slides + +.link https://github.com/vbatts/talks vbatts' talks + diff --git a/2013/03-golang-learning-lunch/1-hello/main.go b/2013/03-golang-learning-lunch/1-hello/main.go new file mode 100644 index 0000000..413665a --- /dev/null +++ b/2013/03-golang-learning-lunch/1-hello/main.go @@ -0,0 +1,8 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello World!") +} + diff --git a/2013/03-golang-learning-lunch/10-abstracts/main.go b/2013/03-golang-learning-lunch/10-abstracts/main.go new file mode 100644 index 0000000..5ec464c --- /dev/null +++ b/2013/03-golang-learning-lunch/10-abstracts/main.go @@ -0,0 +1,39 @@ +package main + +func main() { + jeep := Hummer{} + h(jeep) + jeep.Where() + c(jeep) +} + + +type Car interface { + Honk() + Crank() +} + +func c(some interface{}) { + some.(Car).Crank() +} +func h(some interface{}) { + some.(Car).Honk() +} + +// Implement the Car interface +type Hummer struct { + Car +} + +func (h Hummer) Honk() { + println("BEEP BEEP") +} + +func (h Hummer) Where() { + println("Who's got the keys to the jeep?") +} + +func (h Hummer) Crank() { + println("VROOOOOOM") +} + diff --git a/2013/03-golang-learning-lunch/11-defer/main.go b/2013/03-golang-learning-lunch/11-defer/main.go new file mode 100644 index 0000000..fe04d0a --- /dev/null +++ b/2013/03-golang-learning-lunch/11-defer/main.go @@ -0,0 +1,12 @@ +package main + +import "fmt" + +func main() { + // START OMIT + for i := 0; i < 5; i++ { + defer fmt.Printf("%d ", i) + } + fmt.Println("HOOTY HOO!") + // STOP OMIT +} diff --git a/2013/03-golang-learning-lunch/12-go-func/main.go b/2013/03-golang-learning-lunch/12-go-func/main.go new file mode 100644 index 0000000..4a66244 --- /dev/null +++ b/2013/03-golang-learning-lunch/12-go-func/main.go @@ -0,0 +1,30 @@ +package main + +import ( + "fmt" + "time" +) + +// START OMIT +func DelayedHello() { + time.Sleep(3 * time.Second) + fmt.Printf("%d: Hello!\n", time.Now().Unix()) +} + +func main() { + go DelayedHello() + go DelayedHello() + go func() { + time.Sleep(3 * time.Second) + fmt.Printf("%d: Hello!\n", time.Now().Unix()) + }() + + fmt.Printf("%d: Is there anybody in there?!\n", time.Now().Unix()) + + for i := 0; i < 5; i++ { + fmt.Printf("%d: .\n", time.Now().Unix()) + time.Sleep(time.Second) + } +} +// STOP OMIT + diff --git a/2013/03-golang-learning-lunch/13-blank-var/main.go b/2013/03-golang-learning-lunch/13-blank-var/main.go new file mode 100644 index 0000000..7b6d367 --- /dev/null +++ b/2013/03-golang-learning-lunch/13-blank-var/main.go @@ -0,0 +1,14 @@ +package main + +func main() { + // START OMIT + words := []string{"cow","goat","sheep","horse","chicken"} + for i := range words { + println(words[i]) + } + for _, word := range words { + println(word) + } + // STOP OMIT +} + diff --git a/2013/03-golang-learning-lunch/14-ngoroutines/main.go b/2013/03-golang-learning-lunch/14-ngoroutines/main.go new file mode 100644 index 0000000..0d7d319 --- /dev/null +++ b/2013/03-golang-learning-lunch/14-ngoroutines/main.go @@ -0,0 +1,20 @@ +package main + +// START OMIT +var ngoroutine = 100000 + +func f(left, right chan int) { left <- 1 + <-right } + +func main() { + leftmost := make(chan int) + var left, right chan int = nil, leftmost + for i := 0; i < ngoroutine; i++ { + left, right = right, make(chan int) + go f(left, right) + } + right <- 0 // bang! + x := <-leftmost // wait for completion + println(x) // 100000 +} + +// STOP OMIT diff --git a/2013/03-golang-learning-lunch/2-hello/main.go b/2013/03-golang-learning-lunch/2-hello/main.go new file mode 100644 index 0000000..ec102fa --- /dev/null +++ b/2013/03-golang-learning-lunch/2-hello/main.go @@ -0,0 +1,13 @@ +package main + +import "fmt" + +func main() { + var words string + + words = "Hello World!" + + for i := 0; i < 10; i++ { + fmt.Printf("%s\n", words) + } +} diff --git a/2013/03-golang-learning-lunch/2013-03-27-go-ll.slide b/2013/03-golang-learning-lunch/2013-03-27-go-ll.slide new file mode 100644 index 0000000..635892a --- /dev/null +++ b/2013/03-golang-learning-lunch/2013-03-27-go-ll.slide @@ -0,0 +1,350 @@ +Golang: an introduction + +27 Mar 2013 + +# Go is a general-purpose language that bridges the gap between efficient +# statically typed languages and productive dynamic language. But it’s not just +# the language that makes Go special – Go has broad and consistent standard +# libraries and powerful but simple tools. +# +# This talk gives an introduction to Go + +# Please join Vincent Batts, Senior Software Application Engineer in the IT-Eng tower, for an overview of the Go programming language. +# +# Audience: Hackers, doodlers, early adopters, linguists +# Agenda: +# * Overview of just what the language is and why should anyone care? +# * What makes it better or worse than other options. +# * Is it production ready?! +# * Common go-idioms +# * Other questions folks have relevant to Red Hat IT ? +# +# Background: +# The Go programming language is an open source project to make programmers more productive. +# Go is expressive, concise, clean, and efficient. Its concurrency mechanisms make it easy to write programs that get the most out of multicore and networked machines, while its novel type system enables flexible and modular program construction. Go compiles quickly to machine code yet has the convenience of garbage collection and the power of run-time reflection. It's a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language. + +Vincent Batts +Red Hat, Inc. +@vbatts +vbatts@redhat.com +http://youtu.be/bIs15Km9v4k + +* Google Motivation +- Efficiency +- Safety +- Concurrency +- Scalabilty +- Fast Dev Cycle +- No Surprises +- ... Such a cute mascot + +* gophers +# SO DARN CUTE +.image 2013-03-27-go-ll/gopher.jpg + +* Benefits +- Spec driven + +.link http://golang.org/ref/spec + +- Changes must have consenus +# agreement of the different world views + +* Hello, go + +.play 1-hello/main.go + +* Layout Overview + +- packages (namespaces) +# no need for central trust model +# not terribly unlike python +- remote packages include host/path +# we'll touch back on this on the go tool +- packages hold types, constants, variables, structs and func's +- packages are grouped by directory (all *.go siblings are grouped) +# we'll get back to testing +- Capitalization determines visibility: `Foo` is exported, `foo` is not + +* Tooling + +* Compilers +- gc - Google Go Compiler + - f19+ 'golang' + - EPEL soon... +# either from source or there is an RPM build +# +# COMPILES SO FAST +# +# 100k lines of code compiles in 2min +# (the equivalent C++ took greater than 1hr) +# +- gccgo - GCC 4.7.1 and newer + - f16+ +# fedora 16+ and RHEL7 + +* go tool +the defacto all-the-things tool +# wraps up testing, building, docs and libraries + +Compile a single-file program + + $ go build hello.go + +Compile and run a single-file program + + $ go run hello.go + +List libraries available + + $ go list all + +See documentation + + $ go doc io/ioutil + +* go tool + +Cleanup code + + $ go fmt main.go + +Test code + + $ go test main_test.go + +Check code for suspicious constructs or inconsistencies + + $ go vet main.go + +* go tool + +Compile out the current directory's *.go + + $ cd my-project/ + $ go build + $ ./my-project + +Test the current directory's *.go + + $ cd my-project/ + $ go test + +* Standard libraries +# are freaking _solid_ +# +# Very well documented +# +# and easy to read + +* basic types + +.link http://golang.org/ref/spec#Types + +- Familiar C-types +- But Strings too! +# common and comfortable enough, without having to think of strings +# as *char. We have []byte for that now +- Slices - static and dynamic arrays + +* structs and pointers + + type Person struct { + Name string + Dob *time.Time + } + +.play ./3-struct/main.go /START/,/STOP/ + +* structs and pointers + + func (p *Person) ComeToLife() { + t := time.Now() + p.Dob = &t + p.State = NEW_BORN + } + +.play ./4-struct-func/main.go /START/,/STOP/ + +* Why should I care? +# Perhaps you shouldn't care, if you ask this ... :-) + +Why Another Language? +# Surprisingly, much of the concepts of Golang are _not_ "new" +# concepts were taken from Ada, and heavily succeeds from plan9 and erlang +# (ken thompson is one of the core developers) +# +# like so many businesses they have a need for business logic/ performance +# but also the speed and ease of getting new features/apps deployed +# +# This often splits them over two languages. In google's situation, the need +# for a single language came from their heavy use of C and Python. +# +# Compile times! none of the ifdef garb, +# and no shadiness of pre-proccessor, header and linker issues + +Benefits for me? +# That's a big question that would involve a good deal of review +# +# reduced code. logic becomes visible + +Benefits for Red Hat IT? +# Even tougher to say. +# Definitely has benefits for portability, light-stack, speed and stability +# No conversations should be considered, but also should not be ruled out +# for future projects. +# +# Ops/Infra burden. No stack, just land the binary. +# Server needs no additional software, just a bare bones linux box +# +# StatHat +# ruby -> go services find 10x performance increase +# +# IronWorker +# 30 ruby servers -> 2 go servers (just for redundancy) +# + +* Is this production ready?! + +Great question! + +.link https://code.google.com/p/go-wiki/wiki/SuccessStories + +Google uses it +- dl.google.com +- part of Youtube + +.link https://code.google.com/p/vitess/ Youtube - vitess project + + +* Idiomatic + +* Very +- expressive +- predictable +- parsable (gofmt) +- what-you-see-is-what-you-get +# not a bunch of hidden inheritance +# or prototyping +# or code sprawl + + +* Idioms + +- Multiple return values +- Error checking (rather than exception handling) + + fn := "/tmp/this-file.txt" + fh, err := os.Open(fn) + if err != nil { + fmt.Fprintf(os.Stderr, "ERROR: %s failed cause: %s!\n", fn, err) + // ... check for type of error, and do something + } + // ... life goes on + + +* Idioms + +anonymous functions + +.link http://golang.org/doc/effective_go.html#goroutines go routines + +.play 12-go-func/main.go /START/,/STOP/ + + +* Idioms + +.link http://golang.org/doc/effective_go.html#defer Defer +# closing a handle, unlocking a mutex, some stack of operations, etc. + +.play 11-defer/main.go /START/,/STOP/ + +classic file handle situation... made simple + + fh, err := os.Open("foo.txt") + if err != nil { + return "", err + } + defer fh.Close() + // forget about needing to close the file handle + + +* Idioms + +Only what you need + +- import's +# failed compile for including libraries that aren't used +- variables + +.play 13-blank-var/main.go /START/,/STOP/ + + +* Idioms + +.link http://golang.org/doc/effective_go.html#channels Channels +# nice closures + + c := make(chan int) // Allocate a channel. + // Start the sort in a goroutine; when it completes, signal on the channel. + go func() { + list.Sort() + c <- 1 // Send a signal; value does not matter. + }() + doSomethingForAWhile() + <-c // Wait for sort to finish; discard sent value. + + +* channels +- using it for signal catching + + go func() { + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt) + signal.Notify(c, os.Kill) + for sig := range c { + // sig is a ^C, handle it + if sig == os.Interrupt { + log.Println("interrupted ...") + os.Exit(1) + } else if sig == os.Kill { + log.Println("killing ...") + os.Exit(2) + } else { + log.Printf("Not sure what %q is. Quiting", sig) + os.Exit(3) + } + } + }() + + +* concurrency + +.play 14-ngoroutines/main.go /START/,/STOP/ + +* Straight Forward + +.link http://localhost:4000/ Web Server + +.play ./9-http-srv/main.go /START/,/STOP/ + +* Other Questions?? + + +* References + +.link http://golang.org/doc/ + +.link http://golang.org/pkg/ + +.link http://godoc.org/ + +freenode #go-nuts + +.link http://groups.google.com/group/golang-nuts + +.link http://youtu.be/sln-gJaURzk Google I/O 2012 - Meet the Go Team + +.link http://www.miek.nl/projects/learninggo/ Learning Go book (free) + + diff --git a/2013/03-golang-learning-lunch/2013-03-27-go-ll/gopher.jpg b/2013/03-golang-learning-lunch/2013-03-27-go-ll/gopher.jpg new file mode 100644 index 0000000..0e886e4 Binary files /dev/null and b/2013/03-golang-learning-lunch/2013-03-27-go-ll/gopher.jpg differ diff --git a/2013/03-golang-learning-lunch/3-struct/main.go b/2013/03-golang-learning-lunch/3-struct/main.go new file mode 100644 index 0000000..d8c9ec1 --- /dev/null +++ b/2013/03-golang-learning-lunch/3-struct/main.go @@ -0,0 +1,27 @@ +package main + +import ( + "fmt" + "time" +) + +type Person struct { + Name string + Dob *time.Time +} + +func main() { + // START OMIT + t, err := time.Parse(time.RFC822, "27 Mar 75 00:00 EST") + if (err != nil) { + fmt.Println(err) + return + } + p := Person{Name: "John Doe", Dob: &t } + fmt.Printf("%q\n", p) + // STOP OMIT + + //fmt.Printf("%s\n", p.Name) + //fmt.Printf("%s\n", p.Dob.String()) +} + diff --git a/2013/03-golang-learning-lunch/4-struct-func/main.go b/2013/03-golang-learning-lunch/4-struct-func/main.go new file mode 100644 index 0000000..3c1eaf1 --- /dev/null +++ b/2013/03-golang-learning-lunch/4-struct-func/main.go @@ -0,0 +1,46 @@ +package main + +import ( + "fmt" + "time" +) + +const ( + IN_UTERO = iota + NEW_BORN + GROWING + LIVING + DYING + DEAD +) + +type Person struct { + Name string + Dob *time.Time + State byte +} + +func (p *Person) DobString() string { + if (p.Dob == nil) { + return "" + } + return p.Dob.String() +} + +func (p *Person) ComeToLife() { + t := time.Now() + p.Dob = &t + p.State = NEW_BORN +} + + +func main() { + // START OMIT + p := Person{Name: "John Doe", State: IN_UTERO} + fmt.Printf("%s, %s\n", p.Name, p.DobString()) + + p.ComeToLife() + fmt.Printf("%s, %s\n", p.Name, p.DobString()) + // STOP OMIT +} + diff --git a/2013/03-golang-learning-lunch/5-neats/main.go b/2013/03-golang-learning-lunch/5-neats/main.go new file mode 100644 index 0000000..674849f --- /dev/null +++ b/2013/03-golang-learning-lunch/5-neats/main.go @@ -0,0 +1,24 @@ +package main + +import "fmt" + +func main() { + numbers := []int{1,7,3,8,2,4,5,4,9,0} + + for i := range numbers { + fmt.Printf("index: %d\n", i) + } + + for _, v := range numbers { + fmt.Printf("value: %d\n", v) + } + + people := map[string]Person{} + people["shawking"] = Person{ Name: "Stephen Hawking", State: LIVING} + people["dritchie"] = Person{ Name: "Dennis Ritchie", State: DEAD} + for k,v := range people { + fmt.Printf("Key: %s; Object: %q\n", k, v) + } + +} + diff --git a/2013/03-golang-learning-lunch/5-neats/person.go b/2013/03-golang-learning-lunch/5-neats/person.go new file mode 100644 index 0000000..ec83644 --- /dev/null +++ b/2013/03-golang-learning-lunch/5-neats/person.go @@ -0,0 +1,34 @@ +package main + +import ( + "time" +) + +const ( + IN_UTERO = iota + NEW_BORN + GROWING + LIVING + DYING + DEAD +) + +type Person struct { + Name string + Dob *time.Time + State byte +} + +func (p *Person) DobString() string { + if (p.Dob == nil) { + return "" + } + return p.Dob.String() +} + +func (p *Person) ComeToLife() { + t := time.Now() + p.Dob = &t + p.State = NEW_BORN +} + diff --git a/2013/03-golang-learning-lunch/6-inheritance/main.go b/2013/03-golang-learning-lunch/6-inheritance/main.go new file mode 100644 index 0000000..391ad2e --- /dev/null +++ b/2013/03-golang-learning-lunch/6-inheritance/main.go @@ -0,0 +1,40 @@ + +package main + +import ( + "log" + "os" + "os/exec" + "time" +) + +type Job struct { + Command string + *log.Logger +} + +func NewJob(cmd string) *Job { + return &Job{ cmd, log.New(os.Stderr, "[Job] ", log.Ldate)} +} + +func (j *Job) Run() ([]byte, error) { + j.Printf("Running [%s] ...", j.Command) + out, err := exec.Command(j.Command).Output() + if (err != nil) { + j.Fatal(err) + return nil, err + } + j.Printf("Command returned [%s]", out) + return out, nil +} + +func main() { + job := NewJob("uptime") + job.Run() + + for i := 0; i < 10; i++ { + job.Run() + time.Sleep(1 * time.Second) + } +} + diff --git a/2013/03-golang-learning-lunch/7-prof/main.go b/2013/03-golang-learning-lunch/7-prof/main.go new file mode 100644 index 0000000..2a5c4bc --- /dev/null +++ b/2013/03-golang-learning-lunch/7-prof/main.go @@ -0,0 +1,18 @@ +package main + +import ( + "log" + "net/http" + _ "net/http/pprof" + "time" +) + +func main() { + go func(){ log.Println(http.ListenAndServe("localhost:6060",nil))}() + log.Println("Sleeping") + for { + log.Print(".") + time.Sleep(3 * time.Second) + } +} + diff --git a/2013/03-golang-learning-lunch/8-io-chain/main.go b/2013/03-golang-learning-lunch/8-io-chain/main.go new file mode 100644 index 0000000..403b2cd --- /dev/null +++ b/2013/03-golang-learning-lunch/8-io-chain/main.go @@ -0,0 +1,22 @@ +package main + +import ( + "compress/gzip" + "encoding/base64" + "io" + "os" + "strings" +) + +func main() { + var r io.Reader + r = strings.NewReader(data) + r = base64.NewDecoder(base64.StdEncoding, r) + r, _ = gzip.NewReader(r) + io.Copy(os.Stdout, r) +} + +const data = ` +H4sIAAAJbogA/1SOO5KDQAxE8zlFZ5tQXGCjjfYIjoURoPKgcY0E57f4VZlQXf2e+r8yOYbMZJhoZWRxz3wkCVjeReETS0VHz5fBCzpxxg/PbfrT/gacCjbjeiRNOChaVkA9RAdR8eVEw4vxa0Dcs3Fe2ZqowpeqG79L995l3VaMBUV/02OS+B6kMWikwG51c8n5GnEPr11F2/QJAAD//z9IppsHAQAA +` + diff --git a/2013/03-golang-learning-lunch/9-http-srv/main.go b/2013/03-golang-learning-lunch/9-http-srv/main.go new file mode 100644 index 0000000..cc8fbbf --- /dev/null +++ b/2013/03-golang-learning-lunch/9-http-srv/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "log" + "net/http" +) + +// START OMIT +func routeSlash(w http.ResponseWriter, r *http.Request) { + log.Printf("Got a request from %s", r.RemoteAddr) + fmt.Fprintf(w, "It Works!\n") +} + +func main() { + log.Println("listening on 0.0.0.0:4000") + http.HandleFunc("/", routeSlash) + log.Fatal(http.ListenAndServe("0.0.0.0:4000", nil)) +} +// STOP OMIT + diff --git a/2015/06-devnation-golang-good-bad-ugly/README.md b/2015/06-devnation-golang-good-bad-ugly/README.md deleted file mode 100644 index 719f863..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Usage -==== - - go get golang.org/x/tools/cmd/present - present . - diff --git a/2015/06-devnation-golang-good-bad-ugly/README.md b/2015/06-devnation-golang-good-bad-ugly/README.md new file mode 120000 index 0000000..eb06b37 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/README.md @@ -0,0 +1 @@ +../02-devconf.cz/README.md \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/cats20.gif b/2015/06-devnation-golang-good-bad-ugly/cats20.gif deleted file mode 100644 index b6c353a..0000000 Binary files a/2015/06-devnation-golang-good-bad-ugly/cats20.gif and /dev/null differ diff --git a/2015/06-devnation-golang-good-bad-ugly/cats20.gif b/2015/06-devnation-golang-good-bad-ugly/cats20.gif new file mode 120000 index 0000000..3891616 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/cats20.gif @@ -0,0 +1 @@ +../02-devconf.cz/cats20.gif \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/good0.go b/2015/06-devnation-golang-good-bad-ugly/good0.go deleted file mode 100644 index 3a3b880..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/good0.go +++ /dev/null @@ -1,48 +0,0 @@ -// +build ignore - -package main - -import ( - "compress/gzip" - "encoding/json" - "flag" - "io/ioutil" - "log" - "os" -) - -func main() { - for _, arg := range flag.Args() { - func() { - // START1 OMIT - fh, err := os.Open(arg) - if err != nil { - log.Fatal(err) - } - defer fh.Close() - - gz, err := gzip.NewReader(fh) - if err != nil { - log.Fatal(err) - } - defer gz.Close() - - buf, err := ioutil.ReadAll(gz) - if err != nil { - log.Fatal(err) - } - - var mine MyStruct - err = json.Unmarshal(&mine) - if err != nil { - log.Fatal(err) - } - // STOP1 OMIT - - }() - } - -} - -type MyStruct struct { -} diff --git a/2015/06-devnation-golang-good-bad-ugly/good0.go b/2015/06-devnation-golang-good-bad-ugly/good0.go new file mode 120000 index 0000000..e8662f7 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/good0.go @@ -0,0 +1 @@ +../02-devconf.cz/good0.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/good1.go b/2015/06-devnation-golang-good-bad-ugly/good1.go deleted file mode 100644 index 84a3b6e..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/good1.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build ignore - -package main - -// START1 OMIT -// exported -type Foo struct { - Bar string // exported - baz bool // private -} - -// private -type bif struct { - Harf, Buz int64 // doesn't matter -} - -// STOP1 OMIT - -func main() { -} diff --git a/2015/06-devnation-golang-good-bad-ugly/good1.go b/2015/06-devnation-golang-good-bad-ugly/good1.go new file mode 120000 index 0000000..e963c30 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/good1.go @@ -0,0 +1 @@ +../02-devconf.cz/good1.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/gopher.png b/2015/06-devnation-golang-good-bad-ugly/gopher.png deleted file mode 100644 index cb5e2e1..0000000 Binary files a/2015/06-devnation-golang-good-bad-ugly/gopher.png and /dev/null differ diff --git a/2015/06-devnation-golang-good-bad-ugly/gopher.png b/2015/06-devnation-golang-good-bad-ugly/gopher.png new file mode 120000 index 0000000..0728bc3 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/gopher.png @@ -0,0 +1 @@ +../02-devconf.cz/gopher.png \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/hello.go b/2015/06-devnation-golang-good-bad-ugly/hello.go deleted file mode 100644 index 8ad6d97..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/hello.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build ignore - -// START1 OMIT -package main - -func main() { - println("Howdy y'all") -} - -// STOP1 OMIT diff --git a/2015/06-devnation-golang-good-bad-ugly/hello.go b/2015/06-devnation-golang-good-bad-ugly/hello.go new file mode 120000 index 0000000..536868c --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/hello.go @@ -0,0 +1 @@ +../02-devconf.cz/hello.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/imports.go b/2015/06-devnation-golang-good-bad-ugly/imports.go deleted file mode 100644 index ba18875..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/imports.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build ignore - -package main - -// START1 OMIT -import ( - "fmt" - "os" - - "github.com/foo/bar" -) - -// STOP1 OMIT - -func main() { - fmt.Println(bar.Baz()) - _ = os.FileInfo -} diff --git a/2015/06-devnation-golang-good-bad-ugly/imports.go b/2015/06-devnation-golang-good-bad-ugly/imports.go new file mode 120000 index 0000000..d686746 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/imports.go @@ -0,0 +1 @@ +../02-devconf.cz/imports.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png b/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png deleted file mode 100644 index e896826..0000000 Binary files a/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png and /dev/null differ diff --git a/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png b/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png new file mode 120000 index 0000000..792311a --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png @@ -0,0 +1 @@ +../02-devconf.cz/kanye_imma_bookmarklet.png \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/pingpong.go b/2015/06-devnation-golang-good-bad-ugly/pingpong.go deleted file mode 100644 index 159d2c5..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/pingpong.go +++ /dev/null @@ -1,33 +0,0 @@ -// +build OMIT - -package main - -import ( - "fmt" - "time" -) - -// STARTMAIN1 OMIT -type Ball struct{ hits int } - -func main() { - table := make(chan *Ball) - go player("ping", table) - go player("pong", table) - - table <- new(Ball) // game on; toss the ball - time.Sleep(1 * time.Second) - <-table // game over; grab the ball -} - -func player(name string, table chan *Ball) { - for { - ball := <-table - ball.hits++ - fmt.Println(name, ball.hits) - time.Sleep(100 * time.Millisecond) - table <- ball - } -} - -// STOPMAIN1 OMIT diff --git a/2015/06-devnation-golang-good-bad-ugly/pingpong.go b/2015/06-devnation-golang-good-bad-ugly/pingpong.go new file mode 120000 index 0000000..bb51bb8 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/pingpong.go @@ -0,0 +1 @@ +../02-devconf.cz/pingpong.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive1.go b/2015/06-devnation-golang-good-bad-ugly/primitive1.go deleted file mode 100644 index d9e1961..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/primitive1.go +++ /dev/null @@ -1,25 +0,0 @@ -// +build ignore - -package main - -import "fmt" - -func main() { - // START1 OMIT - names := []string{ - "Michael", - "Jan", - "Sean", - "Silvia", - } - for i, name := range names { - fmt.Printf("%q is the %d name\n", name, i) - } - for i := range names { - fmt.Printf("%q is the %d name\n", names[i], i) - } - for _, name := range names { - fmt.Printf("%q is the ... name\n", name) - } - // STOP1 OMIT -} diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive1.go b/2015/06-devnation-golang-good-bad-ugly/primitive1.go new file mode 120000 index 0000000..2a032e3 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/primitive1.go @@ -0,0 +1 @@ +../02-devconf.cz/primitive1.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive2.go b/2015/06-devnation-golang-good-bad-ugly/primitive2.go deleted file mode 100644 index 9d54624..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/primitive2.go +++ /dev/null @@ -1,56 +0,0 @@ -// +build ignore - -package main - -import "fmt" - -func main() { - // START1 OMIT - infos := map[string]Info{ - "Michael": Info{ - City: "Happyville", - Status: Open, - }, - "Jan": Info{ - City: "Confusville", - Status: Closed, - }, - "Sean": Info{ - City: "Septober", - Status: Complicated, - }, - "Silvia": Info{ - City: "Curiousville", - Status: Curios, - }, - } - for name, info := range infos { - fmt.Printf("%q is %s in %q\n", name, info.Status, info.City) - } - // STOP1 OMIT -} - -type Info struct { - City string - Status Status -} -type Status int - -var ( - Open = Status(0) - Closed = Status(1) - Complicated = Status(2) - Curios = Status(3) -) - -func (s Status) String() string { - switch s { - case Open: - return "open" - case Closed: - return "closed" - case Complicated: - return "complicated" - } - return "hurr" -} diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive2.go b/2015/06-devnation-golang-good-bad-ugly/primitive2.go new file mode 120000 index 0000000..bee2f3c --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/primitive2.go @@ -0,0 +1 @@ +../02-devconf.cz/primitive2.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive3.go b/2015/06-devnation-golang-good-bad-ugly/primitive3.go deleted file mode 100644 index c3329d5..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/primitive3.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build ignore - -package main - -import "fmt" - -func main() { - // START1 OMIT - fmt.Println("I've got:") - for card := range ReadEmAndWeep() { - fmt.Printf(" %s of %s\n", card.Value, card.Suite) - } - // STOP1 OMIT -} - -type Card struct { - Suite, Value string -} - -// START2 OMIT -func ReadEmAndWeep() <-chan Card { - c := make(chan Card) - go func() { - for _, card := range []Card{ - Card{"Ace", "Jack"}, - Card{"Ace", "Queen"}, - Card{"Ace", "King"}, - Card{"Ace", "Ace"}, - } { - c <- card - } - close(c) - }() - return c -} - -// STOP2 OMIT diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive3.go b/2015/06-devnation-golang-good-bad-ugly/primitive3.go new file mode 120000 index 0000000..a26179a --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/primitive3.go @@ -0,0 +1 @@ +../02-devconf.cz/primitive3.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg b/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg deleted file mode 100644 index eb3c98e..0000000 Binary files a/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg and /dev/null differ diff --git a/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg b/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg new file mode 120000 index 0000000..f34e151 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg @@ -0,0 +1 @@ +../02-devconf.cz/rainbow.jpg \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif b/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif deleted file mode 100644 index fce49b6..0000000 Binary files a/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif and /dev/null differ diff --git a/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif b/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif new file mode 120000 index 0000000..b4006c7 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif @@ -0,0 +1 @@ +../02-devconf.cz/revenge-of-the-nerds-o.gif \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/tags.go b/2015/06-devnation-golang-good-bad-ugly/tags.go deleted file mode 100644 index 6e89e71..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/tags.go +++ /dev/null @@ -1,8 +0,0 @@ -// START1 OMIT -// +build !windows linux,cgo -// STOP1 OMIT - -package main - -func main() { -} diff --git a/2015/06-devnation-golang-good-bad-ugly/tags.go b/2015/06-devnation-golang-good-bad-ugly/tags.go new file mode 120000 index 0000000..51902b7 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/tags.go @@ -0,0 +1 @@ +../02-devconf.cz/tags.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/ugly0.go b/2015/06-devnation-golang-good-bad-ugly/ugly0.go deleted file mode 100644 index 715c384..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/ugly0.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build ignore - -package main - -func main() { - // START1 OMIT - c := make(chan int) - go func() { - for i := 0; i < 10; i++ { - c <- i - } - close(c) - }() - println(<-c) - // STOP1 OMIT -} diff --git a/2015/06-devnation-golang-good-bad-ugly/ugly0.go b/2015/06-devnation-golang-good-bad-ugly/ugly0.go new file mode 120000 index 0000000..0568649 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/ugly0.go @@ -0,0 +1 @@ +../02-devconf.cz/ugly0.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/ugly1.go b/2015/06-devnation-golang-good-bad-ugly/ugly1.go deleted file mode 100644 index 3d72e71..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/ugly1.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build ignore - -package main - -// START1 OMIT -const ( - DeviceCreate TaskType = iota - DeviceReload - DeviceRemove - DeviceRemoveAll - DeviceSuspend - DeviceResume - DeviceInfo - DeviceDeps -) - -// STOP1 OMIT - -type TaskType int - -func main() { -} diff --git a/2015/06-devnation-golang-good-bad-ugly/ugly1.go b/2015/06-devnation-golang-good-bad-ugly/ugly1.go new file mode 120000 index 0000000..93cb1a3 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/ugly1.go @@ -0,0 +1 @@ +../02-devconf.cz/ugly1.go \ No newline at end of file diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future.pdf b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future.pdf new file mode 100644 index 0000000..c424fef Binary files /dev/null and b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future.pdf differ diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/0ff1b7eb9667528cb8cde60f7a5a2d5c.gif b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/0ff1b7eb9667528cb8cde60f7a5a2d5c.gif new file mode 100644 index 0000000..202a71c Binary files /dev/null and b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/0ff1b7eb9667528cb8cde60f7a5a2d5c.gif differ diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/1c6ccbd38dab6f0b22091524abac7aa7.svg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/1c6ccbd38dab6f0b22091524abac7aa7.svg new file mode 100644 index 0000000..16bf5ce --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/1c6ccbd38dab6f0b22091524abac7aa7.svg @@ -0,0 +1,28 @@ + + + + + diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/29583aa0f6502646cc4a405a00d175f1.jpg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/29583aa0f6502646cc4a405a00d175f1.jpg new file mode 100644 index 0000000..6262315 Binary files /dev/null and b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/29583aa0f6502646cc4a405a00d175f1.jpg differ diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/31b17322559178827a235d220821aa93.svg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/31b17322559178827a235d220821aa93.svg new file mode 100644 index 0000000..d55101f --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/31b17322559178827a235d220821aa93.svg @@ -0,0 +1,115 @@ + + + + + diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/339e84e5deca8af62480a1dc3fb7af96.gif b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/339e84e5deca8af62480a1dc3fb7af96.gif new file mode 100644 index 0000000..447404b Binary files /dev/null and b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/339e84e5deca8af62480a1dc3fb7af96.gif differ diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/45d982a1393e7ba90cd737f14784a939.jpg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/45d982a1393e7ba90cd737f14784a939.jpg new file mode 100644 index 0000000..7eb26c9 Binary files /dev/null and b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/45d982a1393e7ba90cd737f14784a939.jpg differ diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/542568e027f2219a3fdaf6422a7fbfbb.svg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/542568e027f2219a3fdaf6422a7fbfbb.svg new file mode 100644 index 0000000..e99f0b0 --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/542568e027f2219a3fdaf6422a7fbfbb.svg @@ -0,0 +1,18 @@ + + + + + diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/5e1a7c37f8b075137176a16db5edc490.svg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/5e1a7c37f8b075137176a16db5edc490.svg new file mode 100644 index 0000000..157dc3b --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/5e1a7c37f8b075137176a16db5edc490.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/60672f0849c5b758b11dc0905dc42c02.svg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/60672f0849c5b758b11dc0905dc42c02.svg new file mode 100644 index 0000000..4c36501 --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/60672f0849c5b758b11dc0905dc42c02.svg @@ -0,0 +1,17 @@ + + + diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/6967ea0d2cd91d9d3148b59913c877b2.png b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/6967ea0d2cd91d9d3148b59913c877b2.png new file mode 100644 index 0000000..e9b65f2 Binary files /dev/null and b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/6967ea0d2cd91d9d3148b59913c877b2.png differ diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/6a20bf7c89752f4a154c94b982adad75.svg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/6a20bf7c89752f4a154c94b982adad75.svg new file mode 100644 index 0000000..8183eb3 --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/6a20bf7c89752f4a154c94b982adad75.svg @@ -0,0 +1,23 @@ + + + + + diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/77224ae77eddb4497dc05323e883e772.svg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/77224ae77eddb4497dc05323e883e772.svg new file mode 100644 index 0000000..56a4e40 --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/77224ae77eddb4497dc05323e883e772.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/7ca4d0a435f26a7ec50c357e34eb9b3d.png b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/7ca4d0a435f26a7ec50c357e34eb9b3d.png new file mode 100644 index 0000000..acd6e0c Binary files /dev/null and b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/7ca4d0a435f26a7ec50c357e34eb9b3d.png differ diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/8c1ff2ec86107f22f0e7353d1cdd99fd.svg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/8c1ff2ec86107f22f0e7353d1cdd99fd.svg new file mode 100644 index 0000000..c595a50 --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/8c1ff2ec86107f22f0e7353d1cdd99fd.svg @@ -0,0 +1,94 @@ + + + + + diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/977b27c9a05d9eb092b3d77e0a34d3d8.png b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/977b27c9a05d9eb092b3d77e0a34d3d8.png new file mode 100644 index 0000000..2a36cab Binary files /dev/null and b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/977b27c9a05d9eb092b3d77e0a34d3d8.png differ diff --git a/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/c1ded99bf3ade93e11962707e0e58d63.svg b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/c1ded99bf3ade93e11962707e0e58d63.svg new file mode 100644 index 0000000..ba12bae --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/containers-past-present-and-future/c1ded99bf3ade93e11962707e0e58d63.svg @@ -0,0 +1,23 @@ + + + + + diff --git a/2016/05-Container_past_present_future-coreosfest-de/index.html b/2016/05-Container_past_present_future-coreosfest-de/index.html new file mode 100644 index 0000000..e57b63d --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/index.html @@ -0,0 +1,2865 @@ + + +
+ + + +Remember that you need to serve the presentation HTML from a HTTP server.
' + + '"+escape(cap[2],true)+"
";continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=""+this.token.text+"
\n";case "table":var body="",heading,i,row,cell,j;body+="\n\n"+body+"\n";case "list_start":var type=this.token.ordered?"ol":"ul",body="";while(this.next().type!=="list_end")body+= +this.tok();return"<"+type+">\n"+body+""+type+">\n";case "list_item_start":var body="";while(this.next().type!=="list_item_end")body+=this.token.type==="text"?this.parseText():this.tok();return"
"+this.inline.output(this.token.text)+ +"
\n";case "text":return""+this.parseText()+"
\n"}};function escape(html,encode){return html.replace(!encode?/&(?!#?\w+;)/g:/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i= +1,target,key;for(;i"+escape(e.message+"",true)+"";throw e;}}marked.options=marked.setOptions=function(opt){merge(marked.defaults,opt);return marked};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:""};marked.Parser=Parser;marked.parser=Parser.parse;marked.Lexer=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output; +marked.parse=marked;if(typeof exports==="object")module.exports=marked;else if(typeof define==="function"&&define.amd)define(function(){return marked});else this.marked=marked}).call(function(){return this||(typeof window!=="undefined"?window:global)}()); diff --git a/2016/05-Container_past_present_future-coreosfest-de/lib/reveal-plugins/notes/notes.html b/2016/05-Container_past_present_future-coreosfest-de/lib/reveal-plugins/notes/notes.html new file mode 100644 index 0000000..244936f --- /dev/null +++ b/2016/05-Container_past_present_future-coreosfest-de/lib/reveal-plugins/notes/notes.html @@ -0,0 +1,646 @@ + + + + + +
Keyboard Shortcuts
KEY | ACTION | ";for(var t in vr)e+="
---|---|
"+t+" | "+vr[t]+" |
"+gr[r].key+" | "+gr[r].description+" |