Skip to content

Instantly share code, notes, and snippets.

View astaxie's full-sized avatar
🏠
Working from home

astaxie astaxie

🏠
Working from home
View GitHub Profile
@astaxie
astaxie / gist:6c22bc0a3c5efab227d1
Last active August 29, 2015 14:02
framework benchmark
my system:
- go version go1.3 darwin/amd64
- Processor 1.3 GHz Intel Core i5
- Memory 8 GB 1600 MHz DDR3
- Software OS X 10.9.3 (13D65)
#GithubAPI Routes: 203
Beego: 182056 Bytes
Denco: 135400 Bytes
package main
import (
"fmt"
"log"
"os"
"runtime"
"runtime/debug"
"runtime/pprof"
"strconv"
@astaxie
astaxie / 推荐语
Created February 22, 2013 06:58
写的书快要出版了,麻烦各位读过的朋友写一下你们的推荐语,到时候我把你们的留言全部印刷到书里面去,谢谢大家了
谢谢
(gdb) run
Starting program: /home/xiemengjun/gdbfile
Starting main
count: 0
count: 1
count: 2
count: 3
count: 4
count: 5
count: 6
@astaxie
astaxie / markdown.css
Created October 22, 2012 07:51 — forked from zhimiaoli/markdown.css
github的markdown的样式
.markdown-body {
font-size: 14px;
line-height: 1.6;
}
.markdown-body > *:first-child {
margin-top: 0 !important;
}
.markdown-body > *:last-child {
margin-bottom: 0 !important;
}
@astaxie
astaxie / IsTextUTF8.go
Created July 18, 2012 15:53
golang IsTextUTF8
func IsTextUTF8(inputStream []byte) bool {
encodingBytesCount := 0
allTextsAreASCIIChars := true;
for i := 0; i < len(inputStream); i++ {
current := inputStream[i]
if (current & 0x80) == 0x80 {
allTextsAreASCIIChars = false
}
@astaxie
astaxie / randlist
Created July 17, 2012 09:11
golang rand list
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
fmt.Println("Hello, playground")
@astaxie
astaxie / Makefile
Created July 3, 2012 06:17 — forked from border/Makefile
json example in golang
include $(GOROOT)/src/Make.inc
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4
all:
$(GC) jsontest.go
$(LD) -o jsontest.out jsontest.$O
format:
$(GOFMT) -w jsontest.go