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
/* Shitty PCRE regexp benchmarking! | |
* $ gcc -o benchpcre benchpcre.c -ltr -lpcre | |
* $ ./benchpcre "^f.o$" "foo" | |
* result: 0 | |
* Without extras: | |
* 0.060841s elapsed | |
* With extras: | |
* 0.058072s elapsed | |
*/ | |
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
#!/usr/bin/env python | |
""" | |
Select some text and then "!fmtcomment". It understands "//" and | |
"#" comments, works with indenting in spaces and tabs. It assumes | |
you want to squeeze your text within 80-chars, and treats tabs as | |
4 spaces thusly. | |
E.g., will turn | |
// Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
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
$ ls | |
cpanfile | |
$ cat cpanfile | |
requires 'Module::Refresh', '== 0.17'; | |
requires 'Path::Class', '== 0.26'; | |
$ cpanm -L local --cpanfile cpanfile --installdeps . | |
--> Working on . | |
Configuring /home/jed/test ... OK | |
==> Found dependencies: Module::Refresh, Path::Class | |
--> Working on Module::Refresh |
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
/* | |
jed@thevm:~/go/src/bench/copy$ go test --test.bench=. --test.benchtime=10s . | |
testing: warning: no tests to run | |
PASS | |
BenchmarkAppendNil 50000 627957 ns/op | |
BenchmarkMakeCopy 50000 627037 ns/op | |
BenchmarkAppendMake 50000 611550 ns/op' | |
And using a 1k 's'... | |
BenchmarkAppendNil 50000000 563 ns/op |
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 ( | |
"flag" | |
"log" | |
"net/http" | |
) | |
var ( | |
flagLog = flag.Bool("log", false, "Log requests") |
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 ( | |
"flag" | |
"log" | |
"net/http" | |
"net/http/httputil" | |
"strings" | |
) |
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
#!/usr/bin/python | |
import argparse | |
import hashlib | |
import struct | |
import sys | |
p = argparse.ArgumentParser() | |
p.add_argument('nodes', type=int) | |
p.add_argument('vnodes', type=int, nargs='?', default=256) |