Skip to content

Instantly share code, notes, and snippets.

View genghisjahn's full-sized avatar

Jon Wear genghisjahn

View GitHub Profile
Move: 1
*
* *
+ * *
* * * *
0 * * * *
* * * * * *
* * * * * * *
Move: 2
@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 / fizzbuzzpy.py
Last active December 28, 2015 22:09
FizzBuzz exercise in python.
__author__ = 'genghisjahn'
num=1
result = ""
while num<=100:
if(num % 3 == 0 and num % 5 == 0):
result="FizzBuzz"
else:
if(num % 3 == 0):
// PointerTest project main.go
package main
import (
"fmt"
)
func main() {
@genghisjahn
genghisjahn / divisor.go
Created September 26, 2013 01:29
FizzBuzzDivisor for BlogPost
package fizzbuzz
import(
"strconv"
)
type FizzBuzzDivisor struct{
Value int //Value to be tested.
Message string //Message if a condition is met.
}
func (fbd FizzBuzzDivisor) GetResult(num int) string {
@genghisjahn
genghisjahn / fizzbuzzproc-blog.go
Created September 24, 2013 01:20
Source code for blog post on FizzBuzz Go.
package fizzbuzz
import(
"strconv"
)
type FizzBuzzProcessor struct{
Items
}