Skip to content

Instantly share code, notes, and snippets.

Avatar

astaxie astaxie

View GitHub Profile
View gist:6c22bc0a3c5efab227d1
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
View profilingtool.go
package main
import (
"fmt"
"log"
"os"
"runtime"
"runtime/debug"
"runtime/pprof"
"strconv"
@astaxie
astaxie / 推荐语
Created Feb 22, 2013
写的书快要出版了,麻烦各位读过的朋友写一下你们的推荐语,到时候我把你们的留言全部印刷到书里面去,谢谢大家了
View gist:4031691
(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 Oct 22, 2012 — forked from zhimiaoli/markdown.css
github的markdown的样式
View markdown.css
.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 Jul 18, 2012
golang IsTextUTF8
View IsTextUTF8.go
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 Jul 17, 2012
golang rand list
View randlist
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
fmt.Println("Hello, playground")
@astaxie
astaxie / Makefile
Created Jul 3, 2012 — forked from border/Makefile
json example in golang
View Makefile
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
You can’t perform that action at this time.