Skip to content

Instantly share code, notes, and snippets.

@fsouza
fsouza / gist:5265724
Created March 28, 2013 18:40
all.bash failure
% ./all.bash
# Building C bootstrap tool.
cmd/dist
# Building compilers and Go bootstrap tool for host, darwin/amd64.
lib9
libbio
libmach
misc/pprof
cmd/addr2line
@fsouza
fsouza / main.go
Last active December 16, 2015 07:29
func main() {
index, err := search.NewIndex(os.Args[1:]...)
if err != nil {
log.Fatal(err)
}
scanner := bufio.NewScanner(os.Stdin)
scanner.Split(bufio.ScanLines)
fmt.Print("> ")
for scanner.Scan() {
articles, err := index.Search(scanner.Text())
package main
import (
"github.com/fsouza/lb"
"net/http"
)
func main() {
l, _ := lb.NewLoadBalancer("http://localhost:8080", "http://localhost:8888", "http://localhost:9999")
http.Handle("/", l)
diff -r 8e1d1da398b3 src/feature.h
--- a/src/feature.h Mon Apr 15 22:22:57 2013 +0200
+++ b/src/feature.h Thu Apr 18 23:37:57 2013 -0300
@@ -525,14 +525,6 @@
#endif
/*
- * +syntax syntax highlighting. When using this, it's a good
- * idea to have +autocmd and +eval too.
- */
@fsouza
fsouza / Makefile
Last active December 16, 2015 14:18
Swap example.
OBJECTS=asm_swap.o swap.o
all: $(OBJECTS)
$(CC) -o swap $(OBJECTS)
clean:
rm -f swap *.o
package quota
// Usage represents the usage of units. It's a draft for #382.
//
// A user will have a limit of units, and an slice of the current units.
// Whenever the user creates a new unit (calling unit-add or app-create), it
// will get appended to the Current slice.
//
// Limit represents the maximum number of units.
//
package docker
type Client struct {
server string
}
func NewClient(server string) *Client {
return &Client{server: server}
}
#include <stdio.h>
struct Person
{
int x;
int y[4];
};
int
main(void)
#include <stdio.h>
int
main(void)
{
int x[4] = {4, 3, 2, 1};
int *p = x;
p += 3;
printf("%d\n", p[-2]);
}
% ./make.bash
# Building C bootstrap tool.
cmd/dist
# Building compilers and Go bootstrap tool for host, darwin/amd64.
lib9
libbio
libmach
misc/pprof
cmd/addr2line