Skip to content

Instantly share code, notes, and snippets.

View shaunenslin's full-sized avatar

Shaun Enslin shaunenslin

View GitHub Profile
@shaunenslin
shaunenslin / nn_explore.py
Last active August 13, 2021 19:41
Neural networks
from mpl_toolkits.mplot3d import Axes3D
from sklearn.preprocessing import StandardScaler
from sklearn.preprocessing import LabelEncoder
import seaborn as sns
import matplotlib.pyplot as plt # plotting
import numpy as np # linear algebra
import os # accessing directory structure
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt
@shaunenslin
shaunenslin / gist:15ea2c2a133af2fe6565abf7f629c41e
Created March 11, 2019 05:31
GO Find a file next to your executable
var s string
var err error
s, err = os.Executable()
if err != nil {
return "", errors.Wrap(err, "os.executable")
}
ext := filepath.Ext(s)
outfile := s[0:len(s)-len(ext)] + ".toml"
return outfile, nil
@shaunenslin
shaunenslin / UnmarshalJSON.go
Created September 15, 2017 19:07
UnmarshalJSON json
/*
// JSONTime ..
type JSONTime time.Time
// UnmarshalJSON ..
func (ct *JSONTime) UnmarshalJSON(b []byte) (err error) {
const ctLayout = "2006-01-02"
const ctLayout2 = "2006-01-02T15:04:05Z"
s := strings.Trim(string(b), "\"")
fmt.Printf(">>>>>>>>>>>>>>> %v", s)