start new:
tmux
start new with session name:
tmux new -s myname
func randomString(size int) string { | |
alpha = `abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789` //better to define a const | |
buf := make([]byte, size) | |
for i := 0; i < size; i++ { | |
buf[i] = alpha[rand.Intn(len(alpha))] | |
} | |
return string(buf) | |
} |
package main | |
import "fmt" | |
type panique interface{} | |
type catch struct { | |
cause panique | |
} |
package main | |
import ( | |
"io" | |
"log" | |
"mime/multipart" | |
"net/http" | |
"os" | |
"path/filepath" | |
"runtime" |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<script class="jquery library" src="/js/sandbox/jquery/jquery-1.8.2.min.js" type="text/javascript"></script> | |
<title>RunJS 演示代码</title> | |
</head> | |
<body> | |
<div id="con"> | |
abcdefghijklmn | |
</div> |
package main | |
import "net" | |
import "fmt" | |
func main() { | |
fmt.Println(IsPrivateIP("111.11.191.17")) | |
fmt.Println(IsPrivateIP("192.168.0.100")) | |
fmt.Println(IsPrivateIP("10.0.8.100")) | |
} |
@import url(http://fonts.googleapis.com/css?family=Raleway:700,800); | |
html, body { margin: 0; } | |
:focus { outline: none; } | |
::-webkit-input-placeholder { color: #DEDFDF; } | |
::-moz-placeholder { color: #DEDFDF; } | |
:-moz-placeholder { color: #DEDFDF; } | |
::-ms-input-placeholder { color: #DEDFDF; } |
My name is {{.Name}} and I'm {{.Age}} years old!! |
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
package main | |
import ( | |
"myapp/webserver/app/common" | |
"github.com/golang/glog" | |
"github.com/gorilla/mux" | |
"encoding/json" | |
"strconv" | |
"flag" | |
"fmt" |