Skip to content

Instantly share code, notes, and snippets.

View montanaflynn's full-sized avatar

Montana Flynn montanaflynn

View GitHub Profile
@montanaflynn
montanaflynn / GOMOD.md
Created December 11, 2018 06:11
JUST TELL ME HOW TO USE GO MODULES
go mod init <modulename>

go get -u ./...

go mod vendor

go get -u <repo url>

go mod vendor
@montanaflynn
montanaflynn / clean.go
Created September 17, 2018 15:13
ZB exchange pair cleaner
package main
import (
"bufio"
"encoding/json"
"fmt"
"log"
"os"
"strings"
)
@montanaflynn
montanaflynn / wildcat.go
Created August 12, 2018 07:26
Simple wildcard concatenation program
package main
import (
"bytes"
"io/ioutil"
"log"
"os"
"path/filepath"
)
include .env
PROJECTNAME=$(shell basename "$(PWD)")
# Go related variables.
GOBASE=$(shell pwd)
GOPATH=$(GOBASE)/vendor:$(GOBASE):/home/azer/code/golang # You can remove or change the path after last colon.
GOBIN=$(GOBASE)/bin
GOFILES=$(wildcard *.go)
@montanaflynn
montanaflynn / terminal.go
Last active March 19, 2019 16:26
Watch for signals in terminal
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
"golang.org/x/crypto/ssh/terminal"
)
@montanaflynn
montanaflynn / context.go
Last active September 13, 2023 12:51
An example of using context to cancel goroutines between server handlers
package main
import (
"context"
"fmt"
"log"
"net/http"
"sync"
"time"
)
@montanaflynn
montanaflynn / SETUP.md
Last active July 30, 2018 07:53
Hackintosh GPU Setup

Hackintosh GPU Setup

Specifications (I am just listing critical components):

  OS: MacOS High Sierra 10.13.6
  Intel i7-8086k (or i7-8700k)
 64GB DDR4 3200 RAM - G.Skill Trident Z 
@montanaflynn
montanaflynn / combinations.go
Last active July 28, 2018 15:09
Maximum Combination Calculator
package main
import (
"fmt"
"math/big"
)
func factorial(n *big.Int) (result *big.Int) {
result = big.NewInt(1)
var one big.Int
@montanaflynn
montanaflynn / tienlen.go
Last active July 28, 2018 06:56
A simple program to deal Tien Len hands
package main
import (
"fmt"
"math/rand"
"sort"
"time"
"github.com/fatih/color"
)
@montanaflynn
montanaflynn / keybase.md
Created June 21, 2018 05:18
My keybase proof

Keybase proof

I hereby claim:

  • I am montanaflynn on github.
  • I am anonfunction (https://keybase.io/anonfunction) on keybase.
  • I have a public key ASDJ7jbNBlgbTot_HP-YBGppD9JHv0Mt0yV7jxoTTUE3Zwo

To claim this, I am signing this object: