Skip to content

Instantly share code, notes, and snippets.

View genghisjahn's full-sized avatar

Jon Wear genghisjahn

View GitHub Profile
@genghisjahn
genghisjahn / row8.txt
Created September 9, 2016 03:41
8 row solution
Move: 1
0
* *
+ * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
package main
import (
"fmt"
"io"
"net/http"
"github.com/trout"
)
@genghisjahn
genghisjahn / md5hash.go
Created April 14, 2016 17:40
MD5 Hash Any
//MD5HashAny : will convert anything to a byte slice and return an MD5Hash
func MD5HashAny(s interface{}) string {
d, e := json.Marshal(&s)
if e != nil {
//I might regret this
return ""
}
return MD5HashBytes(d)
}
@genghisjahn
genghisjahn / searchcontains.go
Last active April 12, 2016 14:55
Golang Search Contains
//https://golang.org/src/sort/search.go
//https://golang.org/pkg/sort/#Search
package main
import (
"fmt"
"sort"
)
@genghisjahn
genghisjahn / waitgroup.go
Created January 12, 2016 18:27
Shows how to use a wait group to make sure all the go routines are done.
package main
import (
"fmt"
"math/rand"
"sync"
"time"
)
func main() {
@genghisjahn
genghisjahn / ham.go
Last active December 14, 2015 03:47
Hamming Distance Func
package main
import (
"fmt"
"strconv"
)
func main() {
a := "this is a test"
b := "wokka wokka!!!"

The hypothetical student, still a mule, would drift around for a while. He would get another kind of education quite as valuable as the one he’d abandoned, in what used to be called the "school of hard knocks." Instead of wasting money and time as a high-status mule, he would now have to get a job as a low-status mule, maybe as a mechanic. Actually his real status would go up. He would be making a contribution for a change. Maybe that’s what he would do for the rest of his life. Maybe he’d found his level. But don’t count on it.

In time...six months; five years, perhaps...a change could easily begin to take place. He would become less and less satisfied with a kind of dumb, day-to-day shopwork. His creative intelligence, stifled by too much theory and too many grades in college, would now become reawakened by the boredom of the shop. Thousands of hours of frustrating mechanical problems would have made him more interested in machine design. He would like to design machinery himself. He’d think he could do a

@genghisjahn
genghisjahn / vimstuff.txt
Created August 25, 2015 15:23
Vim installed stuff
Installed pathogen
Installed sensible-vim
Installed vim-go
Installed molokai color
@genghisjahn
genghisjahn / b2dsetup
Created July 14, 2015 14:17
boot2docker setup
boot2docker stop
install latest version of VBOX (currently 4.3.30)
install latest version of Boot2docker (currently https://github.com/boot2docker/osx-installer/releases/tag/v1.7.0)
boot2docker delete
boot2docker init
boot2docker start
boot2docker ssh 'sudo /etc/init.d/docker restart' # This line is key...
@genghisjahn
genghisjahn / log.go
Created June 1, 2015 15:47
Golang logging example
package main
import (
"os"
"github.com/go-logging"
)
//https://github.com/op/go-logging/
var log = logging.MustGetLogger("main")