Skip to content

Instantly share code, notes, and snippets.

View usmcamp0811's full-sized avatar

Matt usmcamp0811

View GitHub Profile
@usmcamp0811
usmcamp0811 / SmoothedZscoreAlgo.jl
Last active September 2, 2019 14:41
This is a Julia implimentation of a peak finding algorithm found at http://stackoverflow.com/a/22640362/6029703
using Statistics
using Plots
function SmoothedZscoreAlgo(y, lag, threshold, influence)
# Julia implimentation of http://stackoverflow.com/a/22640362/6029703
n = length(y)
signals = zeros(n) # init signal results
filteredY = copy(y) # init filtered series
avgFilter = zeros(n) # init average filter
stdFilter = zeros(n) # init std filter
@usmcamp0811
usmcamp0811 / PracticeStatisticQuestionsProblems.ipynb
Created September 16, 2018 02:04
Wanted to refresh my statistical skills so I found these questions online and put them into a Jupyter Notebook and did the could t-Tests in Julia.. knocking out two birds with one stone.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@usmcamp0811
usmcamp0811 / IndexCol.jl
Created September 15, 2018 02:33
a macro to more easily be able to index columns with stupid spaces..
#
macro __str(x)
:(Symbol($x))
end
_"Spaces Are Evil"
@usmcamp0811
usmcamp0811 / windows_logon_handler.py
Created August 24, 2018 17:18
Simple function that uses pyautoit to take care of the pesky windows login modal when you are trying to log into corporate sites that require you to authenticate.. I used this to automate getting some reports from parts of the enterprise that wouldn't allow me to have a SQL account.. some how me doing this was suppose to be more secure..
import autoit
import datetime
def login_handler(username, password):
"""
Hey PeopleSoft this is what I think of you pesky Windows Security modal (ಠ_ಠ)┌∩┐
Python to rule the world!
:param username: String
:param password: String
:return:
@usmcamp0811
usmcamp0811 / Dockerfile
Last active August 22, 2018 21:21
A Dockerfile that I am working on to get a Jupyterhub and Jupyter Lab setup on a corporate network
FROM jupyter/datascience-notebook:e5c5a7d3e52d
LABEL maintainer="Matt Camp <[email protected]>"
USER root
RUN echo "root:Docker!" | chpasswd
RUN echo "jovyan:Docker?" | chpasswd
RUN apt-get update \
&& apt-get install -y \
curl apt-utils apt-transport-https debconf-utils gcc build-essential g++-5\
@usmcamp0811
usmcamp0811 / datatables.js
Created August 15, 2018 19:57
How to refresh a DataTables table with new data from json or ajax..
function make_table(data){
$('#generic_datatable').empty();
var datatables_cols = [];
for(var cc=0; cc < data['columns'].length; cc++){
var col = { 'title': data['columns'][cc] };
datatables_cols.push(col);
}
@usmcamp0811
usmcamp0811 / datatables.js
Created August 1, 2018 17:31
Custome PDF in DataTables Example
$(document).ready(function() {
// Function to convert an img URL to data URL
function getBase64FromImageUrl(url) {
var img = new Image();
img.crossOrigin = "anonymous";
img.onload = function () {
var canvas = document.createElement("canvas");
canvas.width =this.width;
canvas.height =this.height;
var ctx = canvas.getContext("2d");
@usmcamp0811
usmcamp0811 / dataframe.js
Created June 12, 2018 19:53
Pandas jsonify(DataFrame.to_dict('split')) to JavaScript named object
function pandasSplitDict(df){
var dataframe = [];
var cols = df.columns;
var data = df.data;
for (var r = 0; r < data.length; r++){
var record = {};
for (var c = 0; c < cols.length; c++){
record[cols[c]] = data[r][c];
@usmcamp0811
usmcamp0811 / IntroductionToPandas.ipynb
Created April 17, 2018 15:59
A simple introduction to Pandas
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@usmcamp0811
usmcamp0811 / gist:bee744675aeb39e09e6b8e1c2c17058c
Last active March 26, 2018 13:26
Delete unwanted/sensitive file from git repo
git filter-branch --force --index-filter "git rm --cached --ignore-unmatch config.py" --prune-empty --tag-name-filter cat -- --all
git push origin master -f