This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"code.google.com/p/go.net/websocket" | |
) | |
func main() { | |
ws, err := websocket.Dial("ws://localhost:80/ws/", "", "http://localhost") | |
if err != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/gorilla/websocket" | |
"net/http" | |
"time" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import( | |
"net" | |
"fmt" | |
"bufio" | |
"time" | |
) | |
var emit chan []byte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
type Stream chan interface{} | |
type StreamMap func(interface{}) interface{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/gorilla/mux" | |
"github.com/gorilla/websocket" | |
"log" | |
"net/http" | |
"sync" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"time" | |
"fmt" | |
) | |
type Task func(interface{}) interface{} | |
type Sink func(interface{}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl localhost:7071/blocks -d '{"type":"delay"}' #1 | |
curl localhost:7071/blocks -d '{"type":"log"}' #2 | |
curl localhost:7071/blocks -d '{"type":"kvGet"}' #3 | |
curl localhost:7071/sources -d '{"type":"key-value"}' #4 | |
curl localhost:7071/blocks -d '{"type":"isError"}' #5 | |
curl localhost:7071/blocks -d '{"type":"latch"}' #6 | |
curl localhost:7071/blocks -d '{"type":"kvSet"}' #7 | |
curl localhost:7071/blocks -d '{"type":"gate"}' #8 | |
curl localhost:7071/blocks -d '{"type":"+"}' #9 | |
curl localhost:7071/blocks -d '{"type":"sink"}' #10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl localhost:7071/blocks -d '{"type":"+"}' #1 | |
curl localhost:7071/blocks -d '{"type":"first"}' #2 | |
curl localhost:7071/blocks -d '{"type":"sink"}' #3 | |
curl localhost:7071/blocks -d '{"type":"latch"}' #4 | |
curl localhost:7071/blocks -d '{"type":"log"}' #5 | |
curl localhost:7071/blocks -d '{"type":"identity"}' #6 | |
curl -X PUT localhost:7071/blocks/2/routes/0 -d '{"type":"const","value":true}' | |
curl -X PUT localhost:7071/blocks/4/routes/0 -d '{"type":"const","value":0}' | |
curl -X PUT localhost:7071/blocks/1/routes/1 -d '{"type":"const","value":1}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl localhost:7071/sources -d '{"type":"value"}' | |
curl -X PUT localhost:7071/sources/1/value -d '"Hello world"' | |
curl localhost:7071/blocks -d '{"type":"pusher"}' | |
curl localhost:7071/blocks -d '{"type":"log"}' | |
curl localhost:7071/blocks -d '{"type":"valueGet"}' | |
curl localhost:7071/links -d '{"source":1}' | |
curl localhost:7071/links -d '{"source":1,"block":4}' | |
curl localhost:7071/connections -d '{"source":{"id":2,"route":0},"target":{"id":4,"route":0}}' | |
curl localhost:7071/connections -d '{"source":{"id":4,"route":0},"target":{"id":3,"route":0}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you need a recurisve dot clean and your folders have spaces in them: | |
find . -type d | sed 's/^/"/g' | sed 's/$/"/g' | xargs dot_clean -m |
OlderNewer