Skip to content

Instantly share code, notes, and snippets.

View boblannon's full-sized avatar

Bob Lannon boblannon

View GitHub Profile
@boblannon
boblannon / alliteration_bot.ipynb
Last active April 12, 2018 17:18
alliterative_android.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@boblannon
boblannon / PyniniIOTest-fail.txt
Last active April 4, 2018 20:12
PyniniIOTest fail
$ pytest -v -k PyniniIOTest
======================================================================= test session starts ========================================================================
platform darwin -- Python 2.7.14, pytest-3.5.0, py-1.5.3, pluggy-0.6.0 -- /Users/bob/analyze/geocoding_307_vocab-graph/env/bin/python2.7
cachedir: .pytest_cache
rootdir: /Users/bob/analyze/geocoding_307_vocab-graph/Pynini, inifile:
collected 158 items / 154 deselected
pynini_test.py::PyniniIOTest::testFileIO FAILED [ 25%]
pynini_test.py::PyniniIOTest::testGarbageReadRaisesFstIOError PASSED [ 50%]
pynini_test.py::PyniniIOTest::testPickleIO FAILED [ 75%]
@boblannon
boblannon / iterm_tab_title.sh
Last active February 24, 2016 15:50
bashrc_snippets
function tabtitle(){
REPO_NAME=`git rev-parse --show-toplevel 2> /dev/null | awk -F'/' '{print $NF}'`;
if [ -z "$REPO_NAME" ]
then
echo ""
else
echo "[$REPO_NAME] "
fi
}
if [ $ITERM_SESSION_ID ]; then
@boblannon
boblannon / sfcom_55289_total-iframe.html
Created October 22, 2013 22:05
HTML code to embed the 'Total Contributions From Individuals Over Time' map from "Political influence by county: A new way to look at campaign finance data" http://sunlightfoundation.com/blog/?p=55289
<div style="overflow: hidden;"><iframe src="http://assets.sunlightfoundation.com.s3.amazonaws.com/blog/azavea_maps/total.html" height="703" width="650"></iframe></div>
@boblannon
boblannon / sfcom_55289_pop-iframe.html
Created October 22, 2013 22:04
HTML code to embed the 'Contributions Per Capita in Each County' map from "Political influence by county: A new way to look at campaign finance data" http://sunlightfoundation.com/blog/?p=55289
<iframe src="http://assets.sunlightfoundation.com.s3.amazonaws.com/blog/azavea_maps/pop.html" height="703" width="650"></iframe>
@boblannon
boblannon / sfcom_55289_indep-iframe.html
Created October 22, 2013 22:02
HTML code to embed the 'Third-party presidential giving' map from "Political influence by county: A new way to look at campaign finance data" http://sunlightfoundation.com/blog/?p=55289
<iframe src="http://assets.sunlightfoundation.com.s3.amazonaws.com/blog/azavea_maps/indep.html" height="653" width="650"></iframe>
@boblannon
boblannon / sfcom_55289_pres-iframe.html
Created October 22, 2013 22:00
HTML code to embed the 'Contribution Share by Major Political Party' map from "Political influence by county: A new way to look at campaign finance data" http://sunlightfoundation.com/blog/?p=55289
<iframe src="http://assets.sunlightfoundation.com.s3.amazonaws.com/blog/azavea_maps/pres.html" height="703" width="650"></iframe>
@boblannon
boblannon / jenks2.py
Created September 26, 2013 20:32 — forked from llimllib/jenks2.py
import json
from pprint import pprint as pp
def jenks_matrices_init(data, n_classes):
#fill the matrices with data+1 arrays of n_classes 0s
lower_class_limits = []
variance_combinations = []
for i in xrange(0, len(data)+1):
temp1 = []
temp2 = []
def omnihash(obj):
""" recursively hash unhashable objects """
if isinstance(obj, set):
return hash(frozenset(omnihash(e) for e in obj))
elif isinstance(obj, (tuple, list)):
return hash(tuple(omnihash(e) for e in obj))
elif isinstance(obj, dict):
return hash(frozenset((k, omnihash(v)) for k, v in obj.items()))
else:
return hash(obj)