Skip to content

Instantly share code, notes, and snippets.

View smallnest's full-sized avatar

smallnest smallnest

View GitHub Profile
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@smallnest
smallnest / go-missing-examples.md
Created January 15, 2018 03:21 — forked from andrestc/go-missing-examples.md
Go std lib funcs/methods missing examples

About this

This list has the goal of helping developers interested in contributing to the Go language but are unsure of where to start. This was not generated manually so some functions and methods here may not require examples (maybe because they are too simple, e.g .String()) and some of these may only make sense in a package level example (which are not considered for this list yet). Use your best judgment and check the documentation before you open up a CL to add an example.

You should also search in gerrit for open CLs that are already adding examples.

I will try to keep this list as up to date as possible. If you find any mistakes, please comment below and I will try to fix it.

@smallnest
smallnest / openssl.md
Created January 3, 2018 06:09 — forked from alphajc/openssl.md
有关openssl使用,详细的参数参见man手册

生成rsa key

openssl genrsa [-help] [-out filename] [-passout arg] [-aes128] [-aes192] [-aes256] [-camellia128] 
[-camellia192] [-camellia256] [-des] [-des3] [-idea] [-f4] [-3] [-rand file(s)] [-engine id] [numbits]

请求证书

@smallnest
smallnest / openssl.md
Created January 3, 2018 06:09 — forked from alphajc/openssl.md
有关openssl使用,详细的参数参见man手册

生成rsa key

openssl genrsa [-help] [-out filename] [-passout arg] [-aes128] [-aes192] [-aes256] [-camellia128] 
[-camellia192] [-camellia256] [-des] [-des3] [-idea] [-f4] [-3] [-rand file(s)] [-engine id] [numbits]

请求证书

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

@smallnest
smallnest / container.go
Created December 26, 2017 07:11 — forked from christophberger/container.go
A container in less than 60 lines of Go
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@smallnest
smallnest / epoll.go
Created November 28, 2017 12:22 — forked from tevino/epoll.go
Golang example for using epoll
package main
import (
"fmt"
"net"
"os"
"syscall"
)
const (
@smallnest
smallnest / client.go
Created October 9, 2017 03:56 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@smallnest
smallnest / gzip.go
Created September 25, 2017 04:20 — forked from alex-ant/gzip.go
golang: gzip and gunzip
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"log"
)
@smallnest
smallnest / sb.go
Created July 28, 2017 07:57 — forked from ice1000/sb.go
Java-like StringBuffer for Golang
package sb
import (
"fmt"
"strings"
)
const maxLength = 150
/// a java style string buffer