Skip to content

Instantly share code, notes, and snippets.

@husobee
husobee / progress.sh
Last active Feb 24, 2021
fun beginnings of a bash progress bar
View progress.sh
#!/bin/bash
function progress {
cattail='='
cat1=' ,------, '
cat2=' | /\_/\ '
cat3=' |__( ^ .^) '
cat4=' "" "" '
echo;echo;echo;echo;echo;echo
@husobee
husobee / main.go
Created Dec 22, 2015
simple golang http middleware chaining example
View main.go
package main
import (
"fmt"
"net/http"
"time"
"golang.org/x/net/context"
"github.com/husobee/backdrop"
@husobee
husobee / client_tls_info.go
Last active Dec 14, 2020
discovery of tls in go, and the handshake process
View client_tls_info.go
package main
import (
"crypto/tls"
"encoding/json"
"fmt"
"log"
"net"
"net/http"
)
@husobee
husobee / gist:9ff87a6f27e9abb4a3bc
Created Mar 3, 2015
Example of Mocking in Golang, and Monkey Patch
View gist:9ff87a6f27e9abb4a3bc
package main
import "fmt"
type Something struct {}
func (s Something) Test() bool {
return false
}
type SomethingInterface interface {
@husobee
husobee / scanval.go
Last active Sep 23, 2020
scanner valuer example
View scanval.go
package main
import (
"database/sql"
"database/sql/driver"
"errors"
"fmt"
_ "github.com/mattn/go-sqlite3"
)
@husobee
husobee / validation-main.go
Created Jan 8, 2016
input validation sanely
View validation-main.go
package main
import (
"encoding/json"
"errors"
"net/http"
"github.com/asaskevich/govalidator"
)
View lw16.go
package main
import (
"crypto/hmac"
"crypto/rand"
"crypto/sha1"
"fmt"
"math/big"
)
@husobee
husobee / clww16.go
Created Oct 24, 2018
CLWW16 toy project
View clww16.go
package main
import (
"crypto/hmac"
"crypto/sha256"
"fmt"
)
func main() {
fmt.Println("Example CLWW 2016 Implementation")
@husobee
husobee / .tmux.conf
Created Jan 30, 2015
my tmux.conf for weemux
View .tmux.conf
set-option -g status-utf8 on
set -g status-interval 1
set -g status-justify left # center align window list
set -g status-left-length 75
set -g status-right-length 150
set -g status-fg white
set -g status-bg black
set -g status-attr bright
@husobee
husobee / .vimrc
Last active Apr 6, 2018
my vimrc
View .vimrc
" My .vimrc, it is pretty golang specific
colorscheme elflord
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
set rtp+=$GOROOT/misc/vim
" vundle plugins