Skip to content

Instantly share code, notes, and snippets.

View sadysnaat's full-sized avatar
🥷
Nature does not hurry, yet everything is accomplished

Deepak Sharma sadysnaat

🥷
Nature does not hurry, yet everything is accomplished
View GitHub Profile
@husobee
husobee / main.go
Created December 22, 2015 02:16
simple golang http middleware chaining example
package main
import (
"fmt"
"net/http"
"time"
"golang.org/x/net/context"
"github.com/husobee/backdrop"
@rayrutjes
rayrutjes / detectcontenttype.go
Created December 12, 2015 13:36
golang detect content type of a file
file, err := os.Open(path)
if err != nil {
return err
}
defer file.Close()
// Only the first 512 bytes are used to sniff the content type.
buffer := make([]byte, 512)
_, err = file.Read(buffer)
if err != nil {
@marcelbeumer
marcelbeumer / gist:5652379
Created May 26, 2013 10:34
Clear tmux pane with ctrl-k (like cmd-k clears a terminal) without polluting the bash history.
:bind-key -n C-k send-keys "clear && tmux clear-history; history -d $((\$HISTCMD-1))" \; send-keys "Enter"