Skip to content

Instantly share code, notes, and snippets.

View mt-digital's full-sized avatar
🎯
final week of my first 12-week year

Matt Turner mt-digital

🎯
final week of my first 12-week year
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mt-digital on github.
  • I am mtdigital (https://keybase.io/mtdigital) on keybase.
  • I have a public key ASASBKmQOvTG0ahXfQ0xmg8Ycb-RmK6rKT-QPylr9HmF_go

To claim this, I am signing this object:

@mt-digital
mt-digital / bayes_Lund_2017.R
Created September 21, 2018 03:19 — forked from rmcelreath/bayes_Lund_2017.R
Bayes@Lund2017 examples
# script for examples in Bayes@Lund2017 presentation
# joint model example
notes_max <- 10
rate_max <- 5
pm <- matrix( NA , nrow=rate_max+1 , ncol=notes_max+1 )
for ( i in 1:(rate_max+1) )
for ( j in 1:(notes_max+1) )
pm[i,j] <- dpois( j-1 , lambda=i ) * (1/(rate_max+1))
@mt-digital
mt-digital / colored_string_diff.py
Last active April 20, 2021 15:48
compare two strings and show differences in Python
'''
many of the colors in bcolors are not used, but kept for reference
'''
from difflib import Differ
def colored_string_diff(s1, s2):
""" Writes differences between strings s1 and s2 """
d = Differ()
diff = d.compare(s1.splitlines(), s2.splitlines())
diffList = [el for el in diff
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mt-digital
mt-digital / data.csv
Last active December 31, 2015 10:08
My first decent looking viz of US Department of Defense contracts from 2001-2003 for the five companies with the most total value in contracts.
contractor total
Lockheed 142.3628
McDonnell 45.545622
Boeing 35.795122
Mullen 34.29804
ADI 14.500
@mt-digital
mt-digital / README.md
Last active December 30, 2015 15:08
My First Gist/Bl.Ocks!

My First Bl.OCKS

Yeah!

@mt-digital
mt-digital / prelim_fedXML
Created March 11, 2013 07:02
Starting to work with federal contracts by fiscal year and department xml files. Using a mix of pandas and matplotlib, and a homebaked xml reader.
{
"metadata": {
"name": "DoD_other_example"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
@mt-digital
mt-digital / gist:c43c89b76852221e170e
Last active December 14, 2015 09:59
Cumulative Sum, augmented dickey fuller with rpy, non-stationarity of a random walk goodness...
{
"metadata": {
"name": "NonStaRWCSUMReduce"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{