Skip to content

Instantly share code, notes, and snippets.

Whyrusleeping whyrusleeping

Block or report user

Report or block whyrusleeping

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View README.md
View yamuxhang.go
package main
import (
"fmt"
"net"
"os"
"time"
"github.com/hashicorp/yamux"
)
View host-cmds.go
package main
import (
"fmt"
"net"
cmds "github.com/ipfs/go-ipfs/commands"
core "github.com/ipfs/go-ipfs/core"
corehttp "github.com/ipfs/go-ipfs/core/corehttp"
corenet "github.com/ipfs/go-ipfs/core/corenet"
View gist:b365259c2136a186d5da
### Keybase proof
I hereby claim:
* I am whyrusleeping on github.
* I am whyrusleeping (https://keybase.io/whyrusleeping) on keybase.
* I have a public key whose fingerprint is EEEB E873 9705 A3C7 D8B3 FCD1 602A 1369 B7EF 1C07
To claim this, I am signing this object:
View examples.md

ipfs examples

some basics

to get started, we need to make sure ipfs has been initialized, if you havent done this yet:

ipfs init

next lets start up the ipfs daemon:

View gist:8ba70de48412f46d4860
2014-10-20 09:50:49.336382 ERROR conn.go:157: Sent msg to peer without open conn: [Peer QmcKw6TB3Hta]
Got value: 'val'
2014-10-20 09:50:49.337095 ERROR conn.go:157: Sent msg to peer without open conn: [Peer QmfF4PoknRXu]
Got value: 'val'
2014-10-20 09:50:49.339916 ERROR service.go:236: no request key [18 32 74 177 131 7 163 24 217 228 53 90 144 68 160 225 53 151 106 230 64 179 32 143 173 4 204 27 69 232 80 83 67 189 61 57 40 106] (timeout?)
2014-10-20 09:50:49.339935 ERROR service.go:236: no request key [18 32 148 62 215 111 240 194 66 230 170 91 160 212 162 87 118 107 7 96 80 63 147 219 92 62 8 69 220 122 156 208 123 180 4 177 154 151] (timeout?)
Got value: 'val'
2014-10-20 09:50:49.344607 ERROR service.go:236: no request key [18 32 255 127 252 182 79 61 51 219 249 186 175 24 204 224 119 30 95 1 218 139 5 215 228 173 198 230 234 171 198 103 197 12 69 22 121 231] (timeout?)
2014-10-20 09:50:49.344658 ERROR service.go:236: no request key [18 32 148 62 215 111 240 194 66 230 170 91 160 212 162 87 118 107 7 96 8
@whyrusleeping
whyrusleeping / seqgen.go
Created Oct 17, 2014
generate all subsequences of a string
View seqgen.go
package main
import "fmt"
type seqGen struct {
baseStr string
curI int
ch chan string
}
View weird.go
package main
import (
"fmt"
)
type Fun func(int) int
type Thing struct {
A int
@whyrusleeping
whyrusleeping / gob.go
Created Oct 16, 2014
golang gob interface example
View gob.go
package main
import (
"bytes"
"encoding/gob"
"fmt"
)
type MyFace interface {
A()
View blah.json
{"links":[{"Source":0,"Target":18,"Value":1},{"Source":0,"Target":1,"Value":1},{"Source":0,"Target":13,"Value":1},{"Source":1,"Target":10,"Value":1},{"Source":1,"Target":8,"Value":1},{"Source":1,"Target":6,"Value":1},{"Source":1,"Target":5,"Value":1},{"Source":1,"Target":12,"Value":1},{"Source":1,"Target":11,"Value":1},{"Source":1,"Target":9,"Value":1},{"Source":1,"Target":3,"Value":1},{"Source":1,"Target":4,"Value":1},{"Source":1,"Target":2,"Value":1},{"Source":1,"Target":7,"Value":1},{"Source":13,"Target":15,"Value":1},{"Source":13,"Target":16,"Value":1},{"Source":13,"Target":14,"Value":1},{"Source":13,"Target":17,"Value":1},{"Source":18,"Target":19,"Value":1},{"Source":18,"Target":24,"Value":1},{"Source":18,"Target":21,"Value":1},{"Source":18,"Target":23,"Value":1},{"Source":18,"Target":20,"Value":1},{"Source":18,"Target":22,"Value":1}],"nodes":[{"Name":"QmcTUNMbpVtPoCY5jDfoaSJ8FPR4YybZtfTJo4mfZ2nXgB"},{"Name":"QmQ3dnZH2WUfoGj6x4K1vFKG5XNurTzEj4m1sCi7UGxLpa"},{"Name":"QmeDq6jqtNWYw6GQW2yzEWqPY6keXYiTAQRJUc
You can’t perform that action at this time.