Skip to content

Instantly share code, notes, and snippets.

View varun06's full-sized avatar

Varun varun06

View GitHub Profile
@nf
nf / analyze.go
Last active January 12, 2016 21:14
'spent' script to log where time is spent
package main
import (
"bufio"
"fmt"
"net/url"
"os"
"regexp"
"sort"
"strconv"
@grahamking
grahamking / slicemap_test.go
Created June 30, 2015 04:11
Benchmark comparing map access vs slice search
package main
import (
"math/rand"
"testing"
"time"
)
const (
numItems = 100 // change this to see how number of items affects speed
@cihangir
cihangir / sublimesetttings.json
Created August 2, 2014 19:00
GoSublime.sublime-settings
{
"env":{"GOPATH": "/Users/siesta/go"},
"snippets": [
{
"match": {"global": true},
"snippets": [
{"text": "prl", "title": "fmt.Println(...)", "value": "fmt.Println(\"$1-->\", $1)"},
{"text": "prlpr", "title": "Pretty fmt.Println(...)", "value": "fmt.Printf(\"$1 %# v\", pretty.Formatter($1))"},
{"text": "prf", "title": "fmt.Printf(...)", "value": "fmt.Printf(\"$1 %+v\", $1)\n\n$2"},
{"text": "err", "title": "err clause", "value": "if err != nil {\n\treturn err$2\n}\n$3"},
@michaljemala
michaljemala / tls-client.go
Last active November 12, 2024 23:20
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)