15 |
16 |
29 |
30 |
--------------------------------------------------------------------------------
/websockets/v2/blind_alerter.go:
--------------------------------------------------------------------------------
1 | package poker
2 |
3 | import (
4 | "fmt"
5 | "io"
6 | "time"
7 | )
8 |
9 | // BlindAlerter schedules alerts for blind amounts.
10 | type BlindAlerter interface {
11 | ScheduleAlertAt(duration time.Duration, amount int, to io.Writer)
12 | }
13 |
14 | // BlindAlerterFunc allows you to implement BlindAlerter with a function.
15 | type BlindAlerterFunc func(duration time.Duration, amount int, to io.Writer)
16 |
17 | // ScheduleAlertAt is BlindAlerterFunc implementation of BlindAlerter.
18 | func (a BlindAlerterFunc) ScheduleAlertAt(duration time.Duration, amount int, to io.Writer) {
19 | a(duration, amount, to)
20 | }
21 |
22 | // Alerter will schedule alerts and print them to "to".
23 | func Alerter(duration time.Duration, amount int, to io.Writer) {
24 | time.AfterFunc(duration, func() {
25 | fmt.Fprintf(to, "Blind is now %d\n", amount)
26 | })
27 | }
28 |
--------------------------------------------------------------------------------
/websockets/v1/Gopkg.toml:
--------------------------------------------------------------------------------
1 | # Gopkg.toml example
2 | #
3 | # Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4 | # for detailed Gopkg.toml documentation.
5 | #
6 | # required = ["github.com/user/thing/cmd/thing"]
7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8 | #
9 | # [[constraint]]
10 | # name = "github.com/user/project"
11 | # version = "1.0.0"
12 | #
13 | # [[constraint]]
14 | # name = "github.com/user/project2"
15 | # branch = "dev"
16 | # source = "github.com/myfork/project2"
17 | #
18 | # [[override]]
19 | # name = "github.com/x/y"
20 | # version = "2.4.0"
21 | #
22 | # [prune]
23 | # non-go = false
24 | # go-tests = true
25 | # unused-packages = true
26 |
27 |
28 | [[constraint]]
29 | name = "github.com/gorilla/websocket"
30 | version = "1.4.0"
31 |
32 | [prune]
33 | go-tests = true
34 | unused-packages = true
35 |
--------------------------------------------------------------------------------
/websockets/v2/Gopkg.toml:
--------------------------------------------------------------------------------
1 | # Gopkg.toml example
2 | #
3 | # Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
4 | # for detailed Gopkg.toml documentation.
5 | #
6 | # required = ["github.com/user/thing/cmd/thing"]
7 | # ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
8 | #
9 | # [[constraint]]
10 | # name = "github.com/user/project"
11 | # version = "1.0.0"
12 | #
13 | # [[constraint]]
14 | # name = "github.com/user/project2"
15 | # branch = "dev"
16 | # source = "github.com/myfork/project2"
17 | #
18 | # [[override]]
19 | # name = "github.com/x/y"
20 | # version = "2.4.0"
21 | #
22 | # [prune]
23 | # non-go = false
24 | # go-tests = true
25 | # unused-packages = true
26 |
27 |
28 | [[constraint]]
29 | name = "github.com/gorilla/websocket"
30 | version = "1.4.0"
31 |
32 | [prune]
33 | go-tests = true
34 | unused-packages = true
35 |
--------------------------------------------------------------------------------
/math/example_clock.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |