Skip to content

Instantly share code, notes, and snippets.

View dylanbstorey's full-sized avatar

Dylan Storey dylanbstorey

View GitHub Profile
@dylanbstorey
dylanbstorey / 2016-1-19-WhatsInADatabase.pl
Last active January 19, 2016 07:31
How data was fetched and processed for the 1-19-2016 Whats in a Database post.
#!/usr/bin/perl
use warnings;
use strict;
use TaxonomyCirclePack;
use Storable;
use Data::Dumper;
=pod
@dylanbstorey
dylanbstorey / better_bi_plot.R
Last active May 17, 2016 21:41
Better Bi Plot
library(ggplot2)
library(reshape2)
library(vegan)
library(gplots)
library(ggrepel)
library(fossil)
multiplot <- function(..., plotlist=NULL, file, cols=1, layout=NULL) {
require(grid)
@dylanbstorey
dylanbstorey / GeneralAnalyeses
Last active July 5, 2016 16:08
General Analyses of a Micro Biome
library(ggplot2)
library(reshape2)
library(vegan)
library(gplots)
library(ggrepel)
library(fossil)
global_S <- NULL
@dylanbstorey
dylanbstorey / malhalanobis.py
Created February 8, 2017 01:16
Outlier Detection
def is_outlier(list, threshold=3.5):
"""
Returns a boolean array with True if points are outliers and False
otherwise.
Parameters:
-----------
points : An numobservations by numdimensions array of observations
thresh : The modified z-score to use as a threshold. Observations with
a modified z-score (based on the median absolute deviation) greater
@dylanbstorey
dylanbstorey / Bad.ipynb
Last active February 10, 2017 04:09
BadNotebook
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dylanbstorey
dylanbstorey / 2017-02-09-Doit_for_automating_tasks
Last active May 28, 2017 19:32
2017-02-09-Doit_for_automating_tasks
Dummy File
@dylanbstorey
dylanbstorey / class_load_save_methods.py
Last active May 31, 2017 17:49
load and save method example
import pickle
import os
from functools import partial
def function(text , a = 3):
print('this is a function with text {0} and a = {1}'.format(text , a))
class Test(object):
""" """
@dylanbstorey
dylanbstorey / db_operations.py
Last active July 25, 2017 17:42
SQL Alchemy
from dateutil.parser import parse
from skyscout.db_models import *
from sqlalchemy.exc import IntegrityError
import logging
logger = logging.getLogger(__name__)
def drop_all():
db.drop_all()
@dylanbstorey
dylanbstorey / log.py
Created July 31, 2017 13:27
A general logging class for most projects to start with.
"""
Adapted from Camille Scott's dammit logger :
https://github.com/camillescott/dammit/blob/master/dammit/log.py
and
Robpol86
https://github.com/Robpol86/Flask-Large-Application-Example/blob/master/manage.py#L81
@dylanbstorey
dylanbstorey / gist:327af47245dc1fb027f790a57944e072
Last active February 22, 2018 13:58
Doit tasks so i don't have to remember commands for software development.
import os
import fnmatch
import glob
import shutil
package = os.path.basename(os.path.dirname(__file__))
def task_docs():
"""
Build our documentation