diff --git a/000_temp/44_class/03_uuid/main.go b/000_temp/44_class/03_uuid/main.go
index 73380fcc..b009522c 100644
--- a/000_temp/44_class/03_uuid/main.go
+++ b/000_temp/44_class/03_uuid/main.go
@@ -15,7 +15,7 @@ func main() {
func foo(w http.ResponseWriter, req *http.Request) {
c, err := req.Cookie("session")
if err != nil {
- sID := uuid.NewV4()
+ sID, _ := uuid.NewV4()
c = &http.Cookie{
Name: "session",
Value: sID.String(),
diff --git a/000_temp/44_class/04_session/main.go b/000_temp/44_class/04_session/main.go
index 121b4fc2..089b10de 100644
--- a/000_temp/44_class/04_session/main.go
+++ b/000_temp/44_class/04_session/main.go
@@ -29,7 +29,7 @@ func foo(w http.ResponseWriter, req *http.Request) {
// get cookie
c, err := req.Cookie("session")
if err != nil {
- sID := uuid.NewV4()
+ sID, _ := uuid.NewV4()
c = &http.Cookie{
Name: "session",
Value: sID.String(),
diff --git a/000_temp/44_class/07_hands-on_login/starting-code/main.go b/000_temp/44_class/07_hands-on_login/starting-code/main.go
index c1d54275..3840d71f 100644
--- a/000_temp/44_class/07_hands-on_login/starting-code/main.go
+++ b/000_temp/44_class/07_hands-on_login/starting-code/main.go
@@ -35,7 +35,7 @@ func index(w http.ResponseWriter, req *http.Request) {
// get cookie
c, err := req.Cookie("session")
if err != nil {
- sID := uuid.NewV4()
+ sID, _ := uuid.NewV4()
c = &http.Cookie{
Name: "session",
Value: sID.String(),
@@ -97,7 +97,7 @@ func login(w http.ResponseWriter, req *http.Request) {
return
}
// create a session
- sID := uuid.NewV4()
+ sID, _ := uuid.NewV4()
c := &http.Cookie{
Name: "session",
Value: sID.String(),
diff --git a/000_temp/44_class/11_hello-world/main.go b/000_temp/44_class/11_hello-world/main.go
index 40076ea6..7c091dc9 100644
--- a/000_temp/44_class/11_hello-world/main.go
+++ b/000_temp/44_class/11_hello-world/main.go
@@ -1,8 +1,8 @@
package main
import (
- "net/http"
"io"
+ "net/http"
)
func main() {
@@ -12,4 +12,4 @@ func main() {
func index(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Hello world")
-}
\ No newline at end of file
+}
diff --git a/000_temp/44_class/13_interface/cache/main.go b/000_temp/44_class/13_interface/cache/main.go
index d3459138..ed67f989 100644
--- a/000_temp/44_class/13_interface/cache/main.go
+++ b/000_temp/44_class/13_interface/cache/main.go
@@ -4,4 +4,3 @@ type Cache interface {
Set(k string, val interface{})
Get(k string) interface{}
}
-
diff --git a/000_temp/44_class/13_interface/main.go b/000_temp/44_class/13_interface/main.go
index f978b8a2..6875697f 100644
--- a/000_temp/44_class/13_interface/main.go
+++ b/000_temp/44_class/13_interface/main.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/GoesToEleven/golang-web-dev/000_temp/44_class/13_interface/memcache"
"github.com/GoesToEleven/golang-web-dev/000_temp/44_class/13_interface/cmd"
+ "github.com/GoesToEleven/golang-web-dev/000_temp/44_class/13_interface/memcache"
)
func main() {
diff --git a/000_temp/44_class/14_data-structure/main.go b/000_temp/44_class/14_data-structure/main.go
index b2a8ba8a..f26aa833 100644
--- a/000_temp/44_class/14_data-structure/main.go
+++ b/000_temp/44_class/14_data-structure/main.go
@@ -6,7 +6,7 @@ import (
type person struct {
first string
- last string
+ last string
}
type secretAgent struct {
@@ -47,4 +47,4 @@ func main() {
}
sa1.greeting()
sayMore(sa1)
-}
\ No newline at end of file
+}
diff --git a/000_temp/44_class/15/main.go b/000_temp/44_class/15/main.go
index 0afb9777..7106dd3f 100644
--- a/000_temp/44_class/15/main.go
+++ b/000_temp/44_class/15/main.go
@@ -1,9 +1,9 @@
package main
import (
- "net/http"
- "io"
"fmt"
+ "io"
+ "net/http"
)
func init() {
@@ -18,4 +18,4 @@ func main() {
func index(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Hello world")
-}
\ No newline at end of file
+}
diff --git a/000_temp/45_pagination/main.go b/000_temp/45_pagination/main.go
index b0a1ad50..966b6986 100644
--- a/000_temp/45_pagination/main.go
+++ b/000_temp/45_pagination/main.go
@@ -1,25 +1,24 @@
package main
import (
+ "fmt"
"html/template"
"net/http"
- "fmt"
"strconv"
)
type Env struct {
- Data []int
- From int
- To int
- Amount int
- ForwardStart int
+ Data []int
+ From int
+ To int
+ Amount int
+ ForwardStart int
BackwardStart int
}
var tpl *template.Template
var xi []int
-
func init() {
tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
}
@@ -62,7 +61,7 @@ func index(w http.ResponseWriter, r *http.Request) {
// then the next group of records would start at "to"
// but only if there are such records
var fs int
- if to + recordsPerPageToShow <= len(xi) {
+ if to+recordsPerPageToShow <= len(xi) {
fs = to
} else {
fs = len(xi) - recordsPerPageToShow
@@ -73,22 +72,22 @@ func index(w http.ResponseWriter, r *http.Request) {
// then the previous group of records would start at "from" minus ten (records shown)
// but only if there are such records
var bs int
- if from - recordsPerPageToShow >= 0 {
+ if from-recordsPerPageToShow >= 0 {
bs = from - recordsPerPageToShow
} else {
bs = 0
}
data := Env{
- Data: xx,
- From: from,
- To: to - 1,
- Amount: recordsPerPageToShow,
- ForwardStart: fs,
+ Data: xx,
+ From: from,
+ To: to - 1,
+ Amount: recordsPerPageToShow,
+ ForwardStart: fs,
BackwardStart: bs,
}
err = tpl.ExecuteTemplate(w, "index.gohtml", data)
if err != nil {
fmt.Println(err)
}
-}
\ No newline at end of file
+}
diff --git a/000_temp/46_sp17/01/main.go b/000_temp/46_sp17/01/main.go
index ad6e0c87..11327e8c 100644
--- a/000_temp/46_sp17/01/main.go
+++ b/000_temp/46_sp17/01/main.go
@@ -1,8 +1,8 @@
package main
import (
- "net/http"
"io"
+ "net/http"
)
func main() {
diff --git a/000_temp/46_sp17/02/main.go b/000_temp/46_sp17/02/main.go
index aebc7b46..e1479422 100644
--- a/000_temp/46_sp17/02/main.go
+++ b/000_temp/46_sp17/02/main.go
@@ -10,4 +10,4 @@ func main() {
func foo() {
fmt.Println("hello")
-}
\ No newline at end of file
+}
diff --git a/000_temp/46_sp17/03_handle_handler_handlefunc/01_handle/main.go b/000_temp/46_sp17/03_handle_handler_handlefunc/01_handle/main.go
index d04712f9..25d43891 100644
--- a/000_temp/46_sp17/03_handle_handler_handlefunc/01_handle/main.go
+++ b/000_temp/46_sp17/03_handle_handler_handlefunc/01_handle/main.go
@@ -1,13 +1,13 @@
package main
import (
- "net/http"
"io"
+ "net/http"
)
type hotdog int
-func(hotdog) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+func (hotdog) ServeHTTP(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Hello from hotdogger")
}
diff --git a/000_temp/46_sp17/03_handle_handler_handlefunc/02_handlefunc/main.go b/000_temp/46_sp17/03_handle_handler_handlefunc/02_handlefunc/main.go
index 5fe09f46..f21302b4 100644
--- a/000_temp/46_sp17/03_handle_handler_handlefunc/02_handlefunc/main.go
+++ b/000_temp/46_sp17/03_handle_handler_handlefunc/02_handlefunc/main.go
@@ -1,8 +1,8 @@
package main
import (
- "net/http"
"io"
+ "net/http"
)
func main() {
@@ -12,4 +12,4 @@ func main() {
func foo(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Hello from hotdiggity dogger")
-}
\ No newline at end of file
+}
diff --git a/000_temp/46_sp17/03_handle_handler_handlefunc/03_handlerfunc/main.go b/000_temp/46_sp17/03_handle_handler_handlefunc/03_handlerfunc/main.go
index 2951ffdd..a8448ce7 100644
--- a/000_temp/46_sp17/03_handle_handler_handlefunc/03_handlerfunc/main.go
+++ b/000_temp/46_sp17/03_handle_handler_handlefunc/03_handlerfunc/main.go
@@ -1,8 +1,8 @@
package main
import (
- "net/http"
"io"
+ "net/http"
)
func main() {
@@ -13,4 +13,3 @@ func main() {
func foo(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Holy diggity dogger")
}
-
diff --git a/000_temp/46_sp17/04/main.go b/000_temp/46_sp17/04/main.go
index e24da7ef..ecc7100c 100644
--- a/000_temp/46_sp17/04/main.go
+++ b/000_temp/46_sp17/04/main.go
@@ -3,6 +3,6 @@ package main
import "fmt"
func main() {
- m := map[string]int{"Bond":32, "Moneypenny": 24}
+ m := map[string]int{"Bond": 32, "Moneypenny": 24}
fmt.Println(m)
-}
\ No newline at end of file
+}
diff --git a/000_temp/46_sp17/05/main.go b/000_temp/46_sp17/05/main.go
index b3ae853c..d28c1f94 100644
--- a/000_temp/46_sp17/05/main.go
+++ b/000_temp/46_sp17/05/main.go
@@ -10,4 +10,4 @@ func main() {
func foo(x int) {
fmt.Println("hello", x)
-}
\ No newline at end of file
+}
diff --git a/000_temp/46_sp17/06/main.go b/000_temp/46_sp17/06/main.go
index ef271fa8..fc739a16 100644
--- a/000_temp/46_sp17/06/main.go
+++ b/000_temp/46_sp17/06/main.go
@@ -11,5 +11,5 @@ func main() {
}
func foo() {
- fmt.Println(z,z,z,z,z)
-}
\ No newline at end of file
+ fmt.Println(z, z, z, z, z)
+}
diff --git a/000_temp/46_sp17/07_bond/main.go b/000_temp/46_sp17/07_bond/main.go
index ae6a9395..7fa71c24 100644
--- a/000_temp/46_sp17/07_bond/main.go
+++ b/000_temp/46_sp17/07_bond/main.go
@@ -29,10 +29,9 @@ func foo(h human) {
fmt.Println("hello from foo")
}
-
func main() {
p1 := person{"Nina", "Simone", 25}
sa1 := secretAgent{person{"Ian", "Fleming", 42}, false}
foo(p1)
foo(sa1)
-}
\ No newline at end of file
+}
diff --git a/000_temp/46_sp17/08_notfound-notfoundhandler/main.go b/000_temp/46_sp17/08_notfound-notfoundhandler/main.go
index 9edc7563..22b89116 100644
--- a/000_temp/46_sp17/08_notfound-notfoundhandler/main.go
+++ b/000_temp/46_sp17/08_notfound-notfoundhandler/main.go
@@ -10,4 +10,4 @@ func main() {
func index(w http.ResponseWriter, r *http.Request) {
http.NotFound(w, r)
-}
\ No newline at end of file
+}
diff --git a/000_temp/46_sp17/09_fundamentals/01/main.go b/000_temp/46_sp17/09_fundamentals/01/main.go
index dedb4201..b8c285f4 100644
--- a/000_temp/46_sp17/09_fundamentals/01/main.go
+++ b/000_temp/46_sp17/09_fundamentals/01/main.go
@@ -15,4 +15,4 @@ func main() {
p2 := person{"Bond"}
p1.speak()
p2.speak()
-}
\ No newline at end of file
+}
diff --git a/000_temp/46_sp17/09_fundamentals/02/main.go b/000_temp/46_sp17/09_fundamentals/02/main.go
index c4e3f090..93acc138 100644
--- a/000_temp/46_sp17/09_fundamentals/02/main.go
+++ b/000_temp/46_sp17/09_fundamentals/02/main.go
@@ -3,17 +3,17 @@ package main
import "fmt"
func main() {
- xi := []int{4,3,5,7,3,4,5}
+ xi := []int{4, 3, 5, 7, 3, 4, 5}
fmt.Println(xi)
for i, v := range xi {
fmt.Println(i, v)
}
- m := map[string]int{"mcleod":42, "bond":32}
+ m := map[string]int{"mcleod": 42, "bond": 32}
fmt.Println(m)
for k, v := range m {
fmt.Println(k, v)
}
-}
\ No newline at end of file
+}
diff --git a/000_temp/46_sp17/09_fundamentals/03/main.go b/000_temp/46_sp17/09_fundamentals/03/main.go
index b747d020..a0670d16 100644
--- a/000_temp/46_sp17/09_fundamentals/03/main.go
+++ b/000_temp/46_sp17/09_fundamentals/03/main.go
@@ -2,7 +2,7 @@ package main
import "fmt"
-type human interface{
+type human interface {
speak()
}
@@ -33,4 +33,4 @@ func main() {
foo(p1)
foo(p2)
foo(c1)
-}
\ No newline at end of file
+}
diff --git a/000_temp/46_sp17/10_cli-input/main.go b/000_temp/46_sp17/10_cli-input/main.go
new file mode 100644
index 00000000..bf5cf1df
--- /dev/null
+++ b/000_temp/46_sp17/10_cli-input/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "fmt"
+ "os"
+)
+
+func main() {
+ fmt.Println("Are you human?")
+ fmt.Println("YES or NO")
+ var answer string
+ _, err := fmt.Scanf("%s", &answer)
+ if err != nil {
+ panic(err)
+ }
+ if answer != "YES" {
+ fmt.Println("You're not human! What?!?!")
+ os.Exit(0)
+ }
+ fmt.Println("I am glad you are human")
+}
diff --git a/000_temp/46_sp17/11/main.go b/000_temp/46_sp17/11/main.go
new file mode 100644
index 00000000..587e74d0
--- /dev/null
+++ b/000_temp/46_sp17/11/main.go
@@ -0,0 +1,15 @@
+package main
+
+import (
+ "fmt"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", foo)
+ http.ListenAndServe(":8080", nil)
+}
+
+func foo(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprint(w, "Hello from foo")
+}
diff --git a/000_temp/46_sp17/12/main.go b/000_temp/46_sp17/12/main.go
new file mode 100644
index 00000000..5ff7b320
--- /dev/null
+++ b/000_temp/46_sp17/12/main.go
@@ -0,0 +1,79 @@
+package main
+
+import (
+ "fmt"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.HandleFunc("/contact", contact)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprint(w, `
+
+
+
+ index
+
+
+
+Hello from index
+
+index
+about
+contact
+
+`)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprint(w, `
+
+
+
+ about
+
+
+
+Hello from about
+
+index
+about
+contact
+
+`)
+}
+
+func contact(w http.ResponseWriter, r *http.Request) {
+ fmt.Fprint(w, `
+
+
+
+ contact
+
+
+
+Hello from contact
+
+index
+about
+contact
+
+`)
+}
diff --git a/000_temp/46_sp17/13/main.go b/000_temp/46_sp17/13/main.go
new file mode 100644
index 00000000..5ea0c485
--- /dev/null
+++ b/000_temp/46_sp17/13/main.go
@@ -0,0 +1,31 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.HandleFunc("/contact", contact)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
+
+func contact(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "contact.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/13/templates/about.gohtml b/000_temp/46_sp17/13/templates/about.gohtml
new file mode 100644
index 00000000..16b2020b
--- /dev/null
+++ b/000_temp/46_sp17/13/templates/about.gohtml
@@ -0,0 +1,21 @@
+
+
+
+
+ About
+
+
+
+
+You are at about
+
+index
+about
+contact
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/13/templates/contact.gohtml b/000_temp/46_sp17/13/templates/contact.gohtml
new file mode 100644
index 00000000..f9044d6a
--- /dev/null
+++ b/000_temp/46_sp17/13/templates/contact.gohtml
@@ -0,0 +1,21 @@
+
+
+
+
+ Contact
+
+
+
+
+You are at Contact
+
+index
+about
+contact
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/13/templates/index.gohtml b/000_temp/46_sp17/13/templates/index.gohtml
new file mode 100644
index 00000000..7a5de2ce
--- /dev/null
+++ b/000_temp/46_sp17/13/templates/index.gohtml
@@ -0,0 +1,21 @@
+
+
+
+
+ Index
+
+
+
+
+You are at index
+
+index
+about
+contact
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/14/main.go b/000_temp/46_sp17/14/main.go
new file mode 100644
index 00000000..afff1f5d
--- /dev/null
+++ b/000_temp/46_sp17/14/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("template/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/14/template/index.gohtml b/000_temp/46_sp17/14/template/index.gohtml
new file mode 100644
index 00000000..14b4d345
--- /dev/null
+++ b/000_temp/46_sp17/14/template/index.gohtml
@@ -0,0 +1,17 @@
+
+
+
+
+ Index
+
+
+
+
+You are at index.
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/15/main.go b/000_temp/46_sp17/15/main.go
new file mode 100644
index 00000000..2b12224e
--- /dev/null
+++ b/000_temp/46_sp17/15/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("template/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", 42)
+}
diff --git a/000_temp/46_sp17/15/template/index.gohtml b/000_temp/46_sp17/15/template/index.gohtml
new file mode 100644
index 00000000..3ec9dff9
--- /dev/null
+++ b/000_temp/46_sp17/15/template/index.gohtml
@@ -0,0 +1,20 @@
+
+
+
+
+ Index
+
+
+
+
+You are at index.
+
+
+Here is the answer to the ultimate question: {{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/16/main.go b/000_temp/46_sp17/16/main.go
new file mode 100644
index 00000000..7d5f90b9
--- /dev/null
+++ b/000_temp/46_sp17/16/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("template/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", "Todd")
+}
diff --git a/000_temp/46_sp17/16/template/index.gohtml b/000_temp/46_sp17/16/template/index.gohtml
new file mode 100644
index 00000000..4b2183ff
--- /dev/null
+++ b/000_temp/46_sp17/16/template/index.gohtml
@@ -0,0 +1,21 @@
+
+
+
+
+ Index
+
+
+
+
+You are at index.
+
+
+Who is your daddy?
+{{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/17/main.go b/000_temp/46_sp17/17/main.go
new file mode 100644
index 00000000..ebb0316b
--- /dev/null
+++ b/000_temp/46_sp17/17/main.go
@@ -0,0 +1,30 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+type person struct {
+ First string
+ Age int
+}
+
+func init() {
+ tpl = template.Must(template.ParseGlob("template/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ p1 := person{
+ "Todd",
+ 45,
+ }
+ tpl.ExecuteTemplate(w, "index.gohtml", p1)
+}
diff --git a/000_temp/46_sp17/17/template/index.gohtml b/000_temp/46_sp17/17/template/index.gohtml
new file mode 100644
index 00000000..bb55b866
--- /dev/null
+++ b/000_temp/46_sp17/17/template/index.gohtml
@@ -0,0 +1,23 @@
+
+
+
+
+ Index
+
+
+
+
+You are at index.
+
+
+Who is your daddy?
+{{.First}}
+
+How old is he?
+{{.Age}}
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/18/main.go b/000_temp/46_sp17/18/main.go
new file mode 100644
index 00000000..5ea0c485
--- /dev/null
+++ b/000_temp/46_sp17/18/main.go
@@ -0,0 +1,31 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.HandleFunc("/contact", contact)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
+
+func contact(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "contact.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/18/templates/about.gohtml b/000_temp/46_sp17/18/templates/about.gohtml
new file mode 100644
index 00000000..16b2020b
--- /dev/null
+++ b/000_temp/46_sp17/18/templates/about.gohtml
@@ -0,0 +1,21 @@
+
+
+
+
+ About
+
+
+
+
+You are at about
+
+index
+about
+contact
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/18/templates/contact.gohtml b/000_temp/46_sp17/18/templates/contact.gohtml
new file mode 100644
index 00000000..f9044d6a
--- /dev/null
+++ b/000_temp/46_sp17/18/templates/contact.gohtml
@@ -0,0 +1,21 @@
+
+
+
+
+ Contact
+
+
+
+
+You are at Contact
+
+index
+about
+contact
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/18/templates/index.gohtml b/000_temp/46_sp17/18/templates/index.gohtml
new file mode 100644
index 00000000..7a5de2ce
--- /dev/null
+++ b/000_temp/46_sp17/18/templates/index.gohtml
@@ -0,0 +1,21 @@
+
+
+
+
+ Index
+
+
+
+
+You are at index
+
+index
+about
+contact
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/19/main.go b/000_temp/46_sp17/19/main.go
new file mode 100644
index 00000000..c525d24c
--- /dev/null
+++ b/000_temp/46_sp17/19/main.go
@@ -0,0 +1,26 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/foo", foo)
+ http.HandleFunc("/bar/", bar)
+ http.Handle("/favicon.ico", http.NotFoundHandler())
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, "hello from index")
+}
+
+func foo(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, "hello from foo")
+}
+
+func bar(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, "hello from bar")
+}
diff --git a/000_temp/46_sp17/20-string-int/main.go b/000_temp/46_sp17/20-string-int/main.go
new file mode 100644
index 00000000..5376afb5
--- /dev/null
+++ b/000_temp/46_sp17/20-string-int/main.go
@@ -0,0 +1,27 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.Handle("/favicon.ico", http.NotFoundHandler())
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", "Heeeeeelllooo world, yeeeee-ha!")
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", 42)
+}
diff --git a/000_temp/46_sp17/20-string-int/templates/about.gohtml b/000_temp/46_sp17/20-string-int/templates/about.gohtml
new file mode 100644
index 00000000..23817c97
--- /dev/null
+++ b/000_temp/46_sp17/20-string-int/templates/about.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+ About
+
+
+
+You are at about
+
+{{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/20-string-int/templates/index.gohtml b/000_temp/46_sp17/20-string-int/templates/index.gohtml
new file mode 100644
index 00000000..2a8854d4
--- /dev/null
+++ b/000_temp/46_sp17/20-string-int/templates/index.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+ Index
+
+
+
+You are at index
+
+{{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/21-struct-slice-map/main.go b/000_temp/46_sp17/21-struct-slice-map/main.go
new file mode 100644
index 00000000..d9535c9f
--- /dev/null
+++ b/000_temp/46_sp17/21-struct-slice-map/main.go
@@ -0,0 +1,47 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+type person struct {
+ First string
+ Last string
+}
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.HandleFunc("/contact", contact)
+ http.Handle("/favicon.ico", http.NotFoundHandler())
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ p1 := person{
+ "James",
+ "Bond",
+ }
+
+ tpl.ExecuteTemplate(w, "index.gohtml", p1)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ xi := []int{3, 5, 7, 9, 17, 749}
+ tpl.ExecuteTemplate(w, "about.gohtml", xi)
+}
+
+func contact(w http.ResponseWriter, r *http.Request) {
+ m := map[string]int{
+ "James": 32,
+ "Moneypenny": 24,
+ }
+ tpl.ExecuteTemplate(w, "contact.gohtml", m)
+}
diff --git a/000_temp/46_sp17/21-struct-slice-map/templates/about.gohtml b/000_temp/46_sp17/21-struct-slice-map/templates/about.gohtml
new file mode 100644
index 00000000..6c4fc55b
--- /dev/null
+++ b/000_temp/46_sp17/21-struct-slice-map/templates/about.gohtml
@@ -0,0 +1,17 @@
+
+
+
+
+ About
+
+
+
+You are at about
+
+CURRENT DATA: {{.}}
+{{range .}}
+IN LOOP DATA: {{.}}
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/21-struct-slice-map/templates/contact.gohtml b/000_temp/46_sp17/21-struct-slice-map/templates/contact.gohtml
new file mode 100644
index 00000000..a2da4bc5
--- /dev/null
+++ b/000_temp/46_sp17/21-struct-slice-map/templates/contact.gohtml
@@ -0,0 +1,17 @@
+
+
+
+
+ Contact
+
+
+
+You are at contact
+
+CURRENT DATA: {{.}}
+{{range $name, $age := .}}
+IN LOOP DATA: {{$name}} {{$age}}
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/21-struct-slice-map/templates/index.gohtml b/000_temp/46_sp17/21-struct-slice-map/templates/index.gohtml
new file mode 100644
index 00000000..d3b6734d
--- /dev/null
+++ b/000_temp/46_sp17/21-struct-slice-map/templates/index.gohtml
@@ -0,0 +1,16 @@
+
+
+
+
+ Index
+
+
+
+You are at index
+
+{{.}}
+{{.First}}
+{{.Last}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/22/main.go b/000_temp/46_sp17/22/main.go
new file mode 100644
index 00000000..863dea11
--- /dev/null
+++ b/000_temp/46_sp17/22/main.go
@@ -0,0 +1,28 @@
+package main
+
+import "fmt"
+
+func main() {
+ var answer1, answer2, answer3 string
+
+ fmt.Print("Name: ")
+ _, err := fmt.Scan(&answer1)
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Print("Fav Food: ")
+ _, err = fmt.Scan(&answer2)
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Print("Fav Sport: ")
+ _, err = fmt.Scan(&answer3)
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Println(answer1, answer2, answer3)
+
+}
diff --git a/000_temp/46_sp17/23/main.go b/000_temp/46_sp17/23/main.go
new file mode 100644
index 00000000..95eb597b
--- /dev/null
+++ b/000_temp/46_sp17/23/main.go
@@ -0,0 +1,15 @@
+package main
+
+import (
+ "fmt"
+ "os"
+)
+
+func main() {
+ // enter arguments when running program
+ // eg, go run main.go todd pizza surfing
+
+ for i, v := range os.Args {
+ fmt.Println(i, v)
+ }
+}
diff --git a/000_temp/46_sp17/24_ParseGlob/main.go b/000_temp/46_sp17/24_ParseGlob/main.go
new file mode 100644
index 00000000..c2a98bf6
--- /dev/null
+++ b/000_temp/46_sp17/24_ParseGlob/main.go
@@ -0,0 +1,34 @@
+package main
+
+import (
+ "log"
+ "os"
+ "text/template"
+)
+
+func main() {
+ tpl, err := template.ParseGlob("templates/*/*.gohtml")
+ if err != nil {
+ log.Fatalln(err)
+ }
+
+ err = tpl.Execute(os.Stdout, nil)
+ if err != nil {
+ log.Fatalln(err)
+ }
+
+ err = tpl.ExecuteTemplate(os.Stdout, "vespa.gohtml", nil)
+ if err != nil {
+ log.Fatalln(err)
+ }
+
+ err = tpl.ExecuteTemplate(os.Stdout, "two.gohtml", nil)
+ if err != nil {
+ log.Fatalln(err)
+ }
+
+ err = tpl.ExecuteTemplate(os.Stdout, "one.gohtml", nil)
+ if err != nil {
+ log.Fatalln(err)
+ }
+}
diff --git a/000_temp/46_sp17/24_ParseGlob/templates/cats/vespa.gohtml b/000_temp/46_sp17/24_ParseGlob/templates/cats/vespa.gohtml
new file mode 100644
index 00000000..85e72327
--- /dev/null
+++ b/000_temp/46_sp17/24_ParseGlob/templates/cats/vespa.gohtml
@@ -0,0 +1,3 @@
+******
+VESPA
+******
\ No newline at end of file
diff --git a/000_temp/46_sp17/24_ParseGlob/templates/dogs/two.gohtml b/000_temp/46_sp17/24_ParseGlob/templates/dogs/two.gohtml
new file mode 100644
index 00000000..0c1c0a05
--- /dev/null
+++ b/000_temp/46_sp17/24_ParseGlob/templates/dogs/two.gohtml
@@ -0,0 +1,3 @@
+******
+TWO
+******
\ No newline at end of file
diff --git a/000_temp/46_sp17/24_ParseGlob/templates/mice/one.gohtml b/000_temp/46_sp17/24_ParseGlob/templates/mice/one.gohtml
new file mode 100644
index 00000000..58420cdd
--- /dev/null
+++ b/000_temp/46_sp17/24_ParseGlob/templates/mice/one.gohtml
@@ -0,0 +1,3 @@
+******
+ONE
+******
\ No newline at end of file
diff --git a/000_temp/46_sp17/25/main.go b/000_temp/46_sp17/25/main.go
new file mode 100644
index 00000000..d9d91707
--- /dev/null
+++ b/000_temp/46_sp17/25/main.go
@@ -0,0 +1,26 @@
+package main
+
+import (
+ "net/http"
+ "text/template"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/25/templates/about.gohtml b/000_temp/46_sp17/25/templates/about.gohtml
new file mode 100644
index 00000000..cdc1ed08
--- /dev/null
+++ b/000_temp/46_sp17/25/templates/about.gohtml
@@ -0,0 +1,12 @@
+
+
+
+
+ About
+
+
+
+www.greatercommons.com
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/25/templates/index.gohtml b/000_temp/46_sp17/25/templates/index.gohtml
new file mode 100644
index 00000000..4d80a06b
--- /dev/null
+++ b/000_temp/46_sp17/25/templates/index.gohtml
@@ -0,0 +1,12 @@
+
+
+
+
+ Index
+
+
+
+Welcome to our website!
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/26/main.go b/000_temp/46_sp17/26/main.go
new file mode 100644
index 00000000..4f6bcfc5
--- /dev/null
+++ b/000_temp/46_sp17/26/main.go
@@ -0,0 +1,26 @@
+package main
+
+import (
+ "net/http"
+ "text/template"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", false)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/26/templates/about.gohtml b/000_temp/46_sp17/26/templates/about.gohtml
new file mode 100644
index 00000000..cdc1ed08
--- /dev/null
+++ b/000_temp/46_sp17/26/templates/about.gohtml
@@ -0,0 +1,12 @@
+
+
+
+
+ About
+
+
+
+www.greatercommons.com
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/26/templates/index.gohtml b/000_temp/46_sp17/26/templates/index.gohtml
new file mode 100644
index 00000000..f4d4af6e
--- /dev/null
+++ b/000_temp/46_sp17/26/templates/index.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+ Index
+
+
+
+{{if .}}
+Welcome to our website!
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/27/main.go b/000_temp/46_sp17/27/main.go
new file mode 100644
index 00000000..a5a04a21
--- /dev/null
+++ b/000_temp/46_sp17/27/main.go
@@ -0,0 +1,30 @@
+package main
+
+import (
+ "net/http"
+ "text/template"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ m := map[string]bool{}
+ m["Vince"] = true
+ m["eddie"] = true
+ m["G"] = true
+ tpl.ExecuteTemplate(w, "index.gohtml", m)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/27/templates/about.gohtml b/000_temp/46_sp17/27/templates/about.gohtml
new file mode 100644
index 00000000..cdc1ed08
--- /dev/null
+++ b/000_temp/46_sp17/27/templates/about.gohtml
@@ -0,0 +1,12 @@
+
+
+
+
+ About
+
+
+
+www.greatercommons.com
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/27/templates/index.gohtml b/000_temp/46_sp17/27/templates/index.gohtml
new file mode 100644
index 00000000..c9d7cd96
--- /dev/null
+++ b/000_temp/46_sp17/27/templates/index.gohtml
@@ -0,0 +1,17 @@
+
+
+
+
+ Index
+
+
+
+{{if .}}
+ Welcome to our website!
+ {{range $k, $v := .}}
+ {{$k}} - {{$v}}
+ {{end}}
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/28/main.go b/000_temp/46_sp17/28/main.go
new file mode 100644
index 00000000..9823dd23
--- /dev/null
+++ b/000_temp/46_sp17/28/main.go
@@ -0,0 +1,36 @@
+package main
+
+import (
+ "net/http"
+ "text/template"
+)
+
+type person struct {
+ Name string
+ Prefs []string
+}
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ p1 := person{"bond", []string{"martinis", "shaken not stirred", "fast cars", "intelligence"}}
+ p2 := person{"moneypenny", []string{"bond"}}
+ p3 := person{"Q", []string{"gadgets", "bond"}}
+ xp := []person{p1, p2, p3}
+
+ tpl.ExecuteTemplate(w, "index.gohtml", xp)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/28/templates/about.gohtml b/000_temp/46_sp17/28/templates/about.gohtml
new file mode 100644
index 00000000..cdc1ed08
--- /dev/null
+++ b/000_temp/46_sp17/28/templates/about.gohtml
@@ -0,0 +1,12 @@
+
+
+
+
+ About
+
+
+
+www.greatercommons.com
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/28/templates/index.gohtml b/000_temp/46_sp17/28/templates/index.gohtml
new file mode 100644
index 00000000..c6d5fa96
--- /dev/null
+++ b/000_temp/46_sp17/28/templates/index.gohtml
@@ -0,0 +1,22 @@
+
+
+
+
+ Index
+
+
+
+Welcome to our website!
+{{if .}}
+ {{range .}}
+ {{.Name}}
+
+ {{range .Prefs}}
+ {{.}}
+ {{end}}
+
+ {{end}}
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/29_ServeFile/main.go b/000_temp/46_sp17/29_ServeFile/main.go
new file mode 100644
index 00000000..0fcf14e6
--- /dev/null
+++ b/000_temp/46_sp17/29_ServeFile/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", dog)
+ http.HandleFunc("/toby.jpg", dogPic)
+ http.ListenAndServe(":8080", nil)
+}
+
+func dog(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ io.WriteString(w, ` `)
+}
+
+func dogPic(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "public/img/toby.jpg")
+}
diff --git a/000_temp/46_sp17/29_ServeFile/public/img/toby.jpg b/000_temp/46_sp17/29_ServeFile/public/img/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/46_sp17/29_ServeFile/public/img/toby.jpg differ
diff --git a/000_temp/46_sp17/30_fileserver/assets/resources/toby.jpg b/000_temp/46_sp17/30_fileserver/assets/resources/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/46_sp17/30_fileserver/assets/resources/toby.jpg differ
diff --git a/000_temp/46_sp17/30_fileserver/main.go b/000_temp/46_sp17/30_fileserver/main.go
new file mode 100644
index 00000000..b2bdb36c
--- /dev/null
+++ b/000_temp/46_sp17/30_fileserver/main.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", dog)
+ http.Handle("/resources/", http.FileServer(http.Dir("./assets")))
+ http.ListenAndServe(":8080", nil)
+}
+
+func dog(w http.ResponseWriter, req *http.Request) {
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ io.WriteString(w, ` `)
+}
diff --git a/000_temp/46_sp17/31_fileserver-strip-prefix/assets/toby.jpg b/000_temp/46_sp17/31_fileserver-strip-prefix/assets/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/46_sp17/31_fileserver-strip-prefix/assets/toby.jpg differ
diff --git a/000_temp/46_sp17/31_fileserver-strip-prefix/main.go b/000_temp/46_sp17/31_fileserver-strip-prefix/main.go
new file mode 100644
index 00000000..2e190205
--- /dev/null
+++ b/000_temp/46_sp17/31_fileserver-strip-prefix/main.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", dog)
+ http.Handle("/resources/", http.StripPrefix("/resources", http.FileServer(http.Dir("./assets"))))
+ http.ListenAndServe(":8080", nil)
+}
+
+func dog(w http.ResponseWriter, req *http.Request) {
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ io.WriteString(w, ` `)
+}
diff --git a/000_temp/46_sp17/32_fileserver-strip-prefix/assets/toby.jpg b/000_temp/46_sp17/32_fileserver-strip-prefix/assets/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/46_sp17/32_fileserver-strip-prefix/assets/toby.jpg differ
diff --git a/000_temp/46_sp17/32_fileserver-strip-prefix/main.go b/000_temp/46_sp17/32_fileserver-strip-prefix/main.go
new file mode 100644
index 00000000..09d9001b
--- /dev/null
+++ b/000_temp/46_sp17/32_fileserver-strip-prefix/main.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", dog)
+ http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(http.Dir("./assets"))))
+ http.ListenAndServe(":8080", nil)
+}
+
+func dog(w http.ResponseWriter, req *http.Request) {
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ io.WriteString(w, ` `)
+}
diff --git a/000_temp/46_sp17/33_fileserver/assets/assets/toby.jpg b/000_temp/46_sp17/33_fileserver/assets/assets/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/46_sp17/33_fileserver/assets/assets/toby.jpg differ
diff --git a/000_temp/46_sp17/33_fileserver/main.go b/000_temp/46_sp17/33_fileserver/main.go
new file mode 100644
index 00000000..f169d01f
--- /dev/null
+++ b/000_temp/46_sp17/33_fileserver/main.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", dog)
+ http.Handle("/assets/", http.FileServer(http.Dir("./assets")))
+ http.ListenAndServe(":8080", nil)
+}
+
+func dog(w http.ResponseWriter, req *http.Request) {
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ io.WriteString(w, ` `)
+}
diff --git a/000_temp/46_sp17/34_ServeFile/main.go b/000_temp/46_sp17/34_ServeFile/main.go
new file mode 100644
index 00000000..eda4fedc
--- /dev/null
+++ b/000_temp/46_sp17/34_ServeFile/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/toby.jpg", toby)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ io.WriteString(w, ` `)
+}
+
+func toby(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "toby.jpg")
+}
diff --git a/000_temp/46_sp17/34_ServeFile/toby.jpg b/000_temp/46_sp17/34_ServeFile/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/46_sp17/34_ServeFile/toby.jpg differ
diff --git a/000_temp/46_sp17/35_ServeFile/main.go b/000_temp/46_sp17/35_ServeFile/main.go
new file mode 100644
index 00000000..5c10c696
--- /dev/null
+++ b/000_temp/46_sp17/35_ServeFile/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/toby.jpg", tobers)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ io.WriteString(w, ` `)
+}
+
+func tobers(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "toby.jpg")
+}
diff --git a/000_temp/46_sp17/35_ServeFile/toby.jpg b/000_temp/46_sp17/35_ServeFile/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/46_sp17/35_ServeFile/toby.jpg differ
diff --git a/000_temp/46_sp17/36_ServeFile/main.go b/000_temp/46_sp17/36_ServeFile/main.go
new file mode 100644
index 00000000..aa5347f5
--- /dev/null
+++ b/000_temp/46_sp17/36_ServeFile/main.go
@@ -0,0 +1,38 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/public/css/main.css", css)
+ http.HandleFunc("/public/img/bali.jpg", bali)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ io.WriteString(w, `
+
+
+
+ Title
+
+
+
+
+HELLO WORLD!
+
+
+`)
+}
+
+func css(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "public/css/main.css")
+}
+
+func bali(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "public/img/bali.jpg")
+}
diff --git a/000_temp/46_sp17/36_ServeFile/public/css/main.css b/000_temp/46_sp17/36_ServeFile/public/css/main.css
new file mode 100644
index 00000000..04d1e5c5
--- /dev/null
+++ b/000_temp/46_sp17/36_ServeFile/public/css/main.css
@@ -0,0 +1,21 @@
+html, body {
+ padding: 0;
+ border: 0;
+ margin: 0;
+}
+
+body {
+ height: 100vh;
+ display: flex;
+ flex-flow: row nowrap;
+ justify-content: center;
+ align-items: center;
+ background-image: url("http://github.com/img/bali.jpg");
+ background-repeat: no-repeat;
+ background-size: cover;
+}
+
+h1 {
+ font-size: 10rem;
+ color: gold;
+}
\ No newline at end of file
diff --git a/000_temp/46_sp17/36_ServeFile/public/img/bali.jpg b/000_temp/46_sp17/36_ServeFile/public/img/bali.jpg
new file mode 100644
index 00000000..9bc69e73
Binary files /dev/null and b/000_temp/46_sp17/36_ServeFile/public/img/bali.jpg differ
diff --git a/000_temp/46_sp17/37_FileServer/assets/css/main.css b/000_temp/46_sp17/37_FileServer/assets/css/main.css
new file mode 100644
index 00000000..04d1e5c5
--- /dev/null
+++ b/000_temp/46_sp17/37_FileServer/assets/css/main.css
@@ -0,0 +1,21 @@
+html, body {
+ padding: 0;
+ border: 0;
+ margin: 0;
+}
+
+body {
+ height: 100vh;
+ display: flex;
+ flex-flow: row nowrap;
+ justify-content: center;
+ align-items: center;
+ background-image: url("http://github.com/img/bali.jpg");
+ background-repeat: no-repeat;
+ background-size: cover;
+}
+
+h1 {
+ font-size: 10rem;
+ color: gold;
+}
\ No newline at end of file
diff --git a/000_temp/46_sp17/37_FileServer/assets/img/bali.jpg b/000_temp/46_sp17/37_FileServer/assets/img/bali.jpg
new file mode 100644
index 00000000..9bc69e73
Binary files /dev/null and b/000_temp/46_sp17/37_FileServer/assets/img/bali.jpg differ
diff --git a/000_temp/46_sp17/37_FileServer/main.go b/000_temp/46_sp17/37_FileServer/main.go
new file mode 100644
index 00000000..56e70d61
--- /dev/null
+++ b/000_temp/46_sp17/37_FileServer/main.go
@@ -0,0 +1,38 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.Handle("/public/", http.StripPrefix("/public", http.FileServer(http.Dir("assets"))))
+
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "text/html; charset=utf-8")
+ io.WriteString(w, `
+
+
+
+ Title
+
+
+
+
+HELLO WORLD!
+
+
+`)
+}
+
+func css(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "public/css/main.css")
+}
+
+func bali(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "public/img/bali.jpg")
+}
diff --git a/000_temp/46_sp17/38_template/assets/css/main.css b/000_temp/46_sp17/38_template/assets/css/main.css
new file mode 100644
index 00000000..04d1e5c5
--- /dev/null
+++ b/000_temp/46_sp17/38_template/assets/css/main.css
@@ -0,0 +1,21 @@
+html, body {
+ padding: 0;
+ border: 0;
+ margin: 0;
+}
+
+body {
+ height: 100vh;
+ display: flex;
+ flex-flow: row nowrap;
+ justify-content: center;
+ align-items: center;
+ background-image: url("http://github.com/img/bali.jpg");
+ background-repeat: no-repeat;
+ background-size: cover;
+}
+
+h1 {
+ font-size: 10rem;
+ color: gold;
+}
\ No newline at end of file
diff --git a/000_temp/46_sp17/38_template/assets/img/bali.jpg b/000_temp/46_sp17/38_template/assets/img/bali.jpg
new file mode 100644
index 00000000..9bc69e73
Binary files /dev/null and b/000_temp/46_sp17/38_template/assets/img/bali.jpg differ
diff --git a/000_temp/46_sp17/38_template/main.go b/000_temp/46_sp17/38_template/main.go
new file mode 100644
index 00000000..abdfb445
--- /dev/null
+++ b/000_temp/46_sp17/38_template/main.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.Handle("/public/", http.StripPrefix("/public", http.FileServer(http.Dir("assets"))))
+
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/38_template/templates/index.gohtml b/000_temp/46_sp17/38_template/templates/index.gohtml
new file mode 100644
index 00000000..091037d5
--- /dev/null
+++ b/000_temp/46_sp17/38_template/templates/index.gohtml
@@ -0,0 +1,13 @@
+
+
+
+
+ Title
+
+
+
+
+HELLO WORLD!
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/39_template-vars/assets/css/main.css b/000_temp/46_sp17/39_template-vars/assets/css/main.css
new file mode 100644
index 00000000..04d1e5c5
--- /dev/null
+++ b/000_temp/46_sp17/39_template-vars/assets/css/main.css
@@ -0,0 +1,21 @@
+html, body {
+ padding: 0;
+ border: 0;
+ margin: 0;
+}
+
+body {
+ height: 100vh;
+ display: flex;
+ flex-flow: row nowrap;
+ justify-content: center;
+ align-items: center;
+ background-image: url("http://github.com/img/bali.jpg");
+ background-repeat: no-repeat;
+ background-size: cover;
+}
+
+h1 {
+ font-size: 10rem;
+ color: gold;
+}
\ No newline at end of file
diff --git a/000_temp/46_sp17/39_template-vars/assets/img/bali.jpg b/000_temp/46_sp17/39_template-vars/assets/img/bali.jpg
new file mode 100644
index 00000000..9bc69e73
Binary files /dev/null and b/000_temp/46_sp17/39_template-vars/assets/img/bali.jpg differ
diff --git a/000_temp/46_sp17/39_template-vars/main.go b/000_temp/46_sp17/39_template-vars/main.go
new file mode 100644
index 00000000..105277f2
--- /dev/null
+++ b/000_temp/46_sp17/39_template-vars/main.go
@@ -0,0 +1,29 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/vars", vars)
+ http.Handle("/public/", http.StripPrefix("/public", http.FileServer(http.Dir("assets"))))
+
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func vars(w http.ResponseWriter, r *http.Request) {
+ xs := []string{"James", "Moneypenny", "Q", "M"}
+ tpl.ExecuteTemplate(w, "vars.gohtml", xs)
+}
diff --git a/000_temp/46_sp17/39_template-vars/templates/index.gohtml b/000_temp/46_sp17/39_template-vars/templates/index.gohtml
new file mode 100644
index 00000000..091037d5
--- /dev/null
+++ b/000_temp/46_sp17/39_template-vars/templates/index.gohtml
@@ -0,0 +1,13 @@
+
+
+
+
+ Title
+
+
+
+
+HELLO WORLD!
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/39_template-vars/templates/vars.gohtml b/000_temp/46_sp17/39_template-vars/templates/vars.gohtml
new file mode 100644
index 00000000..f9df8efa
--- /dev/null
+++ b/000_temp/46_sp17/39_template-vars/templates/vars.gohtml
@@ -0,0 +1,19 @@
+
+
+
+
+ Title
+
+
+
+
+{{range .}}
+{{.}}
+{{end}}
+
+{{range $index, $value := .}}
+{{$index}} {{$value}}
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/40_NotFoundHandler/main.go b/000_temp/46_sp17/40_NotFoundHandler/main.go
new file mode 100644
index 00000000..64e8e815
--- /dev/null
+++ b/000_temp/46_sp17/40_NotFoundHandler/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "fmt"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", foo)
+ http.Handle("/favicon.ico", http.NotFoundHandler())
+ http.ListenAndServe(":8080", nil)
+}
+
+func foo(w http.ResponseWriter, req *http.Request) {
+ if req.URL.Path != "/" {
+ http.NotFound(w, req)
+ return
+ }
+ fmt.Println(req.URL.Path)
+ fmt.Fprintln(w, "go look at your terminal")
+}
diff --git a/000_temp/46_sp17/41_html-form/index.html b/000_temp/46_sp17/41_html-form/index.html
new file mode 100644
index 00000000..e8180712
--- /dev/null
+++ b/000_temp/46_sp17/41_html-form/index.html
@@ -0,0 +1,12 @@
+
+
+
+
+ Title
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/42_cookie/01/main.go b/000_temp/46_sp17/42_cookie/01/main.go
new file mode 100644
index 00000000..ce846b2d
--- /dev/null
+++ b/000_temp/46_sp17/42_cookie/01/main.go
@@ -0,0 +1,59 @@
+package main
+
+import (
+ "fmt"
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/dog/bowzer", bowzer)
+ http.HandleFunc("/dog/bowzer/pictures", bowzerpics)
+ http.HandleFunc("/cat", cat)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ var c *http.Cookie
+ c, err := r.Cookie("user-cookie")
+ if err != nil {
+ fmt.Println(err)
+ fmt.Printf("%T\n", c)
+ }
+ tpl.ExecuteTemplate(w, "index.gohtml", c)
+}
+
+func bowzer(w http.ResponseWriter, r *http.Request) {
+ c := &http.Cookie{
+ Name: "user-cookie",
+ Value: "this would be the value",
+ Path: "/dog/bowzer",
+ }
+ http.SetCookie(w, c)
+ tpl.ExecuteTemplate(w, "bowzer.gohtml", c)
+}
+
+func bowzerpics(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("user-cookie")
+ if err != nil {
+ fmt.Println(err)
+ fmt.Printf("%T\n", c)
+ }
+ tpl.ExecuteTemplate(w, "bowzerpics.gohtml", c)
+}
+
+func cat(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("user-cookie")
+ if err != nil {
+ fmt.Println(err)
+ fmt.Printf("%T\n", c)
+ }
+ tpl.ExecuteTemplate(w, "cat.gohtml", c)
+}
diff --git a/000_temp/46_sp17/42_cookie/01/templates/bowzer.gohtml b/000_temp/46_sp17/42_cookie/01/templates/bowzer.gohtml
new file mode 100644
index 00000000..55eca3fc
--- /dev/null
+++ b/000_temp/46_sp17/42_cookie/01/templates/bowzer.gohtml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ Bowzer
+
+
+
+Bowzer
+
+
+{{if .}}
+Here is the cookie
+Name: {{.Name}}
+Value: {{.Value}}
+Path: {{.Path}}
+{{else}}
+There is no cookie
+{{end}}
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/42_cookie/01/templates/bowzerpics.gohtml b/000_temp/46_sp17/42_cookie/01/templates/bowzerpics.gohtml
new file mode 100644
index 00000000..d97a5bfa
--- /dev/null
+++ b/000_temp/46_sp17/42_cookie/01/templates/bowzerpics.gohtml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ Bowzer Pics
+
+
+
+Bowzer Pics
+
+{{if .}}
+Here is the cookie
+Name: {{.Name}}
+Value: {{.Value}}
+Path: {{.Path}}
+{{else}}
+There is no cookie
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/42_cookie/01/templates/cat.gohtml b/000_temp/46_sp17/42_cookie/01/templates/cat.gohtml
new file mode 100644
index 00000000..0629e8ad
--- /dev/null
+++ b/000_temp/46_sp17/42_cookie/01/templates/cat.gohtml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ Cat
+
+
+
+Cat
+
+{{if .}}
+Here is the cookie
+Name: {{.Name}}
+Value: {{.Value}}
+Path: {{.Path}}
+{{else}}
+There is no cookie
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/42_cookie/01/templates/index.gohtml b/000_temp/46_sp17/42_cookie/01/templates/index.gohtml
new file mode 100644
index 00000000..3da06dc0
--- /dev/null
+++ b/000_temp/46_sp17/42_cookie/01/templates/index.gohtml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ Document
+
+
+
+Index
+
+{{if .}}
+Here is the cookie
+Name: {{.Name}}
+Value: {{.Value}}
+Path: {{.Path}}
+{{else}}
+There is no cookie
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/42_cookie/02/main.go b/000_temp/46_sp17/42_cookie/02/main.go
new file mode 100644
index 00000000..bb9726b8
--- /dev/null
+++ b/000_temp/46_sp17/42_cookie/02/main.go
@@ -0,0 +1,59 @@
+package main
+
+import (
+ "fmt"
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/dog/bowzer", bowzer)
+ http.HandleFunc("/dog/bowzer/pictures", bowzerpics)
+ http.HandleFunc("/cat", cat)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ var c *http.Cookie
+ c, err := r.Cookie("user-cookie")
+ if err != nil {
+ fmt.Println(err)
+ fmt.Printf("%T\n", c)
+ }
+ tpl.ExecuteTemplate(w, "index.gohtml", c)
+}
+
+func bowzer(w http.ResponseWriter, r *http.Request) {
+ c := &http.Cookie{
+ Name: "user-cookie",
+ Value: "this would be the value",
+ Path: "/",
+ }
+ http.SetCookie(w, c)
+ tpl.ExecuteTemplate(w, "bowzer.gohtml", c)
+}
+
+func bowzerpics(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("user-cookie")
+ if err != nil {
+ fmt.Println(err)
+ fmt.Printf("%T\n", c)
+ }
+ tpl.ExecuteTemplate(w, "bowzerpics.gohtml", c)
+}
+
+func cat(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("user-cookie")
+ if err != nil {
+ fmt.Println(err)
+ fmt.Printf("%T\n", c)
+ }
+ tpl.ExecuteTemplate(w, "cat.gohtml", c)
+}
diff --git a/000_temp/46_sp17/42_cookie/02/templates/bowzer.gohtml b/000_temp/46_sp17/42_cookie/02/templates/bowzer.gohtml
new file mode 100644
index 00000000..55eca3fc
--- /dev/null
+++ b/000_temp/46_sp17/42_cookie/02/templates/bowzer.gohtml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ Bowzer
+
+
+
+Bowzer
+
+
+{{if .}}
+Here is the cookie
+Name: {{.Name}}
+Value: {{.Value}}
+Path: {{.Path}}
+{{else}}
+There is no cookie
+{{end}}
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/42_cookie/02/templates/bowzerpics.gohtml b/000_temp/46_sp17/42_cookie/02/templates/bowzerpics.gohtml
new file mode 100644
index 00000000..d97a5bfa
--- /dev/null
+++ b/000_temp/46_sp17/42_cookie/02/templates/bowzerpics.gohtml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ Bowzer Pics
+
+
+
+Bowzer Pics
+
+{{if .}}
+Here is the cookie
+Name: {{.Name}}
+Value: {{.Value}}
+Path: {{.Path}}
+{{else}}
+There is no cookie
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/42_cookie/02/templates/cat.gohtml b/000_temp/46_sp17/42_cookie/02/templates/cat.gohtml
new file mode 100644
index 00000000..0629e8ad
--- /dev/null
+++ b/000_temp/46_sp17/42_cookie/02/templates/cat.gohtml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ Cat
+
+
+
+Cat
+
+{{if .}}
+Here is the cookie
+Name: {{.Name}}
+Value: {{.Value}}
+Path: {{.Path}}
+{{else}}
+There is no cookie
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/42_cookie/02/templates/index.gohtml b/000_temp/46_sp17/42_cookie/02/templates/index.gohtml
new file mode 100644
index 00000000..3da06dc0
--- /dev/null
+++ b/000_temp/46_sp17/42_cookie/02/templates/index.gohtml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+ Document
+
+
+
+Index
+
+{{if .}}
+Here is the cookie
+Name: {{.Name}}
+Value: {{.Value}}
+Path: {{.Path}}
+{{else}}
+There is no cookie
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/43_cookie/main.go b/000_temp/46_sp17/43_cookie/main.go
new file mode 100644
index 00000000..6f35e088
--- /dev/null
+++ b/000_temp/46_sp17/43_cookie/main.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "github.com/satori/go.uuid"
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("session")
+ if err != nil {
+ u := uuid.NewV4()
+ c = &http.Cookie{
+ Name: "session",
+ Value: u.String(),
+ Path: "/",
+ HttpOnly: true,
+ }
+ }
+ http.SetCookie(w, c)
+ tpl.ExecuteTemplate(w, "index.gohtml", c)
+}
diff --git a/000_temp/46_sp17/43_cookie/templates/index.gohtml b/000_temp/46_sp17/43_cookie/templates/index.gohtml
new file mode 100644
index 00000000..34d82136
--- /dev/null
+++ b/000_temp/46_sp17/43_cookie/templates/index.gohtml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+ INDEX PAGE
+
+
+
+You are at index
+
+{{if .}}
+The Entire Cookie: {{.}}
+Name {{.Name}}
+Value {{.Value}}
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/44_map/main.go b/000_temp/46_sp17/44_map/main.go
new file mode 100644
index 00000000..0cb04f35
--- /dev/null
+++ b/000_temp/46_sp17/44_map/main.go
@@ -0,0 +1,154 @@
+package main
+
+import (
+ "fmt"
+ "github.com/satori/go.uuid"
+ "html/template"
+ "net/http"
+)
+
+type user struct {
+ Id string
+ First string
+ Last string
+ Email string
+ Password string
+}
+
+var tpl *template.Template
+
+var muser = map[string]user{} // key is userid, value is user
+var msession = map[string]string{} // key is sessionid, value is userid
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/other", other)
+ http.HandleFunc("/login", login)
+ http.HandleFunc("/logout", logout)
+ http.HandleFunc("/signup", signup)
+ http.Handle("/favicon.ico", http.NotFoundHandler())
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("mysess")
+ if err != nil {
+ u := uuid.NewV4()
+ c = &http.Cookie{
+ Name: "mysess",
+ Value: u.String(),
+ Path: "/",
+ HttpOnly: true,
+ }
+ }
+ uid := msession[c.Value]
+ usr := muser[uid]
+
+ fmt.Println("SESSION ID", c.Value)
+
+ http.SetCookie(w, c)
+ tpl.ExecuteTemplate(w, "index.gohtml", usr)
+}
+
+func other(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("mysess")
+ if err != nil {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+ uid := msession[c.Value]
+ usr := muser[uid]
+
+ fmt.Println("SESSION ID", c.Value)
+
+ http.SetCookie(w, c)
+ tpl.ExecuteTemplate(w, "other.gohtml", usr)
+}
+
+func logout(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("mysess")
+ if err != nil {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+ delete(msession, c.Value)
+ c.MaxAge = -1
+ http.SetCookie(w, c)
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ //fmt.Fprint(w, "You've been logged out")
+}
+
+func login(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("mysess")
+ if err != nil {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+
+ if r.Method == "POST" {
+ em := r.FormValue("email")
+ pw := r.FormValue("password")
+ // get all of the usernames and passwords
+ m := map[string]user{}
+ for _, v := range muser {
+ m[v.Email] = v
+ }
+ usr, ok := m[em]
+ if !ok {
+ http.Redirect(w, r, "/login", http.StatusForbidden)
+ return
+ }
+ if usr.Password != pw {
+ http.Redirect(w, r, "/login", http.StatusForbidden)
+ return
+ }
+ msession[c.Value] = usr.Id
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+
+ tpl.ExecuteTemplate(w, "login.gohtml", nil)
+}
+
+func signup(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("mysess")
+
+ // if no cookie, redirect to index
+ if err != nil {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+
+ // user has already signed up, so redirect
+ uid := msession[c.Value]
+ usr := muser[uid]
+ if usr.Email != "" {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+
+ if r.Method == "POST" {
+ fn := r.FormValue("first")
+ ln := r.FormValue("last")
+ em := r.FormValue("email")
+ pw := r.FormValue("password")
+ u := uuid.NewV4()
+ usr = user{
+ Id: u.String(),
+ First: fn,
+ Last: ln,
+ Email: em,
+ Password: pw,
+ }
+ muser[usr.Id] = usr
+ msession[c.Value] = usr.Id
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+
+ tpl.ExecuteTemplate(w, "signup.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/44_map/templates/index.gohtml b/000_temp/46_sp17/44_map/templates/index.gohtml
new file mode 100644
index 00000000..1d71c626
--- /dev/null
+++ b/000_temp/46_sp17/44_map/templates/index.gohtml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ INDEX PAGE
+
+
+
+You are at index
+
+
+
+
+
+
+First: {{.First}}
+Last: {{.Last}}
+Email: {{.Email}}
+Password: {{.Password}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/44_map/templates/login.gohtml b/000_temp/46_sp17/44_map/templates/login.gohtml
new file mode 100644
index 00000000..a9e7d40b
--- /dev/null
+++ b/000_temp/46_sp17/44_map/templates/login.gohtml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ LOGIN
+
+
+
+
+LOGIN
+
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/44_map/templates/other.gohtml b/000_temp/46_sp17/44_map/templates/other.gohtml
new file mode 100644
index 00000000..a5352a92
--- /dev/null
+++ b/000_temp/46_sp17/44_map/templates/other.gohtml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ OTHER
+
+
+
+You are at some other page
+
+
+
+
+
+
+First: {{.First}}
+Last: {{.Last}}
+Email: {{.Email}}
+Password: {{.Password}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/44_map/templates/signup.gohtml b/000_temp/46_sp17/44_map/templates/signup.gohtml
new file mode 100644
index 00000000..805742d1
--- /dev/null
+++ b/000_temp/46_sp17/44_map/templates/signup.gohtml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+ signup
+
+
+
+
+You are at sign up
+
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/45_session/01_cookie/main.go b/000_temp/46_sp17/45_session/01_cookie/main.go
new file mode 100644
index 00000000..5046f745
--- /dev/null
+++ b/000_temp/46_sp17/45_session/01_cookie/main.go
@@ -0,0 +1,29 @@
+package main
+
+import (
+ "fmt"
+ "github.com/satori/go.uuid"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.Handle("/favicon.ico", http.NotFoundHandler())
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ cookie, err := r.Cookie("session")
+ if err != nil {
+ id := uuid.NewV4()
+ cookie = &http.Cookie{
+ Name: "session",
+ Value: id.String(),
+ HttpOnly: true,
+ Path: "/",
+ }
+ http.SetCookie(w, cookie)
+ }
+ fmt.Println(cookie)
+ fmt.Fprint(w, cookie)
+}
diff --git a/000_temp/46_sp17/45_session/02_session/main.go b/000_temp/46_sp17/45_session/02_session/main.go
new file mode 100644
index 00000000..a598ab5b
--- /dev/null
+++ b/000_temp/46_sp17/45_session/02_session/main.go
@@ -0,0 +1,76 @@
+package main
+
+import (
+ "github.com/satori/go.uuid"
+ "html/template"
+ "net/http"
+)
+
+type user struct {
+ UserName string
+ First string
+ Last string
+}
+
+var tpl *template.Template
+var dbUsers = map[string]user{} // user ID, user
+var dbSessions = map[string]string{} // session ID, user ID (email)
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/bar", bar)
+ http.Handle("/favicon.ico", http.NotFoundHandler())
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("session")
+ if err != nil {
+ id := uuid.NewV4()
+ c = &http.Cookie{
+ Name: "session",
+ Value: id.String(),
+ HttpOnly: true,
+ Path: "/",
+ }
+ http.SetCookie(w, c)
+ }
+
+ var u user
+ if uid, ok := dbSessions[c.Value]; ok {
+ u = dbUsers[uid]
+ }
+
+ // process form submission
+ if r.Method == http.MethodPost {
+ e := r.FormValue("email")
+ f := r.FormValue("first")
+ l := r.FormValue("last")
+ u = user{e, f, l}
+ dbSessions[c.Value] = e
+ dbUsers[e] = u
+ }
+
+ tpl.ExecuteTemplate(w, "index.gohtml", u)
+}
+
+func bar(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("session")
+ if err != nil {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+
+ e, ok := dbSessions[c.Value]
+ if !ok {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+
+ u := dbUsers[e]
+ tpl.ExecuteTemplate(w, "bar.gohtml", u)
+}
diff --git a/000_temp/46_sp17/45_session/02_session/templates/bar.gohtml b/000_temp/46_sp17/45_session/02_session/templates/bar.gohtml
new file mode 100644
index 00000000..884d3edd
--- /dev/null
+++ b/000_temp/46_sp17/45_session/02_session/templates/bar.gohtml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ BAR PAGE
+
+
+
+WELCOME TO THE BAR!
+
+{{if .First}}
+Username {{.UserName}}
+First {{.First}}
+Last {{.Last}}
+{{end}}
+
+go to index
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/45_session/02_session/templates/index.gohtml b/000_temp/46_sp17/45_session/02_session/templates/index.gohtml
new file mode 100644
index 00000000..49a26528
--- /dev/null
+++ b/000_temp/46_sp17/45_session/02_session/templates/index.gohtml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+ INDEX PAGE
+
+
+
+{{if .First}}
+Username {{.UserName}}
+First {{.First}}
+Last {{.Last}}
+{{end}}
+
+
+
+go to bar
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/45_session/03_signup/main.go b/000_temp/46_sp17/45_session/03_signup/main.go
new file mode 100644
index 00000000..c71be7c9
--- /dev/null
+++ b/000_temp/46_sp17/45_session/03_signup/main.go
@@ -0,0 +1,86 @@
+package main
+
+import (
+ "github.com/satori/go.uuid"
+ "html/template"
+ "net/http"
+)
+
+type user struct {
+ UserName string
+ Password string
+ First string
+ Last string
+}
+
+var tpl *template.Template
+var dbUsers = map[string]user{} // user ID, user
+var dbSessions = map[string]string{} // session ID, user ID (email)
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/signup", signup)
+ http.HandleFunc("/bar", bar)
+ http.Handle("/favicon.ico", http.NotFoundHandler())
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ u := getUser(w, r)
+ tpl.ExecuteTemplate(w, "index.gohtml", u)
+}
+
+func signup(w http.ResponseWriter, r *http.Request) {
+ if alreadyLoggedIn(r) {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+
+ // process form submission
+ if r.Method == http.MethodPost {
+ e := r.FormValue("email")
+ p := r.FormValue("password")
+ f := r.FormValue("first")
+ l := r.FormValue("last")
+
+ // is username taken, eg, user already signed up?
+ if _, ok := dbUsers[e]; ok {
+ http.Error(w, "Username already taken", http.StatusForbidden)
+ return
+ }
+
+ // create session
+ id := uuid.NewV4()
+ c := &http.Cookie{
+ Name: "session",
+ Value: id.String(),
+ HttpOnly: true,
+ Path: "/",
+ }
+ http.SetCookie(w, c)
+ dbSessions[c.Value] = e
+
+ // store user in dbUsers
+ u := user{e, p, f, l}
+ dbUsers[e] = u
+
+ // all done processing form submission
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+
+ tpl.ExecuteTemplate(w, "signup.gohtml", nil)
+}
+
+func bar(w http.ResponseWriter, r *http.Request) {
+ if !alreadyLoggedIn(r) {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+ u := getUser(w, r)
+ tpl.ExecuteTemplate(w, "bar.gohtml", u)
+}
diff --git a/000_temp/46_sp17/45_session/03_signup/session.go b/000_temp/46_sp17/45_session/03_signup/session.go
new file mode 100644
index 00000000..6cf7975b
--- /dev/null
+++ b/000_temp/46_sp17/45_session/03_signup/session.go
@@ -0,0 +1,36 @@
+package main
+
+import (
+ "github.com/satori/go.uuid"
+ "net/http"
+)
+
+func getUser(w http.ResponseWriter, r *http.Request) user {
+ c, err := r.Cookie("session")
+ if err != nil {
+ id := uuid.NewV4()
+ c = &http.Cookie{
+ Name: "session",
+ Value: id.String(),
+ HttpOnly: true,
+ Path: "/",
+ }
+ http.SetCookie(w, c)
+ }
+
+ var u user
+ if e, ok := dbSessions[c.Value]; ok {
+ u = dbUsers[e]
+ }
+ return u
+}
+
+func alreadyLoggedIn(r *http.Request) bool {
+ c, err := r.Cookie("session")
+ if err != nil {
+ return false
+ }
+ e := dbSessions[c.Value]
+ _, ok := dbUsers[e]
+ return ok
+}
diff --git a/000_temp/46_sp17/45_session/03_signup/templates/bar.gohtml b/000_temp/46_sp17/45_session/03_signup/templates/bar.gohtml
new file mode 100644
index 00000000..884d3edd
--- /dev/null
+++ b/000_temp/46_sp17/45_session/03_signup/templates/bar.gohtml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ BAR PAGE
+
+
+
+WELCOME TO THE BAR!
+
+{{if .First}}
+Username {{.UserName}}
+First {{.First}}
+Last {{.Last}}
+{{end}}
+
+go to index
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/45_session/03_signup/templates/index.gohtml b/000_temp/46_sp17/45_session/03_signup/templates/index.gohtml
new file mode 100644
index 00000000..9da7b4f2
--- /dev/null
+++ b/000_temp/46_sp17/45_session/03_signup/templates/index.gohtml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ INDEX PAGE
+
+
+
+{{if .First}}
+Username {{.UserName}}
+First {{.First}}
+Last {{.Last}}
+{{end}}
+
+go to signup
+go to bar
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/45_session/03_signup/templates/signup.gohtml b/000_temp/46_sp17/45_session/03_signup/templates/signup.gohtml
new file mode 100644
index 00000000..5748cd84
--- /dev/null
+++ b/000_temp/46_sp17/45_session/03_signup/templates/signup.gohtml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+ SIGNUP
+
+
+
+
+
+go to index
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/46_cookie/main.go b/000_temp/46_sp17/46_cookie/main.go
new file mode 100644
index 00000000..1d731a2b
--- /dev/null
+++ b/000_temp/46_sp17/46_cookie/main.go
@@ -0,0 +1,32 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", foo)
+ http.HandleFunc("/bar", bar)
+ http.ListenAndServe(":8080", nil)
+}
+
+func foo(w http.ResponseWriter, r *http.Request) {
+ c := &http.Cookie{
+ Name: "wasssup",
+ Value: "tecate",
+ Path: "/",
+ HttpOnly: true,
+ }
+ http.SetCookie(w, c)
+ io.WriteString(w, "hello ")
+}
+
+func bar(w http.ResponseWriter, r *http.Request) {
+ c, err := r.Cookie("wasssup")
+ if err != nil {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return
+ }
+ io.WriteString(w, c.Value)
+}
diff --git a/000_temp/46_sp17/47_JSON/main.go b/000_temp/46_sp17/47_JSON/main.go
new file mode 100644
index 00000000..048b1e1d
--- /dev/null
+++ b/000_temp/46_sp17/47_JSON/main.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+)
+
+type person struct {
+ First string
+ Last string
+ Ltk bool
+ Items []string
+}
+
+func main() {
+ p1 := person{
+ First: "James",
+ Last: "Bond",
+ Ltk: true,
+ Items: []string{
+ "Martini",
+ "Walther PPK",
+ "Astin Martin",
+ },
+ }
+ bs, err := json.Marshal(p1)
+ if err != nil {
+ fmt.Println(err)
+ }
+ fmt.Println(p1)
+ fmt.Println("------------")
+ fmt.Println(string(bs))
+}
diff --git a/000_temp/46_sp17/48_json/01_marshal/main.go b/000_temp/46_sp17/48_json/01_marshal/main.go
new file mode 100644
index 00000000..3099ab33
--- /dev/null
+++ b/000_temp/46_sp17/48_json/01_marshal/main.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+)
+
+type person struct {
+ First string
+ Last string
+}
+
+func main() {
+ p1 := person{
+ First: "James",
+ Last: "Bond",
+ }
+
+ p2 := person{
+ First: "Miss",
+ Last: "Moneypenny",
+ }
+
+ xp := []person{p1, p2}
+
+ fmt.Printf("go data: %+v\n", xp)
+
+ bs, err := json.Marshal(xp)
+ if err != nil {
+ fmt.Println(err)
+ }
+ fmt.Println("json:", string(bs))
+}
diff --git a/000_temp/46_sp17/48_json/02_unmarshal/main.go b/000_temp/46_sp17/48_json/02_unmarshal/main.go
new file mode 100644
index 00000000..a27aecaa
--- /dev/null
+++ b/000_temp/46_sp17/48_json/02_unmarshal/main.go
@@ -0,0 +1,29 @@
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+)
+
+type person struct {
+ First string
+ Last string
+}
+
+func main() {
+ j := `[{"First":"James","Last":"Bond"},{"First":"Miss","Last":"Moneypenny"}]`
+ fmt.Println("json:", j)
+
+ xp := []person{}
+
+ err := json.Unmarshal([]byte(j), &xp)
+ if err != nil {
+ fmt.Println(err)
+ }
+ fmt.Printf("go data: %+v\n", xp)
+
+ for i, v := range xp {
+ fmt.Println(i, v)
+ fmt.Println("\t", v.First)
+ }
+}
diff --git a/000_temp/46_sp17/48_json/03_tags/main.go b/000_temp/46_sp17/48_json/03_tags/main.go
new file mode 100644
index 00000000..d513161d
--- /dev/null
+++ b/000_temp/46_sp17/48_json/03_tags/main.go
@@ -0,0 +1,29 @@
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+)
+
+type person struct {
+ First string `json:"fname"`
+ Last string
+}
+
+func main() {
+ j := `[{"fname":"James","last":"Bond"},{"fname":"Miss","last":"Moneypenny"}]`
+ fmt.Println("json:", j)
+
+ xp := []person{}
+
+ err := json.Unmarshal([]byte(j), &xp)
+ if err != nil {
+ fmt.Println(err)
+ }
+ fmt.Printf("go data: %+v\n", xp)
+
+ for i, v := range xp {
+ fmt.Println(i, v)
+ fmt.Println("\t", v.First)
+ }
+}
diff --git a/000_temp/46_sp17/48_json/04_encode/main.go b/000_temp/46_sp17/48_json/04_encode/main.go
new file mode 100644
index 00000000..aa7dae49
--- /dev/null
+++ b/000_temp/46_sp17/48_json/04_encode/main.go
@@ -0,0 +1,36 @@
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+ "net/http"
+)
+
+type person struct {
+ First string
+ Last string
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ p1 := person{
+ First: "James",
+ Last: "Bond",
+ }
+
+ p2 := person{
+ First: "Miss",
+ Last: "Moneypenny",
+ }
+
+ xp := []person{p1, p2}
+
+ err := json.NewEncoder(w).Encode(xp)
+ if err != nil {
+ fmt.Println(err)
+ }
+}
diff --git a/000_temp/46_sp17/48_json/05_decode/main.go b/000_temp/46_sp17/48_json/05_decode/main.go
new file mode 100644
index 00000000..dbafdb3e
--- /dev/null
+++ b/000_temp/46_sp17/48_json/05_decode/main.go
@@ -0,0 +1,66 @@
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+ "html/template"
+ "net/http"
+)
+
+type person struct {
+ First string
+ Last string
+}
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/send", send)
+ http.HandleFunc("/catch", catch)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ p1 := person{
+ First: "James",
+ Last: "Bond",
+ }
+
+ p2 := person{
+ First: "Miss",
+ Last: "Moneypenny",
+ }
+
+ xp := []person{p1, p2}
+
+ err := json.NewEncoder(w).Encode(xp)
+ if err != nil {
+ fmt.Println(err)
+ }
+}
+
+func send(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "send.gohtml", nil)
+}
+
+var xp []person
+
+func catch(w http.ResponseWriter, r *http.Request) {
+
+ if r.Method == http.MethodPost {
+ err := json.NewDecoder(r.Body).Decode(&xp)
+ if err != nil {
+ fmt.Println(err)
+ }
+ fmt.Println(xp)
+ }
+
+ if r.Method == http.MethodGet {
+ tpl.ExecuteTemplate(w, "catch.gohtml", xp)
+ }
+}
diff --git a/000_temp/46_sp17/48_json/05_decode/templates/catch.gohtml b/000_temp/46_sp17/48_json/05_decode/templates/catch.gohtml
new file mode 100644
index 00000000..74f50269
--- /dev/null
+++ b/000_temp/46_sp17/48_json/05_decode/templates/catch.gohtml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ Document
+
+
+
+{{range .}}
+Here is the data: {{.}}
+FIRST: {{.First}}
+Last: {{.Last}}
+
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/48_json/05_decode/templates/send.gohtml b/000_temp/46_sp17/48_json/05_decode/templates/send.gohtml
new file mode 100644
index 00000000..610483b0
--- /dev/null
+++ b/000_temp/46_sp17/48_json/05_decode/templates/send.gohtml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+ Document
+
+
+
+
+We are now going to send data to the /catch path
+
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/48_json/06_cookie/main.go b/000_temp/46_sp17/48_json/06_cookie/main.go
new file mode 100644
index 00000000..21a39e25
--- /dev/null
+++ b/000_temp/46_sp17/48_json/06_cookie/main.go
@@ -0,0 +1,94 @@
+package main
+
+import (
+ "encoding/base64"
+ "encoding/json"
+ "fmt"
+ "html/template"
+ "io/ioutil"
+ "net/http"
+)
+
+type person struct {
+ First string
+ Last string
+}
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/send", send)
+ http.HandleFunc("/catch", catch)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ xp := getUsers(r)
+
+ tpl.ExecuteTemplate(w, "index.gohtml", xp)
+}
+
+func send(w http.ResponseWriter, r *http.Request) {
+ xp := getUsers(r)
+
+ tpl.ExecuteTemplate(w, "send.gohtml", xp)
+}
+
+func catch(w http.ResponseWriter, r *http.Request) {
+ xp := getUsers(r)
+
+ if r.Method == http.MethodPost {
+ bs, err := ioutil.ReadAll(r.Body)
+ if err != nil {
+ fmt.Println(err)
+ }
+
+ err = json.Unmarshal(bs, &xp)
+ if err != nil {
+ fmt.Println(err)
+ return
+ }
+ fmt.Println(xp)
+
+ s := base64.StdEncoding.EncodeToString(bs)
+ fmt.Println(s)
+
+ c := &http.Cookie{
+ Name: "userdata",
+ Value: s,
+ Path: "/",
+ HttpOnly: true,
+ }
+ http.SetCookie(w, c)
+ }
+
+ if r.Method == http.MethodGet {
+ tpl.ExecuteTemplate(w, "catch.gohtml", xp)
+ }
+}
+
+func getUsers(r *http.Request) []person {
+ var xp []person
+
+ c, err := r.Cookie("userdata")
+ if err == nil {
+ bs, err := base64.StdEncoding.DecodeString(c.Value)
+ if err != nil {
+ fmt.Println(err)
+ return xp
+ }
+
+ fmt.Println("just after base64 decode:", string(bs))
+
+ err = json.Unmarshal(bs, &xp)
+ if err != nil {
+ fmt.Println("unmarshalling in decode from b64", err)
+ }
+ }
+ return xp
+}
diff --git a/000_temp/46_sp17/48_json/06_cookie/templates/catch.gohtml b/000_temp/46_sp17/48_json/06_cookie/templates/catch.gohtml
new file mode 100644
index 00000000..bb497a18
--- /dev/null
+++ b/000_temp/46_sp17/48_json/06_cookie/templates/catch.gohtml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ CATCH
+
+
+
+{{range .}}
+Here is the data: {{.}}
+FIRST: {{.First}}
+Last: {{.Last}}
+
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/48_json/06_cookie/templates/index.gohtml b/000_temp/46_sp17/48_json/06_cookie/templates/index.gohtml
new file mode 100644
index 00000000..9ec8fd9c
--- /dev/null
+++ b/000_temp/46_sp17/48_json/06_cookie/templates/index.gohtml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ INDEX
+
+
+
+{{range .}}
+Here is the data: {{.}}
+FIRST: {{.First}}
+Last: {{.Last}}
+
+{{end}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/48_json/06_cookie/templates/send.gohtml b/000_temp/46_sp17/48_json/06_cookie/templates/send.gohtml
new file mode 100644
index 00000000..302b4b0e
--- /dev/null
+++ b/000_temp/46_sp17/48_json/06_cookie/templates/send.gohtml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+ SEND
+
+
+
+
+We are now going to send data to the /catch path
+{{range .}}
+ Here is the data: {{.}}
+ FIRST: {{.First}}
+ Last: {{.Last}}
+
+ {{end}}
+
+
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/49_multiple-redirects/main.go b/000_temp/46_sp17/49_multiple-redirects/main.go
new file mode 100644
index 00000000..97a5d8e2
--- /dev/null
+++ b/000_temp/46_sp17/49_multiple-redirects/main.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/foo", foo)
+ http.HandleFunc("/bar", bar)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func foo(w http.ResponseWriter, r *http.Request) {
+ http.Redirect(w, r, "/", http.StatusSeeOther)
+ return // comment out and experiment to see what happens
+ http.Redirect(w, r, "/bar", http.StatusSeeOther)
+}
+
+func bar(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "bar.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/49_multiple-redirects/templates/bar.gohtml b/000_temp/46_sp17/49_multiple-redirects/templates/bar.gohtml
new file mode 100644
index 00000000..0522363c
--- /dev/null
+++ b/000_temp/46_sp17/49_multiple-redirects/templates/bar.gohtml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+ BAR
+
+
+
+
+You are at BAR
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/49_multiple-redirects/templates/index.gohtml b/000_temp/46_sp17/49_multiple-redirects/templates/index.gohtml
new file mode 100644
index 00000000..27eea8db
--- /dev/null
+++ b/000_temp/46_sp17/49_multiple-redirects/templates/index.gohtml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ index
+
+
+
+
+You are at INDEX
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/50_mongo/main.go b/000_temp/46_sp17/50_mongo/main.go
new file mode 100644
index 00000000..0e07afe5
--- /dev/null
+++ b/000_temp/46_sp17/50_mongo/main.go
@@ -0,0 +1,51 @@
+package main
+
+import (
+ "fmt"
+ "gopkg.in/mgo.v2"
+ "gopkg.in/mgo.v2/bson"
+ "html/template"
+ "net/http"
+)
+
+type customer struct {
+ Name string `json:"name" bson:"name"`
+}
+
+var tpl *template.Template
+var DB *mgo.Database
+var Customer *mgo.Collection
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+
+ // get a mongo sessions
+ //s, err := mgo.Dial("mongodb://bond:moneypenny007@localhost/bookstore")
+ s, err := mgo.Dial("mongodb://localhost/bookstore")
+ if err != nil {
+ panic(err)
+ }
+
+ if err = s.Ping(); err != nil {
+ panic(err)
+ }
+
+ DB = s.DB("bookstore")
+ Customer = DB.C("customer")
+
+ fmt.Println("You connected to your mongo database.")
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ customers := []customer{}
+ err := Customer.Find(bson.M{}).All(&customers)
+ if err != nil {
+ fmt.Println(err)
+ }
+ tpl.ExecuteTemplate(w, "index.gohtml", customers)
+}
diff --git a/000_temp/46_sp17/50_mongo/templates/index.gohtml b/000_temp/46_sp17/50_mongo/templates/index.gohtml
new file mode 100644
index 00000000..7b16697b
--- /dev/null
+++ b/000_temp/46_sp17/50_mongo/templates/index.gohtml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ INDEX
+
+
+
+{{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/51_question/01/main.go b/000_temp/46_sp17/51_question/01/main.go
new file mode 100644
index 00000000..15fa7006
--- /dev/null
+++ b/000_temp/46_sp17/51_question/01/main.go
@@ -0,0 +1,52 @@
+package main
+
+import (
+ "fmt"
+ "math/rand"
+ "sync"
+ "time"
+)
+
+var wg sync.WaitGroup
+
+type SafeCounter struct {
+ c int
+ sync.Mutex
+}
+
+func (c *SafeCounter) Add() {
+ c.Lock()
+ defer c.Unlock()
+ c.c++
+}
+
+var counter *SafeCounter = &SafeCounter{}
+
+func main() {
+
+ fmt.Println(&counter.c)
+
+ wg.Add(2)
+ go incrementor("Foo:")
+ go incrementor("Bar:")
+ wg.Wait()
+ fmt.Println("Final Counter:", counter.c)
+}
+
+func incrementor(s string) {
+ rand.Seed(time.Now().UnixNano())
+ for i := 0; i < 20; i++ {
+ x := counter
+ fmt.Println("1----", counter)
+ fmt.Println("2----", x)
+ x.Add()
+ counter = x
+ time.Sleep(time.Duration(rand.Intn(3)) * time.Millisecond)
+ fmt.Println(s, i, "Counter:", counter.c)
+ }
+ wg.Done()
+}
+
+// go run -race main.go
+// vs
+// go run main.go
diff --git a/000_temp/46_sp17/51_question/02/main.go b/000_temp/46_sp17/51_question/02/main.go
new file mode 100644
index 00000000..dd1fee0d
--- /dev/null
+++ b/000_temp/46_sp17/51_question/02/main.go
@@ -0,0 +1,48 @@
+package main
+
+import (
+ "fmt"
+ "math/rand"
+ "sync"
+ "time"
+)
+
+var wg sync.WaitGroup
+
+type SafeCounter struct {
+ c int
+ m sync.Mutex
+}
+
+func (sc *SafeCounter) Add() {
+ sc.m.Lock()
+ defer sc.m.Unlock()
+ sc.c++
+}
+
+var counter *SafeCounter = &SafeCounter{}
+
+func main() {
+
+ fmt.Println(&counter.c)
+
+ wg.Add(2)
+ go incrementor("Foo:")
+ go incrementor("Bar:")
+ wg.Wait()
+ fmt.Println("Final Counter:", counter.c)
+}
+
+func incrementor(s string) {
+ rand.Seed(time.Now().UnixNano())
+ for i := 0; i < 20; i++ {
+ counter.Add()
+ time.Sleep(time.Duration(rand.Intn(3)) * time.Millisecond)
+ //fmt.Println(s, i, "Counter:", counter.c) // causes a race; no lock here; multiple goroutines accessing to READ the value
+ }
+ wg.Done()
+}
+
+// go run -race main.go
+// vs
+// go run main.go
diff --git a/000_temp/46_sp17/52-review/01/main.go b/000_temp/46_sp17/52-review/01/main.go
new file mode 100644
index 00000000..1c0890fd
--- /dev/null
+++ b/000_temp/46_sp17/52-review/01/main.go
@@ -0,0 +1,15 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, "some text hello world")
+}
diff --git a/000_temp/46_sp17/52-review/02/main.go b/000_temp/46_sp17/52-review/02/main.go
new file mode 100644
index 00000000..a619af57
--- /dev/null
+++ b/000_temp/46_sp17/52-review/02/main.go
@@ -0,0 +1,154 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, `
+
+
+
+
+ Title
+
+
+
+
+
+hello world
+
+
+
+ 001
+ 002
+ 003
+ 004
+ 005
+ 006
+ 007
+ 008
+ 009
+ 010
+ 011
+ 012
+ 013
+ 014
+ 015
+ 016
+ 017
+ 018
+ 019
+ 020
+ 021
+ 022
+ 023
+ 024
+ 025
+ 026
+ 027
+ 028
+ 029
+ 030
+ 031
+ 032
+ 033
+ 034
+ 035
+ 036
+ 037
+ 038
+ 039
+ 040
+ 041
+ 042
+ 043
+ 044
+ 045
+ 046
+ 047
+ 048
+ 049
+ 050
+ 051
+ 052
+ 053
+ 054
+ 055
+ 056
+ 057
+ 058
+ 059
+ 060
+ 061
+ 062
+ 063
+ 064
+ 065
+ 066
+ 067
+ 068
+ 069
+ 070
+ 071
+ 072
+ 073
+ 074
+ 075
+ 076
+ 077
+ 078
+ 079
+ 080
+ 081
+ 082
+ 083
+ 084
+ 085
+ 086
+ 087
+ 088
+ 089
+ 090
+ 091
+ 092
+ 093
+ 094
+ 095
+ 096
+ 097
+ 098
+ 099
+ 100
+
+
+
+ `)
+}
diff --git a/000_temp/46_sp17/52-review/03/main.go b/000_temp/46_sp17/52-review/03/main.go
new file mode 100644
index 00000000..7b469e6f
--- /dev/null
+++ b/000_temp/46_sp17/52-review/03/main.go
@@ -0,0 +1,16 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ w.Header().Set("Content-Type", "text/plain; charset=utf-8")
+ io.WriteString(w, `Hello World `)
+}
diff --git a/000_temp/46_sp17/52-review/04/main.go b/000_temp/46_sp17/52-review/04/main.go
new file mode 100644
index 00000000..21ff5e92
--- /dev/null
+++ b/000_temp/46_sp17/52-review/04/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
diff --git a/000_temp/46_sp17/52-review/04/templates/index.gohtml b/000_temp/46_sp17/52-review/04/templates/index.gohtml
new file mode 100644
index 00000000..f0bd030e
--- /dev/null
+++ b/000_temp/46_sp17/52-review/04/templates/index.gohtml
@@ -0,0 +1,138 @@
+
+
+
+
+ Title
+
+
+
+
+
+ hello world
+
+
+
+ 001
+ 002
+ 003
+ 004
+ 005
+ 006
+ 007
+ 008
+ 009
+ 010
+ 011
+ 012
+ 013
+ 014
+ 015
+ 016
+ 017
+ 018
+ 019
+ 020
+ 021
+ 022
+ 023
+ 024
+ 025
+ 026
+ 027
+ 028
+ 029
+ 030
+ 031
+ 032
+ 033
+ 034
+ 035
+ 036
+ 037
+ 038
+ 039
+ 040
+ 041
+ 042
+ 043
+ 044
+ 045
+ 046
+ 047
+ 048
+ 049
+ 050
+ 051
+ 052
+ 053
+ 054
+ 055
+ 056
+ 057
+ 058
+ 059
+ 060
+ 061
+ 062
+ 063
+ 064
+ 065
+ 066
+ 067
+ 068
+ 069
+ 070
+ 071
+ 072
+ 073
+ 074
+ 075
+ 076
+ 077
+ 078
+ 079
+ 080
+ 081
+ 082
+ 083
+ 084
+ 085
+ 086
+ 087
+ 088
+ 089
+ 090
+ 091
+ 092
+ 093
+ 094
+ 095
+ 096
+ 097
+ 098
+ 099
+ 100
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/52-review/05/main.go b/000_temp/46_sp17/52-review/05/main.go
new file mode 100644
index 00000000..f91303d3
--- /dev/null
+++ b/000_temp/46_sp17/52-review/05/main.go
@@ -0,0 +1,22 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ n := "James Bond"
+ tpl.ExecuteTemplate(w, "index.gohtml", n)
+}
diff --git a/000_temp/46_sp17/52-review/05/templates/index.gohtml b/000_temp/46_sp17/52-review/05/templates/index.gohtml
new file mode 100644
index 00000000..229adf46
--- /dev/null
+++ b/000_temp/46_sp17/52-review/05/templates/index.gohtml
@@ -0,0 +1,138 @@
+
+
+
+
+ Title
+
+
+
+
+
+ {{.}}
+
+
+
+ 001
+ 002
+ 003
+ 004
+ 005
+ 006
+ 007
+ 008
+ 009
+ 010
+ 011
+ 012
+ 013
+ 014
+ 015
+ 016
+ 017
+ 018
+ 019
+ 020
+ 021
+ 022
+ 023
+ 024
+ 025
+ 026
+ 027
+ 028
+ 029
+ 030
+ 031
+ 032
+ 033
+ 034
+ 035
+ 036
+ 037
+ 038
+ 039
+ 040
+ 041
+ 042
+ 043
+ 044
+ 045
+ 046
+ 047
+ 048
+ 049
+ 050
+ 051
+ 052
+ 053
+ 054
+ 055
+ 056
+ 057
+ 058
+ 059
+ 060
+ 061
+ 062
+ 063
+ 064
+ 065
+ 066
+ 067
+ 068
+ 069
+ 070
+ 071
+ 072
+ 073
+ 074
+ 075
+ 076
+ 077
+ 078
+ 079
+ 080
+ 081
+ 082
+ 083
+ 084
+ 085
+ 086
+ 087
+ 088
+ 089
+ 090
+ 091
+ 092
+ 093
+ 094
+ 095
+ 096
+ 097
+ 098
+ 099
+ 100
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/52-review/06/main.go b/000_temp/46_sp17/52-review/06/main.go
new file mode 100644
index 00000000..cbabd247
--- /dev/null
+++ b/000_temp/46_sp17/52-review/06/main.go
@@ -0,0 +1,40 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+type person struct {
+ First string
+ Last string
+ Saying string
+}
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ p1 := person{
+ First: "James",
+ Last: "Bond",
+ Saying: "Shaken, not stirred.",
+ }
+
+ p2 := person{
+ First: "Miss",
+ Last: "Moneypenny",
+ Saying: "Hello, James. It is sooooooooo good to see you.",
+ }
+
+ xp := []person{p1, p2}
+ tpl.ExecuteTemplate(w, "index.gohtml", xp)
+}
diff --git a/000_temp/46_sp17/52-review/06/templates/index.gohtml b/000_temp/46_sp17/52-review/06/templates/index.gohtml
new file mode 100644
index 00000000..0c3f8f59
--- /dev/null
+++ b/000_temp/46_sp17/52-review/06/templates/index.gohtml
@@ -0,0 +1,138 @@
+
+
+
+
+ Title
+
+
+
+
+
+ {{range .}}
+ {{.First}} {{.Last}}
+ {{.Saying}}
+ {{end}}
+
+
+
+ 001
+ 002
+ 003
+ 004
+ 005
+ 006
+ 007
+ 008
+ 009
+ 010
+ 011
+ 012
+ 013
+ 014
+ 015
+ 016
+ 017
+ 018
+ 019
+ 020
+ 021
+ 022
+ 023
+ 024
+ 025
+ 026
+ 027
+ 028
+ 029
+ 030
+ 031
+ 032
+ 033
+ 034
+ 035
+ 036
+ 037
+ 038
+ 039
+ 040
+ 041
+ 042
+ 043
+ 044
+ 045
+ 046
+ 047
+ 048
+ 049
+ 050
+ 051
+ 052
+ 053
+ 054
+ 055
+ 056
+ 057
+ 058
+ 059
+ 060
+ 061
+ 062
+ 063
+ 064
+ 065
+ 066
+ 067
+ 068
+ 069
+ 070
+ 071
+ 072
+ 073
+ 074
+ 075
+ 076
+ 077
+ 078
+ 079
+ 080
+ 081
+ 082
+ 083
+ 084
+ 085
+ 086
+ 087
+ 088
+ 089
+ 090
+ 091
+ 092
+ 093
+ 094
+ 095
+ 096
+ 097
+ 098
+ 099
+ 100
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/52-review/07/main.go b/000_temp/46_sp17/52-review/07/main.go
new file mode 100644
index 00000000..328f21e3
--- /dev/null
+++ b/000_temp/46_sp17/52-review/07/main.go
@@ -0,0 +1,41 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+type person struct {
+ First string
+ Last string
+ Saying string
+}
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(http.Dir("public"))))
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ p1 := person{
+ First: "James",
+ Last: "Bond",
+ Saying: "Shaken, not stirred.",
+ }
+
+ p2 := person{
+ First: "Miss",
+ Last: "Moneypenny",
+ Saying: "Hello, James. It is sooooooooo good to see you.",
+ }
+
+ xp := []person{p1, p2}
+ tpl.ExecuteTemplate(w, "index.gohtml", xp)
+}
diff --git a/000_temp/46_sp17/52-review/07/public/css/index.css b/000_temp/46_sp17/52-review/07/public/css/index.css
new file mode 100644
index 00000000..1dd9f35f
--- /dev/null
+++ b/000_temp/46_sp17/52-review/07/public/css/index.css
@@ -0,0 +1,16 @@
+html, body, h1 {
+ padding: 0;
+ border: 0;
+ margin: 0;
+ box-sizing: border-box;
+}
+
+main {
+ display: flex;
+ flex-direction: column;
+ flex-wrap: nowrap;
+ justify-content: center;
+ align-items: center;
+ background-image: linear-gradient(red, yellow, blue);
+ height: 100vh;
+}
\ No newline at end of file
diff --git a/000_temp/46_sp17/52-review/07/templates/index.gohtml b/000_temp/46_sp17/52-review/07/templates/index.gohtml
new file mode 100644
index 00000000..0788480b
--- /dev/null
+++ b/000_temp/46_sp17/52-review/07/templates/index.gohtml
@@ -0,0 +1,120 @@
+
+
+
+
+ Title
+
+
+
+
+
+ {{range .}}
+ {{.First}} {{.Last}}
+ {{.Saying}}
+ {{end}}
+
+
+
+ 001
+ 002
+ 003
+ 004
+ 005
+ 006
+ 007
+ 008
+ 009
+ 010
+ 011
+ 012
+ 013
+ 014
+ 015
+ 016
+ 017
+ 018
+ 019
+ 020
+ 021
+ 022
+ 023
+ 024
+ 025
+ 026
+ 027
+ 028
+ 029
+ 030
+ 031
+ 032
+ 033
+ 034
+ 035
+ 036
+ 037
+ 038
+ 039
+ 040
+ 041
+ 042
+ 043
+ 044
+ 045
+ 046
+ 047
+ 048
+ 049
+ 050
+ 051
+ 052
+ 053
+ 054
+ 055
+ 056
+ 057
+ 058
+ 059
+ 060
+ 061
+ 062
+ 063
+ 064
+ 065
+ 066
+ 067
+ 068
+ 069
+ 070
+ 071
+ 072
+ 073
+ 074
+ 075
+ 076
+ 077
+ 078
+ 079
+ 080
+ 081
+ 082
+ 083
+ 084
+ 085
+ 086
+ 087
+ 088
+ 089
+ 090
+ 091
+ 092
+ 093
+ 094
+ 095
+ 096
+ 097
+ 098
+ 099
+ 100
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/52-review/08/main.go b/000_temp/46_sp17/52-review/08/main.go
new file mode 100644
index 00000000..1c692706
--- /dev/null
+++ b/000_temp/46_sp17/52-review/08/main.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(http.Dir("public"))))
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ s := "Paradise Found"
+ tpl.ExecuteTemplate(w, "index.gohtml", s)
+}
diff --git a/000_temp/46_sp17/52-review/08/public/css/index.css b/000_temp/46_sp17/52-review/08/public/css/index.css
new file mode 100644
index 00000000..e51c29b4
--- /dev/null
+++ b/000_temp/46_sp17/52-review/08/public/css/index.css
@@ -0,0 +1,24 @@
+html, body, h1 {
+ padding: 0;
+ border: 0;
+ margin: 0;
+ box-sizing: border-box;
+}
+
+main {
+ display: flex;
+ flex-direction: column;
+ flex-wrap: nowrap;
+ justify-content: center;
+ align-items: center;
+ background-image: url("http://github.com/assets/img/surf.png");
+ background-size: cover;
+ background-repeat: no-repeat;
+ background-position: center;
+ height: 100vh;
+}
+
+h1 {
+ font-size: 8rem;
+ color: white;
+}
\ No newline at end of file
diff --git a/000_temp/46_sp17/52-review/08/public/img/surf.png b/000_temp/46_sp17/52-review/08/public/img/surf.png
new file mode 100644
index 00000000..1636912e
Binary files /dev/null and b/000_temp/46_sp17/52-review/08/public/img/surf.png differ
diff --git a/000_temp/46_sp17/52-review/08/templates/index.gohtml b/000_temp/46_sp17/52-review/08/templates/index.gohtml
new file mode 100644
index 00000000..386fb0fc
--- /dev/null
+++ b/000_temp/46_sp17/52-review/08/templates/index.gohtml
@@ -0,0 +1,117 @@
+
+
+
+
+ Title
+
+
+
+
+
+ {{.}}
+
+
+
+ 001
+ 002
+ 003
+ 004
+ 005
+ 006
+ 007
+ 008
+ 009
+ 010
+ 011
+ 012
+ 013
+ 014
+ 015
+ 016
+ 017
+ 018
+ 019
+ 020
+ 021
+ 022
+ 023
+ 024
+ 025
+ 026
+ 027
+ 028
+ 029
+ 030
+ 031
+ 032
+ 033
+ 034
+ 035
+ 036
+ 037
+ 038
+ 039
+ 040
+ 041
+ 042
+ 043
+ 044
+ 045
+ 046
+ 047
+ 048
+ 049
+ 050
+ 051
+ 052
+ 053
+ 054
+ 055
+ 056
+ 057
+ 058
+ 059
+ 060
+ 061
+ 062
+ 063
+ 064
+ 065
+ 066
+ 067
+ 068
+ 069
+ 070
+ 071
+ 072
+ 073
+ 074
+ 075
+ 076
+ 077
+ 078
+ 079
+ 080
+ 081
+ 082
+ 083
+ 084
+ 085
+ 086
+ 087
+ 088
+ 089
+ 090
+ 091
+ 092
+ 093
+ 094
+ 095
+ 096
+ 097
+ 098
+ 099
+ 100
+
+
+
\ No newline at end of file
diff --git a/000_temp/46_sp17/52-review/09/app.yaml b/000_temp/46_sp17/52-review/09/app.yaml
new file mode 100644
index 00000000..6816437c
--- /dev/null
+++ b/000_temp/46_sp17/52-review/09/app.yaml
@@ -0,0 +1,2 @@
+runtime: go
+env: flex
\ No newline at end of file
diff --git a/000_temp/46_sp17/52-review/09/main.go b/000_temp/46_sp17/52-review/09/main.go
new file mode 100644
index 00000000..1c692706
--- /dev/null
+++ b/000_temp/46_sp17/52-review/09/main.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(http.Dir("public"))))
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ s := "Paradise Found"
+ tpl.ExecuteTemplate(w, "index.gohtml", s)
+}
diff --git a/000_temp/46_sp17/52-review/09/public/css/index.css b/000_temp/46_sp17/52-review/09/public/css/index.css
new file mode 100644
index 00000000..e51c29b4
--- /dev/null
+++ b/000_temp/46_sp17/52-review/09/public/css/index.css
@@ -0,0 +1,24 @@
+html, body, h1 {
+ padding: 0;
+ border: 0;
+ margin: 0;
+ box-sizing: border-box;
+}
+
+main {
+ display: flex;
+ flex-direction: column;
+ flex-wrap: nowrap;
+ justify-content: center;
+ align-items: center;
+ background-image: url("http://github.com/assets/img/surf.png");
+ background-size: cover;
+ background-repeat: no-repeat;
+ background-position: center;
+ height: 100vh;
+}
+
+h1 {
+ font-size: 8rem;
+ color: white;
+}
\ No newline at end of file
diff --git a/000_temp/46_sp17/52-review/09/public/img/surf.png b/000_temp/46_sp17/52-review/09/public/img/surf.png
new file mode 100644
index 00000000..1636912e
Binary files /dev/null and b/000_temp/46_sp17/52-review/09/public/img/surf.png differ
diff --git a/000_temp/46_sp17/52-review/09/templates/index.gohtml b/000_temp/46_sp17/52-review/09/templates/index.gohtml
new file mode 100644
index 00000000..386fb0fc
--- /dev/null
+++ b/000_temp/46_sp17/52-review/09/templates/index.gohtml
@@ -0,0 +1,117 @@
+
+
+
+
+ Title
+
+
+
+
+
+ {{.}}
+
+
+
+ 001
+ 002
+ 003
+ 004
+ 005
+ 006
+ 007
+ 008
+ 009
+ 010
+ 011
+ 012
+ 013
+ 014
+ 015
+ 016
+ 017
+ 018
+ 019
+ 020
+ 021
+ 022
+ 023
+ 024
+ 025
+ 026
+ 027
+ 028
+ 029
+ 030
+ 031
+ 032
+ 033
+ 034
+ 035
+ 036
+ 037
+ 038
+ 039
+ 040
+ 041
+ 042
+ 043
+ 044
+ 045
+ 046
+ 047
+ 048
+ 049
+ 050
+ 051
+ 052
+ 053
+ 054
+ 055
+ 056
+ 057
+ 058
+ 059
+ 060
+ 061
+ 062
+ 063
+ 064
+ 065
+ 066
+ 067
+ 068
+ 069
+ 070
+ 071
+ 072
+ 073
+ 074
+ 075
+ 076
+ 077
+ 078
+ 079
+ 080
+ 081
+ 082
+ 083
+ 084
+ 085
+ 086
+ 087
+ 088
+ 089
+ 090
+ 091
+ 092
+ 093
+ 094
+ 095
+ 096
+ 097
+ 098
+ 099
+ 100
+
+
+
\ No newline at end of file
diff --git a/000_temp/47_ajax/01/main.go b/000_temp/47_ajax/01/main.go
new file mode 100644
index 00000000..3c40f998
--- /dev/null
+++ b/000_temp/47_ajax/01/main.go
@@ -0,0 +1,31 @@
+package main
+
+import (
+ "fmt"
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/process", process)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func process(w http.ResponseWriter, r *http.Request) {
+
+ subscribe := r.FormValue("subscribe")
+ dessert := r.FormValue("dessert")
+ dow := r.FormValue("dow")
+ fmt.Println("RESULTS:", subscribe, " - ", dessert, " - ", dow)
+}
diff --git a/000_temp/47_ajax/01/templates/index.gohtml b/000_temp/47_ajax/01/templates/index.gohtml
new file mode 100644
index 00000000..c3080850
--- /dev/null
+++ b/000_temp/47_ajax/01/templates/index.gohtml
@@ -0,0 +1,55 @@
+
+
+
+
+ Document
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/48_gmail/main.go b/000_temp/48_gmail/main.go
new file mode 100644
index 00000000..79058077
--- /dev/null
+++ b/000_temp/48_gmail/main.go
@@ -0,0 +1,5 @@
+package main
+
+func main() {
+
+}
diff --git a/000_temp/49_interfaces/main.go b/000_temp/49_interfaces/main.go
new file mode 100644
index 00000000..4fd7d004
--- /dev/null
+++ b/000_temp/49_interfaces/main.go
@@ -0,0 +1,44 @@
+package main
+
+import (
+ "fmt"
+ "github.com/GoesToEleven/golang-web-dev/000_temp/49_interfaces/species"
+ _ "github.com/GoesToEleven/golang-web-dev/000_temp/49_interfaces/species"
+)
+
+type person struct {
+ first string
+}
+
+func (person) Speak() {
+ fmt.Println("I'm a person")
+}
+
+type secretAgent struct {
+ person
+ ltk bool
+}
+
+func (secretAgent) Speak() {
+ fmt.Println("I'm a person and a secret agent")
+}
+
+func foo(h species.Human) {
+ h.Speak()
+}
+
+func main() {
+ p1 := person{
+ first: "Miss Moneypenny",
+ }
+
+ p2 := secretAgent{
+ person{
+ "James",
+ },
+ true,
+ }
+
+ foo(p1)
+ foo(p2)
+}
diff --git a/000_temp/49_interfaces/species/species.go b/000_temp/49_interfaces/species/species.go
new file mode 100644
index 00000000..c54fe271
--- /dev/null
+++ b/000_temp/49_interfaces/species/species.go
@@ -0,0 +1,5 @@
+package species
+
+type Human interface {
+ Speak()
+}
diff --git a/000_temp/50_disney/01/main.go b/000_temp/50_disney/01/main.go
new file mode 100644
index 00000000..f1f3f7e2
--- /dev/null
+++ b/000_temp/50_disney/01/main.go
@@ -0,0 +1,15 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", foo)
+ http.ListenAndServe(":8080", nil)
+}
+
+func foo(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, "Hellooooo!")
+}
diff --git a/000_temp/50_disney/02/main.go b/000_temp/50_disney/02/main.go
new file mode 100644
index 00000000..d3b764c7
--- /dev/null
+++ b/000_temp/50_disney/02/main.go
@@ -0,0 +1,54 @@
+package main
+
+import (
+ "encoding/json"
+ "fmt"
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.HandleFunc("/js", js)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
+
+func js(w http.ResponseWriter, r *http.Request) {
+ nj := struct {
+ First string `json:"first-name"`
+ Last string `json:"last-name"`
+ }{
+ "James",
+ "Bond",
+ }
+
+ w.Header().Set("Content-Type", "application/json")
+
+ err := json.NewEncoder(w).Encode(nj)
+ if err != nil {
+ fmt.Println(err)
+ return
+ }
+ //bs, err := json.Marshal(nj)
+ //if err != nil {
+ // fmt.Println(err)
+ // return
+ //}
+ //s := string(bs)
+ //tpl.ExecuteTemplate(w, "js.gohtml", s)
+}
diff --git a/000_temp/50_disney/02/templates/about.gohtml b/000_temp/50_disney/02/templates/about.gohtml
new file mode 100644
index 00000000..e7bc7333
--- /dev/null
+++ b/000_temp/50_disney/02/templates/about.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+All about Disney!
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/02/templates/index.gohtml b/000_temp/50_disney/02/templates/index.gohtml
new file mode 100644
index 00000000..edf0ff57
--- /dev/null
+++ b/000_temp/50_disney/02/templates/index.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ Index
+
+
+
+Hello Disney!
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/02/templates/js.gohtml b/000_temp/50_disney/02/templates/js.gohtml
new file mode 100644
index 00000000..41087b11
--- /dev/null
+++ b/000_temp/50_disney/02/templates/js.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+{{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/03/main.go b/000_temp/50_disney/03/main.go
new file mode 100644
index 00000000..48f9645f
--- /dev/null
+++ b/000_temp/50_disney/03/main.go
@@ -0,0 +1,13 @@
+package main
+
+import "fmt"
+
+var x int = 42
+
+func init() {
+ fmt.Println("in init ", x)
+}
+
+func main() {
+ fmt.Println("in main ", x)
+}
diff --git a/000_temp/50_disney/04/main.go b/000_temp/50_disney/04/main.go
new file mode 100644
index 00000000..131d5fa6
--- /dev/null
+++ b/000_temp/50_disney/04/main.go
@@ -0,0 +1,31 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.HandleFunc("/dog", dog)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
+
+func dog(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "public/img/toby.jpg")
+}
diff --git a/000_temp/50_disney/04/public/img/toby.jpg b/000_temp/50_disney/04/public/img/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/50_disney/04/public/img/toby.jpg differ
diff --git a/000_temp/50_disney/04/templates/about.gohtml b/000_temp/50_disney/04/templates/about.gohtml
new file mode 100644
index 00000000..e7bc7333
--- /dev/null
+++ b/000_temp/50_disney/04/templates/about.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+All about Disney!
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/04/templates/index.gohtml b/000_temp/50_disney/04/templates/index.gohtml
new file mode 100644
index 00000000..eb1df9ba
--- /dev/null
+++ b/000_temp/50_disney/04/templates/index.gohtml
@@ -0,0 +1,15 @@
+
+
+
+
+
+ Index
+
+
+
+Hello Disney!
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/04/templates/js.gohtml b/000_temp/50_disney/04/templates/js.gohtml
new file mode 100644
index 00000000..41087b11
--- /dev/null
+++ b/000_temp/50_disney/04/templates/js.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+{{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/05_to-illustrate-not-working/main.go b/000_temp/50_disney/05_to-illustrate-not-working/main.go
new file mode 100644
index 00000000..749ae79d
--- /dev/null
+++ b/000_temp/50_disney/05_to-illustrate-not-working/main.go
@@ -0,0 +1,32 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.HandleFunc("/dog", dog)
+ http.Handle("/public/", http.FileServer(http.Dir("./public")))
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
+
+func dog(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "public/img/toby.jpg")
+}
diff --git a/000_temp/50_disney/05_to-illustrate-not-working/public/img/toby.jpg b/000_temp/50_disney/05_to-illustrate-not-working/public/img/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/50_disney/05_to-illustrate-not-working/public/img/toby.jpg differ
diff --git a/000_temp/50_disney/05_to-illustrate-not-working/templates/about.gohtml b/000_temp/50_disney/05_to-illustrate-not-working/templates/about.gohtml
new file mode 100644
index 00000000..e7bc7333
--- /dev/null
+++ b/000_temp/50_disney/05_to-illustrate-not-working/templates/about.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+All about Disney!
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/05_to-illustrate-not-working/templates/index.gohtml b/000_temp/50_disney/05_to-illustrate-not-working/templates/index.gohtml
new file mode 100644
index 00000000..3a62d64b
--- /dev/null
+++ b/000_temp/50_disney/05_to-illustrate-not-working/templates/index.gohtml
@@ -0,0 +1,15 @@
+
+
+
+
+
+ Index
+
+
+
+Hello Disney!
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/05_to-illustrate-not-working/templates/js.gohtml b/000_temp/50_disney/05_to-illustrate-not-working/templates/js.gohtml
new file mode 100644
index 00000000..41087b11
--- /dev/null
+++ b/000_temp/50_disney/05_to-illustrate-not-working/templates/js.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+{{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/06/main.go b/000_temp/50_disney/06/main.go
new file mode 100644
index 00000000..8361c048
--- /dev/null
+++ b/000_temp/50_disney/06/main.go
@@ -0,0 +1,32 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.HandleFunc("/dog", dog)
+ http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(http.Dir("./public"))))
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
+
+func dog(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "public/img/toby.jpg")
+}
diff --git a/000_temp/50_disney/06/public/img/toby.jpg b/000_temp/50_disney/06/public/img/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/50_disney/06/public/img/toby.jpg differ
diff --git a/000_temp/50_disney/06/templates/about.gohtml b/000_temp/50_disney/06/templates/about.gohtml
new file mode 100644
index 00000000..e7bc7333
--- /dev/null
+++ b/000_temp/50_disney/06/templates/about.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+All about Disney!
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/06/templates/index.gohtml b/000_temp/50_disney/06/templates/index.gohtml
new file mode 100644
index 00000000..7b9a9951
--- /dev/null
+++ b/000_temp/50_disney/06/templates/index.gohtml
@@ -0,0 +1,15 @@
+
+
+
+
+
+ Index
+
+
+
+Hello Disney!
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/06/templates/js.gohtml b/000_temp/50_disney/06/templates/js.gohtml
new file mode 100644
index 00000000..41087b11
--- /dev/null
+++ b/000_temp/50_disney/06/templates/js.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+{{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/07/main.go b/000_temp/50_disney/07/main.go
new file mode 100644
index 00000000..8361c048
--- /dev/null
+++ b/000_temp/50_disney/07/main.go
@@ -0,0 +1,32 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.HandleFunc("/dog", dog)
+ http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(http.Dir("./public"))))
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
+
+func dog(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "public/img/toby.jpg")
+}
diff --git a/000_temp/50_disney/07/public/css/index.css b/000_temp/50_disney/07/public/css/index.css
new file mode 100644
index 00000000..f12e4201
--- /dev/null
+++ b/000_temp/50_disney/07/public/css/index.css
@@ -0,0 +1,4 @@
+
+h1 {
+ color: red;
+}
\ No newline at end of file
diff --git a/000_temp/50_disney/07/public/img/toby.jpg b/000_temp/50_disney/07/public/img/toby.jpg
new file mode 100644
index 00000000..16fe5330
Binary files /dev/null and b/000_temp/50_disney/07/public/img/toby.jpg differ
diff --git a/000_temp/50_disney/07/templates/about.gohtml b/000_temp/50_disney/07/templates/about.gohtml
new file mode 100644
index 00000000..e7bc7333
--- /dev/null
+++ b/000_temp/50_disney/07/templates/about.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+All about Disney!
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/07/templates/index.gohtml b/000_temp/50_disney/07/templates/index.gohtml
new file mode 100644
index 00000000..5d448c0b
--- /dev/null
+++ b/000_temp/50_disney/07/templates/index.gohtml
@@ -0,0 +1,16 @@
+
+
+
+
+
+ Index
+
+
+
+
+Hello Disney!
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/07/templates/js.gohtml b/000_temp/50_disney/07/templates/js.gohtml
new file mode 100644
index 00000000..41087b11
--- /dev/null
+++ b/000_temp/50_disney/07/templates/js.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+{{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/08/main.go b/000_temp/50_disney/08/main.go
new file mode 100644
index 00000000..8361c048
--- /dev/null
+++ b/000_temp/50_disney/08/main.go
@@ -0,0 +1,32 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.HandleFunc("/dog", dog)
+ http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(http.Dir("./public"))))
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
+
+func about(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "about.gohtml", nil)
+}
+
+func dog(w http.ResponseWriter, r *http.Request) {
+ http.ServeFile(w, r, "public/img/toby.jpg")
+}
diff --git a/000_temp/50_disney/08/public/css/index.css b/000_temp/50_disney/08/public/css/index.css
new file mode 100644
index 00000000..9c412bd7
--- /dev/null
+++ b/000_temp/50_disney/08/public/css/index.css
@@ -0,0 +1,25 @@
+html, body, h1 {
+ padding: 0;
+ border: 0;
+ margin: 0;
+ box-sizing: border-box;
+}
+
+h1 {
+ color: blue;
+}
+
+main {
+ height: 100vh;
+ display: flex;
+ flex-direction: row;
+ flex-wrap: nowrap;
+ justify-content: center;
+ align-items: center;
+ font-size: 5vw;
+ background-image: url("http://github.com/assets/img/neu.jpg");
+ background-size: cover;
+ background-attachment: fixed;
+ background-repeat: no-repeat;
+ background-position: center;
+}
\ No newline at end of file
diff --git a/000_temp/50_disney/08/public/img/neu.jpg b/000_temp/50_disney/08/public/img/neu.jpg
new file mode 100644
index 00000000..cc2a09cd
Binary files /dev/null and b/000_temp/50_disney/08/public/img/neu.jpg differ
diff --git a/000_temp/50_disney/08/templates/about.gohtml b/000_temp/50_disney/08/templates/about.gohtml
new file mode 100644
index 00000000..e7bc7333
--- /dev/null
+++ b/000_temp/50_disney/08/templates/about.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+All about Disney!
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/08/templates/index.gohtml b/000_temp/50_disney/08/templates/index.gohtml
new file mode 100644
index 00000000..1b274b04
--- /dev/null
+++ b/000_temp/50_disney/08/templates/index.gohtml
@@ -0,0 +1,220 @@
+
+
+
+
+
+ Index
+
+
+
+
+
+ Hello From Disney!
+
+
+
+ 001
+ 002
+ 003
+ 004
+ 005
+ 006
+ 007
+ 008
+ 009
+ 010
+ 011
+ 012
+ 013
+ 014
+ 015
+ 016
+ 017
+ 018
+ 019
+ 020
+ 021
+ 022
+ 023
+ 024
+ 025
+ 026
+ 027
+ 028
+ 029
+ 030
+ 031
+ 032
+ 033
+ 034
+ 035
+ 036
+ 037
+ 038
+ 039
+ 040
+ 041
+ 042
+ 043
+ 044
+ 045
+ 046
+ 047
+ 048
+ 049
+ 050
+ 051
+ 052
+ 053
+ 054
+ 055
+ 056
+ 057
+ 058
+ 059
+ 060
+ 061
+ 062
+ 063
+ 064
+ 065
+ 066
+ 067
+ 068
+ 069
+ 070
+ 071
+ 072
+ 073
+ 074
+ 075
+ 076
+ 077
+ 078
+ 079
+ 080
+ 081
+ 082
+ 083
+ 084
+ 085
+ 086
+ 087
+ 088
+ 089
+ 090
+ 091
+ 092
+ 093
+ 094
+ 095
+ 096
+ 097
+ 098
+ 099
+ 100
+ 101
+ 102
+ 103
+ 104
+ 105
+ 106
+ 107
+ 108
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 118
+ 119
+ 120
+ 121
+ 122
+ 123
+ 124
+ 125
+ 126
+ 127
+ 128
+ 129
+ 130
+ 131
+ 132
+ 133
+ 134
+ 135
+ 136
+ 137
+ 138
+ 139
+ 140
+ 141
+ 142
+ 143
+ 144
+ 145
+ 146
+ 147
+ 148
+ 149
+ 150
+ 151
+ 152
+ 153
+ 154
+ 155
+ 156
+ 157
+ 158
+ 159
+ 160
+ 161
+ 162
+ 163
+ 164
+ 165
+ 166
+ 167
+ 168
+ 169
+ 170
+ 171
+ 172
+ 173
+ 174
+ 175
+ 176
+ 177
+ 178
+ 179
+ 180
+ 181
+ 182
+ 183
+ 184
+ 185
+ 186
+ 187
+ 188
+ 189
+ 190
+ 191
+ 192
+ 193
+ 194
+ 195
+ 196
+ 197
+ 198
+ 199
+ 200
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/50_disney/08/templates/js.gohtml b/000_temp/50_disney/08/templates/js.gohtml
new file mode 100644
index 00000000..41087b11
--- /dev/null
+++ b/000_temp/50_disney/08/templates/js.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+ About
+
+
+
+{{.}}
+
+
+
\ No newline at end of file
diff --git a/000_temp/51_bcrypt/main.go b/000_temp/51_bcrypt/main.go
new file mode 100644
index 00000000..c417ff68
--- /dev/null
+++ b/000_temp/51_bcrypt/main.go
@@ -0,0 +1,26 @@
+package main
+
+import (
+ "fmt"
+ "golang.org/x/crypto/bcrypt"
+)
+
+func main() {
+ s := `password123`
+ bs, err := bcrypt.GenerateFromPassword([]byte(s), bcrypt.MinCost)
+ if err != nil {
+ fmt.Println(err)
+ }
+ fmt.Println(s)
+ fmt.Println(bs)
+
+ loginPword1 := `password1234`
+
+ err = bcrypt.CompareHashAndPassword(bs, []byte(loginPword1))
+ if err != nil {
+ fmt.Println("YOU CAN'T LOGIN")
+ return
+ }
+
+ fmt.Println("You're logged in")
+}
diff --git a/000_temp/52-race-condition/01/main.go b/000_temp/52-race-condition/01/main.go
new file mode 100644
index 00000000..3b3bc863
--- /dev/null
+++ b/000_temp/52-race-condition/01/main.go
@@ -0,0 +1,33 @@
+package _1
+
+import (
+ "fmt"
+ "runtime"
+ "sync"
+)
+
+var counter = 0
+var mu sync.Mutex
+
+func main() {
+
+ const gs = 4
+ var wg sync.WaitGroup
+ wg.Add(gs)
+
+ for i := 0; i < gs; i++ {
+ go func() {
+ mu.Lock()
+ v := counter
+ // time.Sleep(time.Second * 2)
+ runtime.Gosched() // tells runtime to yield processor to other goroutine
+ v++
+ counter = v
+ mu.Unlock()
+ wg.Done()
+ }()
+ }
+ wg.Wait()
+
+ fmt.Println(counter)
+}
diff --git a/000_temp/52-race-condition/02/main.go b/000_temp/52-race-condition/02/main.go
new file mode 100644
index 00000000..75458660
--- /dev/null
+++ b/000_temp/52-race-condition/02/main.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "fmt"
+ "runtime"
+ "sync"
+)
+
+var wg sync.WaitGroup
+var counter int
+
+func main() {
+ fmt.Println(runtime.NumCPU())
+
+ const gs = 100
+ wg.Add(gs)
+
+ for i := 0; i < gs; i++ {
+ go func() {
+ v := counter
+ // time.Sleep(time.Second)
+ runtime.Gosched()
+ v++
+ counter = v
+ wg.Done()
+ }()
+ fmt.Println(runtime.NumGoroutine())
+ fmt.Println(runtime.NumCPU())
+ }
+ fmt.Println(runtime.NumGoroutine())
+ wg.Wait()
+ fmt.Println(counter)
+}
diff --git a/000_temp/52-race-condition/03_race/main.go b/000_temp/52-race-condition/03_race/main.go
new file mode 100644
index 00000000..991a46a6
--- /dev/null
+++ b/000_temp/52-race-condition/03_race/main.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "fmt"
+ "runtime"
+ "sync"
+)
+
+func main() {
+ fmt.Println("CPUs:", runtime.NumCPU())
+ fmt.Println("Goroutines:", runtime.NumGoroutine())
+
+ counter := 0
+
+ const gs = 100
+ var wg sync.WaitGroup
+ wg.Add(gs)
+
+ for i := 0; i < gs; i++ {
+ go func() {
+ v := counter
+ // time.Sleep(time.Second)
+ runtime.Gosched()
+ v++
+ counter = v
+ wg.Done()
+ }()
+ fmt.Println("Goroutines:", runtime.NumGoroutine())
+ }
+ wg.Wait()
+ fmt.Println("Goroutines:", runtime.NumGoroutine())
+ fmt.Println("count:", counter)
+}
diff --git a/000_temp/52-race-condition/04_mutex/main.go b/000_temp/52-race-condition/04_mutex/main.go
new file mode 100644
index 00000000..27f64acc
--- /dev/null
+++ b/000_temp/52-race-condition/04_mutex/main.go
@@ -0,0 +1,37 @@
+package main
+
+import (
+ "fmt"
+ "runtime"
+ "sync"
+)
+
+func main() {
+ fmt.Println("CPUs:", runtime.NumCPU())
+ fmt.Println("Goroutines:", runtime.NumGoroutine())
+
+ counter := 0
+
+ const gs = 100
+ var wg sync.WaitGroup
+ wg.Add(gs)
+
+ var mu sync.Mutex
+
+ for i := 0; i < gs; i++ {
+ go func() {
+ mu.Lock()
+ v := counter
+ // time.Sleep(time.Second)
+ runtime.Gosched()
+ v++
+ counter = v
+ mu.Unlock()
+ wg.Done()
+ }()
+ fmt.Println("Goroutines:", runtime.NumGoroutine())
+ }
+ wg.Wait()
+ fmt.Println("Goroutines:", runtime.NumGoroutine())
+ fmt.Println("count:", counter)
+}
diff --git a/000_temp/52-race-condition/05_atomic/main.go b/000_temp/52-race-condition/05_atomic/main.go
new file mode 100644
index 00000000..77c01daf
--- /dev/null
+++ b/000_temp/52-race-condition/05_atomic/main.go
@@ -0,0 +1,32 @@
+package main
+
+import (
+ "fmt"
+ "runtime"
+ "sync"
+ "sync/atomic"
+)
+
+func main() {
+ fmt.Println("CPUs:", runtime.NumCPU())
+ fmt.Println("Goroutines:", runtime.NumGoroutine())
+
+ var counter int64
+
+ const gs = 100
+ var wg sync.WaitGroup
+ wg.Add(gs)
+
+ for i := 0; i < gs; i++ {
+ go func() {
+ atomic.AddInt64(&counter, 1)
+ runtime.Gosched()
+ fmt.Println("Counter\t", atomic.LoadInt64(&counter))
+ wg.Done()
+ }()
+ fmt.Println("Goroutines:", runtime.NumGoroutine())
+ }
+ wg.Wait()
+ fmt.Println("Goroutines:", runtime.NumGoroutine())
+ fmt.Println("count:", counter)
+}
diff --git a/000_temp/52-race-condition/06_chan-pre-lecture/main.go b/000_temp/52-race-condition/06_chan-pre-lecture/main.go
new file mode 100644
index 00000000..e3083e04
--- /dev/null
+++ b/000_temp/52-race-condition/06_chan-pre-lecture/main.go
@@ -0,0 +1,33 @@
+package main
+
+import (
+ "fmt"
+ "runtime"
+ "sync"
+)
+
+func main() {
+ counter := 0
+
+ c := make(chan int)
+
+ const gs = 100
+ var wg sync.WaitGroup
+ wg.Add(gs)
+
+ go func() {
+ counter += <-c
+ fmt.Println("counter:\t", counter)
+ }()
+
+ for i := 0; i < gs; i++ {
+ go func() {
+ c <- 1
+ wg.Done()
+ }()
+ fmt.Println("Goroutines:", runtime.NumGoroutine())
+ }
+ wg.Wait()
+ close(c)
+ fmt.Println("total count:", counter)
+}
diff --git a/000_temp/53-hello-world/main.go b/000_temp/53-hello-world/main.go
new file mode 100644
index 00000000..68b2a816
--- /dev/null
+++ b/000_temp/53-hello-world/main.go
@@ -0,0 +1,7 @@
+package main
+
+import "fmt"
+
+func main() {
+ fmt.Println("Hello WORLD")
+}
diff --git a/000_temp/53_chan/main.go b/000_temp/53_chan/main.go
new file mode 100644
index 00000000..e0372a36
--- /dev/null
+++ b/000_temp/53_chan/main.go
@@ -0,0 +1,31 @@
+package main
+
+import "fmt"
+
+func foo(f, b chan int) {
+ for i := 0; i < 10000; i++ {
+ select {
+ case v := <-f:
+ fmt.Println("from foo:", v)
+ case v := <-b:
+ fmt.Println("from bar:", v)
+ }
+ }
+ fmt.Println("about to exit")
+}
+
+func main() {
+ f := make(chan int)
+ b := make(chan int)
+ go func() {
+ for i := 0; i < 5000; i++ {
+ f <- i
+ }
+ }()
+ go func() {
+ for i := 0; i < 5000; i++ {
+ b <- i
+ }
+ }()
+ foo(f, b)
+}
diff --git a/000_temp/54-paradise-html-css/01_html-css/index.html b/000_temp/54-paradise-html-css/01_html-css/index.html
new file mode 100644
index 00000000..f68b77f0
--- /dev/null
+++ b/000_temp/54-paradise-html-css/01_html-css/index.html
@@ -0,0 +1,227 @@
+
+
+
+
+ Title
+
+
+
+
+
+
+
+ PARADISE
+
+
+
+ 0001
+ 0002
+ 0003
+ 0004
+ 0005
+ 0006
+ 0007
+ 0008
+ 0009
+ 0010
+ 0011
+ 0012
+ 0013
+ 0014
+ 0015
+ 0016
+ 0017
+ 0018
+ 0019
+ 0020
+ 0021
+ 0022
+ 0023
+ 0024
+ 0025
+ 0026
+ 0027
+ 0028
+ 0029
+ 0030
+ 0031
+ 0032
+ 0033
+ 0034
+ 0035
+ 0036
+ 0037
+ 0038
+ 0039
+ 0040
+ 0041
+ 0042
+ 0043
+ 0044
+ 0045
+ 0046
+ 0047
+ 0048
+ 0049
+ 0050
+ 0051
+ 0052
+ 0053
+ 0054
+ 0055
+ 0056
+ 0057
+ 0058
+ 0059
+ 0060
+ 0061
+ 0062
+ 0063
+ 0064
+ 0065
+ 0066
+ 0067
+ 0068
+ 0069
+ 0070
+ 0071
+ 0072
+ 0073
+ 0074
+ 0075
+ 0076
+ 0077
+ 0078
+ 0079
+ 0080
+ 0081
+ 0082
+ 0083
+ 0084
+ 0085
+ 0086
+ 0087
+ 0088
+ 0089
+ 0090
+ 0091
+ 0092
+ 0093
+ 0094
+ 0095
+ 0096
+ 0097
+ 0098
+ 0099
+ 0100
+ 0101
+ 0102
+ 0103
+ 0104
+ 0105
+ 0106
+ 0107
+ 0108
+ 0109
+ 0110
+ 0111
+ 0112
+ 0113
+ 0114
+ 0115
+ 0116
+ 0117
+ 0118
+ 0119
+ 0120
+ 0121
+ 0122
+ 0123
+ 0124
+ 0125
+ 0126
+ 0127
+ 0128
+ 0129
+ 0130
+ 0131
+ 0132
+ 0133
+ 0134
+ 0135
+ 0136
+ 0137
+ 0138
+ 0139
+ 0140
+ 0141
+ 0142
+ 0143
+ 0144
+ 0145
+ 0146
+ 0147
+ 0148
+ 0149
+ 0150
+ 0151
+ 0152
+ 0153
+ 0154
+ 0155
+ 0156
+ 0157
+ 0158
+ 0159
+ 0160
+ 0161
+ 0162
+ 0163
+ 0164
+ 0165
+ 0166
+ 0167
+ 0168
+ 0169
+ 0170
+ 0171
+ 0172
+ 0173
+ 0174
+ 0175
+ 0176
+ 0177
+ 0178
+ 0179
+ 0180
+ 0181
+ 0182
+ 0183
+ 0184
+ 0185
+ 0186
+ 0187
+ 0188
+ 0189
+ 0190
+ 0191
+ 0192
+ 0193
+ 0194
+ 0195
+ 0196
+ 0197
+ 0198
+ 0199
+ 0200
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/54-paradise-html-css/01_html-css/main.css b/000_temp/54-paradise-html-css/01_html-css/main.css
new file mode 100644
index 00000000..35b0ccc9
--- /dev/null
+++ b/000_temp/54-paradise-html-css/01_html-css/main.css
@@ -0,0 +1,55 @@
+html, body, header, main, h1, div {
+ border: 0;
+ padding: 0;
+ margin: 0;
+}
+
+
+header {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100vw;
+ height: 6vh;
+ border-bottom: 1px solid gray;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ background-color: rgba(21, 85, 138, 0.25);
+}
+
+header > div {
+ /*border: 2px solid orange;*/
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 2.5rem;
+ color: white;
+ padding: 0 2rem;
+}
+
+header > div > span {
+ padding: 0 2rem;
+}
+
+header > div > span:hover {
+ color: blue;
+}
+
+main {
+ height: 100vh;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ background-image: url(http://github.com/paradise.jpeg);
+ background-position: center;
+ background-repeat: no-repeat;
+ background-attachment: fixed;
+ background-size: cover;
+}
+
+h1 {
+ color: white;
+ font-size: 12vw;
+}
\ No newline at end of file
diff --git a/000_temp/54-paradise-html-css/01_html-css/main.go b/000_temp/54-paradise-html-css/01_html-css/main.go
new file mode 100644
index 00000000..b05a38b6
--- /dev/null
+++ b/000_temp/54-paradise-html-css/01_html-css/main.go
@@ -0,0 +1 @@
+package _1_html_cs
diff --git a/000_temp/55-website/files/css/index.css b/000_temp/55-website/files/css/index.css
new file mode 100644
index 00000000..724561ab
--- /dev/null
+++ b/000_temp/55-website/files/css/index.css
@@ -0,0 +1,15 @@
+main {
+ height: 100vh;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ background-image: url("http://github.com/imgs/paradise.jpeg");
+ background-size: cover;
+ background-repeat: no-repeat;
+ background-position: center;
+}
+
+h1 {
+ font-size: 8rem;
+ color: white;
+}
\ No newline at end of file
diff --git a/000_temp/55-website/files/css/reset.css b/000_temp/55-website/files/css/reset.css
new file mode 100644
index 00000000..f4670548
--- /dev/null
+++ b/000_temp/55-website/files/css/reset.css
@@ -0,0 +1,61 @@
+html, body, div, span, h1, h2, h3, h4, h5, h6, button, p, blockquote, pre, a, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strong, sub, sup, b, u, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, figure, figcaption, footer, header, nav, output, section, time, mark, audio, video, input, textarea, select {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ /* inherits the browser's font properties: font-size 16px */
+ font: inherit;
+ /* specifies the vertical alignment of an inline element */
+ vertical-align: baseline;
+
+ box-sizing: border-box;
+
+ /* specifies the height of line boxes within the element. */
+ line-height: 1;
+
+ border-radius: 0;
+
+ /* no outline around anything */
+ outline: none;
+
+ /* inherit the color value of the parent */
+ color: inherit;
+}
+
+ol, ul {
+ /* no bullets in lists */
+ list-style: none;
+}
+
+a {
+ /* no underline */
+ text-decoration: none;
+}
+
+button {
+ cursor: pointer;
+ background-color: transparent;
+}
+
+blockquote, q {
+ /* no quotes */
+ quotes: none;
+}
+
+table {
+ /* no spacing between cells*/
+ border-spacing: 0;
+ /*borders are collapsed - adjacent table cells share borders */
+ border-collapse: collapse;
+}
+
+input, select, progress{
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ appearance: none;
+}
+
+svg {
+ width: 1.9em;
+ height: 1.9em;
+ fill: currentColor;
+}
\ No newline at end of file
diff --git a/000_temp/55-website/files/imgs/paradise.jpeg b/000_temp/55-website/files/imgs/paradise.jpeg
new file mode 100644
index 00000000..8e2b075a
Binary files /dev/null and b/000_temp/55-website/files/imgs/paradise.jpeg differ
diff --git a/000_temp/55-website/main.go b/000_temp/55-website/main.go
new file mode 100644
index 00000000..51e61ade
--- /dev/null
+++ b/000_temp/55-website/main.go
@@ -0,0 +1,17 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ loadRoutes()
+ http.ListenAndServe(":8080", nil)
+}
diff --git a/000_temp/55-website/rAbout.go b/000_temp/55-website/rAbout.go
new file mode 100644
index 00000000..12e1a845
--- /dev/null
+++ b/000_temp/55-website/rAbout.go
@@ -0,0 +1,13 @@
+package main
+
+import (
+ "log"
+ "net/http"
+)
+
+func about(w http.ResponseWriter, r *http.Request) {
+ err := tpl.ExecuteTemplate(w, "about.gohtml", nil)
+ if err != nil {
+ log.Println(err)
+ }
+}
diff --git a/000_temp/55-website/rIndex.go b/000_temp/55-website/rIndex.go
new file mode 100644
index 00000000..fbf9401c
--- /dev/null
+++ b/000_temp/55-website/rIndex.go
@@ -0,0 +1,13 @@
+package main
+
+import (
+ "log"
+ "net/http"
+)
+
+func index(w http.ResponseWriter, r *http.Request) {
+ err := tpl.ExecuteTemplate(w, "index.gohtml", nil)
+ if err != nil {
+ log.Println(err)
+ }
+}
diff --git a/000_temp/55-website/routes.go b/000_temp/55-website/routes.go
new file mode 100644
index 00000000..fa2bc17a
--- /dev/null
+++ b/000_temp/55-website/routes.go
@@ -0,0 +1,9 @@
+package main
+
+import "net/http"
+
+func loadRoutes() {
+ http.HandleFunc("/", index)
+ http.HandleFunc("/about", about)
+ http.Handle("/assets/", http.StripPrefix("/assets", http.FileServer(http.Dir("./files"))))
+}
diff --git a/000_temp/55-website/templates/about.gohtml b/000_temp/55-website/templates/about.gohtml
new file mode 100644
index 00000000..36065e4a
--- /dev/null
+++ b/000_temp/55-website/templates/about.gohtml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ Document
+
+
+
+About
+
+
\ No newline at end of file
diff --git a/000_temp/55-website/templates/index.gohtml b/000_temp/55-website/templates/index.gohtml
new file mode 100644
index 00000000..a4698a8a
--- /dev/null
+++ b/000_temp/55-website/templates/index.gohtml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+ Document
+
+
+
+
+
+
+ PARADISE
+
+
+
+
\ No newline at end of file
diff --git a/000_temp/56_SVCC-17/01a/main.go b/000_temp/56_SVCC-17/01a/main.go
new file mode 100644
index 00000000..4900f12c
--- /dev/null
+++ b/000_temp/56_SVCC-17/01a/main.go
@@ -0,0 +1,15 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", foo)
+ http.ListenAndServe(":8080", nil)
+}
+
+func foo(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, "Hello world")
+}
diff --git a/000_temp/56_SVCC-17/01b/main.go b/000_temp/56_SVCC-17/01b/main.go
new file mode 100644
index 00000000..279761d5
--- /dev/null
+++ b/000_temp/56_SVCC-17/01b/main.go
@@ -0,0 +1,15 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", foo)
+ http.ListenAndServe(":8080", nil)
+}
+
+func foo(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, "hello world")
+}
diff --git a/000_temp/56_SVCC-17/01c/main.go b/000_temp/56_SVCC-17/01c/main.go
new file mode 100644
index 00000000..c48636a0
--- /dev/null
+++ b/000_temp/56_SVCC-17/01c/main.go
@@ -0,0 +1,15 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, "Hello SVCC from Paypal")
+}
diff --git a/000_temp/56_SVCC-17/01d/main.go b/000_temp/56_SVCC-17/01d/main.go
new file mode 100644
index 00000000..68f251c9
--- /dev/null
+++ b/000_temp/56_SVCC-17/01d/main.go
@@ -0,0 +1,15 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ io.WriteString(w, "Hello GDG Fresno")
+}
diff --git a/000_temp/56_SVCC-17/02a/main.go b/000_temp/56_SVCC-17/02a/main.go
new file mode 100644
index 00000000..ffcebebe
--- /dev/null
+++ b/000_temp/56_SVCC-17/02a/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*"))
+}
+
+func main() {
+ http.HandleFunc("/", foo)
+ http.ListenAndServe(":8080", nil)
+}
+
+func foo(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
diff --git a/000_temp/56_SVCC-17/02a/templates/index.gohtml b/000_temp/56_SVCC-17/02a/templates/index.gohtml
new file mode 100644
index 00000000..a905aa5b
--- /dev/null
+++ b/000_temp/56_SVCC-17/02a/templates/index.gohtml
@@ -0,0 +1,12 @@
+
+
+
+
+ Document
+
+
+
+Hello world
+
+
+
\ No newline at end of file
diff --git a/000_temp/56_SVCC-17/02b/main.go b/000_temp/56_SVCC-17/02b/main.go
new file mode 100644
index 00000000..ffcebebe
--- /dev/null
+++ b/000_temp/56_SVCC-17/02b/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*"))
+}
+
+func main() {
+ http.HandleFunc("/", foo)
+ http.ListenAndServe(":8080", nil)
+}
+
+func foo(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
diff --git a/000_temp/56_SVCC-17/02b/templates/index.gohtml b/000_temp/56_SVCC-17/02b/templates/index.gohtml
new file mode 100644
index 00000000..f86b947c
--- /dev/null
+++ b/000_temp/56_SVCC-17/02b/templates/index.gohtml
@@ -0,0 +1,12 @@
+
+
+
+
+ Document
+
+
+
+HELLO FROM PAYPAL IN CALIFORNIA
+
+
+
\ No newline at end of file
diff --git a/000_temp/56_SVCC-17/02c/main.go b/000_temp/56_SVCC-17/02c/main.go
new file mode 100644
index 00000000..3c978b33
--- /dev/null
+++ b/000_temp/56_SVCC-17/02c/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
diff --git a/000_temp/56_SVCC-17/02c/templates/index.gohtml b/000_temp/56_SVCC-17/02c/templates/index.gohtml
new file mode 100644
index 00000000..30bdf087
--- /dev/null
+++ b/000_temp/56_SVCC-17/02c/templates/index.gohtml
@@ -0,0 +1,12 @@
+
+
+
+
+ Document
+
+
+
+HELLO FROM SVCC 2017 WOOHOOO!!!
+
+
+
\ No newline at end of file
diff --git a/000_temp/56_SVCC-17/02d/main.go b/000_temp/56_SVCC-17/02d/main.go
new file mode 100644
index 00000000..21ff5e92
--- /dev/null
+++ b/000_temp/56_SVCC-17/02d/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*.gohtml"))
+}
+
+func main() {
+ http.HandleFunc("/", index)
+ http.ListenAndServe(":8080", nil)
+}
+
+func index(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
diff --git a/000_temp/56_SVCC-17/02d/templates/index.gohtml b/000_temp/56_SVCC-17/02d/templates/index.gohtml
new file mode 100644
index 00000000..8e1962ae
--- /dev/null
+++ b/000_temp/56_SVCC-17/02d/templates/index.gohtml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+ Document
+
+
+
+HELLO FRESNO GDG
+
+
+
\ No newline at end of file
diff --git a/000_temp/56_SVCC-17/03a/main.go b/000_temp/56_SVCC-17/03a/main.go
new file mode 100644
index 00000000..ffcebebe
--- /dev/null
+++ b/000_temp/56_SVCC-17/03a/main.go
@@ -0,0 +1,21 @@
+package main
+
+import (
+ "html/template"
+ "net/http"
+)
+
+var tpl *template.Template
+
+func init() {
+ tpl = template.Must(template.ParseGlob("templates/*"))
+}
+
+func main() {
+ http.HandleFunc("/", foo)
+ http.ListenAndServe(":8080", nil)
+}
+
+func foo(w http.ResponseWriter, r *http.Request) {
+ tpl.ExecuteTemplate(w, "index.gohtml", nil)
+}
diff --git a/000_temp/56_SVCC-17/03a/templates/incl-footer.gohtml b/000_temp/56_SVCC-17/03a/templates/incl-footer.gohtml
new file mode 100644
index 00000000..37bdaade
--- /dev/null
+++ b/000_temp/56_SVCC-17/03a/templates/incl-footer.gohtml
@@ -0,0 +1,4 @@
+{{define "footer"}}
+