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" | |
"time" | |
"sync" | |
) | |
// A Token represents resources allocated. It must be given | |
// back to the Manager to free the resource. |
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
### | |
### Usage: blah [<options>] | |
### | |
### Description of the script | |
### | |
### Options: | |
### -f --flag | |
### Description of the flag | |
### -o --option <arg> | |
### Description of the option and argument |
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
include $(GOROOT)/src/Make.inc | |
TARG=l | |
DEP= | |
GOFILES=\ | |
main.go\ | |
pkgdir=$(GOROOT)/pkg/$(GOOS)_$(GOARCH) | |
PREREQ+=$(foreach PKG,$(DEP),$(pkgdir)/$(PKG).a) |
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" | |
"strings" | |
) | |
type foo int | |
const ( | |
One foo = iota |
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
include $(GOROOT)/src/Make.inc | |
PROTOFILES=$(wildcard *.proto) | |
GOPROTOFILES=$(patsubst %.proto,%.pb.go,$(PROTOFILES)) | |
TARG=protopackage | |
GOFILES=\ | |
$(GOPROTOFILES)\ | |
CLEANFILES+=$(GOPROTOFILES) |
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
4 # number of states | |
START | |
COLD | |
HOT | |
END | |
3 # size of vocab | |
1 | |
2 | |
3 |
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
#!/bin/bash | |
# Usage: gencert.sh | |
# Generates SSL certificates | |
set -e | |
PREFIX="my_" | |
function oops() { | |
echo "Failed." | |
exit 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
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type WaitList []*sync.WaitGroup | |
func (l WaitList) Done() { | |
for _, wg := range l { |
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
// assume the following exist and are set to unbuffered channels: | |
// var ( | |
// next chan Type | |
// in chan Type | |
// ) | |
go func() { | |
defer close(next) | |
// pending events (this is the "infinite" part) |
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 foo | |
import ( | |
"reflect" | |
"appengine" | |
"appengine/datastore" | |
) | |
var ( |
OlderNewer