Skip to content

Instantly share code, notes, and snippets.

View stonemirror's full-sized avatar

David Schlesinger stonemirror

View GitHub Profile
@stonemirror
stonemirror / septemberneverended.py
Last active March 11, 2018 18:42
Eternal September Date Calculation
import datetime
days = ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"]
theNow = datetime.datetime.now()
theWeekday = days[theNow.weekday()]
theSeptDay = (datetime.date(theNow.year, theNow.month, theNow.day) - datetime.date(1993, 8, 31)).days
theLastDigit = theSeptDay % 10
if theLastDigit == 1:
theOrdinal = "st"
elif theLastDigit == 2:
theOrdinal = "nd"
@stonemirror
stonemirror / gunchart.py
Created February 21, 2018 05:31
Building a chart of gun law strictness v. gun death rates in Python...
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
#
# Read in the Brady Scores data, and extract the appropriate sheet into a DataFrame
#
workbook = pd.ExcelFile('Downloads/Brady-State-Scorecard-2014.xlsx')
dictionary = {}
for sheet_name in workbook.sheet_names:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2qDkMkjNvAKlT+qQdKmCCOR1GCFl+L8OPoYXr6IdKJ/9kVVWGsSxOUxrulAxwnLjfRuAgsG68HhlZKbx0oMVPppMScFBL2Fle3U/YIYczu9QrT7js1J4AV5VLu26o2uWEyWIuUmYDfSXrs5a8SunhK8q+eoEGACqOoTUyGOgstXhgeAd4l44D05O9OR6/N4bEgWmrwWZsFQeTT3Tdp12rPjIMG2fA4Y/DNb4nv703EWbp7K6jgY42kwihOR7Zek0pKan5XV/9SJEu9xMKJ15eVp3jb9GfF1Eb4eHFpRQtj4j8ExE4pyi86X99y8BUrxs4Dv+7Top1OKF6pmtFgUL7 mcfate@parrot
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7bBThdN9W9ttvwk6ccZcF+bjpi0eBe7ytp376UtunWsPTG124C7AodhimGPU1DbkihxL25JSrfhppQBmHCB/2OGq7lZf7YRTcPepPcbeUobkLAdgATAOJDc7EUoX6ZPpfpM2wvJYzBPqbEb0KdGW09qTCaUyBAVFh9YmvzAqsHckUohJs1BN+MPCzHTD6+4F2ZiiJPwEMmvm5IGhi9SzKAulDyLiZFpyMaJM1EMaO1BiSV+pe/trlYAyouLNx9fjQRxKXmKxI180XcWEaalfipWfG7/CnIQSf2nCM5hjSyvQRnMO//IB7yHh9bqvJ+EKYwPqCCkcLEZsAaIiJWTZh root@parrot
@stonemirror
stonemirror / gist:1bb4e9a50a89c0b1eb578f3a33d5256d
Created March 2, 2017 01:59
Problems building dev-qt/qtxmlpatterns-5.6.2::gentoo
======================================
OUTPUT OF `emerge --info '=dev-qt/qtxmlpatterns-5.6.2::gentoo'`
======================================
Portage 2.3.3 (python 3.4.5-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-4.9.4, glibc-2.23-r3, 4.5.2-aufs-r1 x86_64)
=================================================================
System Settings
=================================================================
System uname: Linux-4.5.2-aufs-r1-x86_64-Intel-R-_Core-TM-_i7-4558U_CPU_@_2.80GHz-with-gentoo-2.3
KiB Mem: 1002924 total, 191560 free
drwx------ 2 postfix root 4.0K Jan 1 11:41 active/
drwx------ 2 postfix root 4.0K Dec 31 08:59 bounce/
drwx------ 2 postfix root 4.0K Dec 31 08:59 corrupt/
drwx------ 10 postfix root 4.0K Jan 1 04:21 defer/
drwx------ 10 postfix root 4.0K Jan 1 04:21 deferred/
drwx------ 2 postfix root 4.0K Jan 1 11:07 flush/
drwx------ 2 postfix root 4.0K Dec 31 08:59 hold/
drwx------ 2 postfix root 4.0K Jan 1 09:50 incoming/
-rw-r--r-- 1 root root 0 Dec 31 16:03 .keep_mail-mta_postfix-0
drwx-wx--- 2 postfix postdrop 4.0K Dec 31 08:59 maildrop/
srw-rw-rw- 1 postfix postfix 0 Jan 1 11:36 anvil=
srw-rw-rw- 1 postfix postfix 0 Jan 1 11:36 bounce=
srw-rw-rw- 1 postfix postfix 0 Jan 1 11:36 defer=
srw-rw-rw- 1 postfix postfix 0 Jan 1 11:36 discard=
srw-rw-rw- 1 postfix postfix 0 Jan 1 11:36 error=
srw-rw-rw- 1 postfix postfix 0 Jan 1 11:36 lmtp=
srw-rw-rw- 1 postfix postfix 0 Jan 1 11:36 local=
srw-rw-rw- 1 postfix postfix 0 Jan 1 11:36 proxymap=
srw-rw-rw- 1 postfix postfix 0 Jan 1 11:36 proxywrite=
srw-rw-rw- 1 postfix postfix 0 Jan 1 11:36 relay=
postconf -nf output:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
compatibility_level = 2
content_filter = amavis:127.0.0.1:10024
daemon_directory = /usr/libexec/postfix
@stonemirror
stonemirror / gist:ba24e9cdf851ddc63bce1d8a470afb2c
Created September 17, 2016 16:13
Output from "brew update --debug"
++ [[ -z '' ]]
++ [[ -n '' ]]
++ [[ -n '' ]]
++ [[ -z '' ]]
++ HOMEBREW_AUTO_UPDATE_SECS=60
++ [[ -e /usr/local/Cellar ]]
++ [[ ! -w /usr/local/Cellar ]]
++ [[ ! -w /usr/local ]]
++ git --version
++ export GIT_TERMINAL_PROMPT=0
@stonemirror
stonemirror / keybase.md
Created September 9, 2016 03:17
keybase.md

Keybase proof

I hereby claim:

  • I am stonemirror on github.
  • I am mcfate (https://keybase.io/mcfate) on keybase.
  • I have a public key ASAi02tr7UsyK62hPN5T-hvdn-CL7uumT4s-x3RQbdKWigo

To claim this, I am signing this object: