Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Tigas mtigas

View GitHub Profile
View dnsmasq.conf
#server=127.0.0.1#9053
server=8.8.8.8
server=8.8.4.4
domain-needed
bogus-priv
listen-address=127.0.0.1
no-resolv
local-ttl=300
neg-ttl=3600
View keybase.md

Keybase proof

I hereby claim:

  • I am mtigas on github.
  • I am mtigas (https://keybase.io/mtigas) on keybase.
  • I have a public key whose fingerprint is 4034 E60A A782 7C5D F21A 89AA A993 E715 6E0E 9923

To claim this, I am signing this object:

View gini-1.py
from __future__ import division
def gini(population):
"""
https://en.wikipedia.org/wiki/Gini_coefficient#Calculation
see "This may be simplified to:"
"""
pop = sorted(population)
n = len(pop)
@mtigas
mtigas / default.json
Created Jul 9, 2014
Examples of the three output formats for the Nonprofit Explorer API: default mode, "output=flat", and "output=noorg". See https://projects.propublica.org/nonprofits/api/
View default.json
/* Example of "output=flat" format.
* https://projects.propublica.org/nonprofits/api/v1/search.json?q=propublica */
{
"total_results": 2,
"filings": [
{
"tax_prd": 201212,
"tax_prd_yr": 2012,
"formtype": 0,
"pdf_url": "https://bulk.resource.org/irs.gov/eo/2013_09_EO/14-2007220_990_201212.pdf",
@mtigas
mtigas / gist:25d680ccea78ad7db37a
Last active Aug 29, 2015
Links to my slides & notes & maybe other stuff from the CryptoPartyNYC: Journalist Edition shindig, December 8, 2014.
View gist:25d680ccea78ad7db37a
View gist:214972
===== Places vs Place, 1 variable; Significance/Strength of Difference =====
Given the data for each county in one state and each county in another
(two samples), determine whether crime rate (one variable) is significantly
higher (in a statistics sense) in one state versus the other.
---
We're testing *one* variable, technically, but if we have a function written
up for this, we could actually forloop this and list various demographics --
population, crime rate, education, etc -- and show the difference between the
View gist:219443
# .zshrc
alias lstree="ls -R | grep \":$\" | sed -e 's/:$//' -e 's/[^-][^\/]*\//–/g' -e 's/^/ /' -e 's/-/|/'"
autoload colors zsh/terminfo
if [[ "$terminfo[colors]" -ge 8 ]]; then
colors
fi
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do
eval PR_$color='%{$terminfo[bold]$fg[${(L)color}]%}'
View mpl_test.py
# coding=utf-8
from matplotlib.figure import Figure
def make_example_pie():
"""
Follows the simple pie chart demo[1] from matplotlib's gallery, but
rewritten in a cleaner fashion that can be used for PNG rendering.
[1] http://matplotlib.sourceforge.net/examples/pylab_examples/pie_demo.html
"""
View komu_story_nophoto.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- non-standard XML format, obviously -->
<!-- example for this story:
http://www.komu.com/satellite/SatelliteRender/KOMU.com/ba8a4513-c0a8-2f11-0063-9bd94c70b769/e46a687c-80ce-0971-006f-a167008c2203
-->
<!-- should newlines in this be \n delimited? -->
<body><![CDATA[LAFAYETTE COUNTY - Horrifying details continue to surface after Missouri authorities arrested five family members on an array of child sexual abuse charges.
Law enforcement continues its search of the Mohler's property, located about 30 miles east of Kansas City. Authorities began searching Tuesday evening, and they're convinced there's still a lot of evidence to find. Authorities have confirmed they are looking for bodies buried on the property. They are also looking for glass jars that contain notes written by victims with the details of the abuse.
View komu_story_withphoto.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- non-standard XML format, obviously -->
<!-- example for this story:
http://www.komu.com/satellite/SatelliteRender/KOMU.com/ba8a4513-c0a8-2f11-0063-9bd94c70b769/e56e519a-80ce-0971-00b6-57a8d5e46f84
-->
<!-- should newlines in this be \n delimited? -->
<body><![CDATA[COLUMBIA - Columbia Transit announced Wednesday it reached its goal of two million riders for the 2009 fiscal year that ended in September.
Columbia Transit announced Wednesday it reached its goal of two million riders for the 2009 fiscal year, which ended in September. Despite initial predictions of a decrease in bus ridership, there are more Columbia passengers than ever before. Transit supervisor Drew Brooks said changes in the economy may have contributed to this year's success.
You can’t perform that action at this time.