Skip to content

Instantly share code, notes, and snippets.

View toffaletti's full-sized avatar
👻

Jason Toffaletti toffaletti

👻
  • Apple, Inc.
  • San Francisco, CA
View GitHub Profile
@toffaletti
toffaletti / future.go
Last active August 29, 2015 14:16 — forked from davecheney/future.go
package future
// A Future represents the result of some asynchronous computation.
// Future returns the result of the work as an error, or nil if the work
// was performed successfully.
// Implementers must observe these invariants
// 1. There may be multiple concurrent callers, or Future may be called many
// times in sequence, it must always return the same value.
// 2. Future blocks until the work has been performed.
type Future func() error
@toffaletti
toffaletti / sshd.go
Last active August 29, 2015 14:10 — forked from jpillora/sshd.go
// A simple SSH server providing bash sessions
//
// Server:
// cd my/new/dir/
// ssh-keygen -t rsa #generate server keypair
// go get -v .
// go run sshd.go
//
// Client:
// ssh foo@localhost -p 2022 #pass=bar