Skip to content

Instantly share code, notes, and snippets.

Damon Zhao se77en

Block or report user

Report or block se77en

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
se77en / random_string.go
Last active Aug 29, 2015
random string in Go
View random_string.go
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)
se77en / try_catch.go
Created Apr 4, 2014
go with try catch
View try_catch.go
package main
import "fmt"
type panique interface{}
type catch struct {
cause panique
View client.go
package main
import (
View index.html
<html xmlns="">
<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>
<div id="con">
View IsPrivateIP.go
package main
import "net"
import "fmt"
func main() {
se77en / css
Last active Aug 29, 2015 — forked from CodeMyUI/css
Sign In/Up Transition By Fabrizio Bianchi :
View css
@import url(,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; }
se77en / index.gohtml
Last active Aug 29, 2015 — forked from ericlagergren/index.gohtml
Hot-reloading / hot-swapping live template files in Go
View index.gohtml
My name is {{.Name}} and I'm {{.Age}} years old!!
se77en / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
se77en / gist:420e7bd9a88fd65e9369
Created Oct 14, 2015 — forked from momer/gist:ac20357abd331e23b8ea
A pattern I created to maintain connections to an RPC server in Go. Since net/rpc does not provide any methods for automatically reconnecting to an RPC server, I needed a work-around. Additionally, rpc.Client does not export any state variables (rpc.Client.shutdown and rpc.Client.closing) nor does it export the Client's Mutex. So, we wrap the rp…
View gist:420e7bd9a88fd65e9369
package main
import (
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
You can’t perform that action at this time.