Skip to content

Instantly share code, notes, and snippets.

View diego898's full-sized avatar

Diego Mesa diego898

View GitHub Profile
@diego898
diego898 / latex_math_colors.tex
Last active January 10, 2023 11:18
Defining some nice colors for use in latex math. Some are from seaborn, others are from https://flatuicolors.com
% Load color package
\usepackage{xcolor}
% Define Seaborn colors
\definecolor{seabornBlue}{RGB}{76,114,176}
\definecolor{seabornGreen}{RGB}{85,168,104}
\definecolor{seabornRed}{RGB}{196,78,82}
% Define FLATUI colors
\definecolor{orangePumpkin}{RGB}{211,84,0}
from sklearn import svm, datasets
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import confusion_matrix, classification_report, RocCurveDisplay, ConfusionMatrixDisplay, auc
# Import some data to play with
iris = datasets.load_iris()
X = iris.data
y = iris.target
target_names = iris.target_names[:2]
@diego898
diego898 / point-normal-plane-plot.py
Created March 13, 2018 17:45
python code to plot the point-normal version of a plane
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
%matplotlib inline
import seaborn as sns
# set normal vector, and point on plane
point = np.array([1, 2, 3])
normal = np.array([1, 1, 2])
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@diego898
diego898 / .macos
Last active January 11, 2021 20:05
Changes to macos defaults:
# Most of this was selectively copied/edited from: https://github.com/mathiasbynens/dotfiles/blob/master/.macos
# Disable the sound effects on boot
sudo nvram SystemAudioVolume=" "
# Expand save panel by default
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
# Expand print panel by default
@diego898
diego898 / activations.py
Created October 30, 2020 23:24
misc plotting code for our NN discussion
fig = plt.figure(figsize=(30,10))
# loss/acc
ax11 = plt.subplot(241)
ax11.plot(range(len(epoch_loss)),np.array(epoch_loss));
ax11.set_title('Epoch loss')
ax21 = plt.subplot(245)
ax21.plot(range(len(epoch_acc)),np.array(epoch_acc));
ax21.set_title('Epoch acc')
@diego898
diego898 / rd.md
Last active October 13, 2020 21:18
Enable Concurrent Remote Desktop Users in Windows 8.1 x64

thanks to @neurodyne and this link for updated instructions

This works with the following versions of termsrv.dll

x64 - termsrv.dll - 6.3.9600.17095

Find Replace
39813C0600000F849E310500 B80001000089813806000090
090085C07F078BD8 090085C090908BD8
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@diego898
diego898 / movetochrome.scpt
Created September 4, 2015 17:51
AppleScript file to move tabs from safari to chrome
tell application "Safari"
if not (exists document 1) then return
set theURL to URL of current tab of window 1
close current tab of window 1
end tell
tell application "Google Chrome"
if not (exists window 1) then
reopen
else
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.