Skip to content

Instantly share code, notes, and snippets.

View dwillis's full-sized avatar

Derek Willis dwillis

View GitHub Profile
(core)Dereks-MacBook-Air:openelex derekwillis$ invoke datasource.mappings -s md
Traceback (most recent call last):
File "/Users/derekwillis/code/core/bin/invoke", line 8, in <module>
load_entry_point('invoke==0.5.1', 'console_scripts', 'invoke')()
File "/Users/derekwillis/code/core/lib/python2.7/site-packages/invoke/cli.py", line 261, in main
dispatch(argv)
File "/Users/derekwillis/code/core/lib/python2.7/site-packages/invoke/cli.py", line 231, in dispatch
args, collection, tasks = parse(argv)
File "/Users/derekwillis/code/core/lib/python2.7/site-packages/invoke/cli.py", line 163, in parse
collection = loader.load_collection(args.collection.value)
Traceback (most recent call last):
File "/Users/derekwillis/code/core/bin/invoke", line 8, in <module>
load_entry_point('invoke==0.5.1', 'console_scripts', 'invoke')()
File "/Users/derekwillis/code/core/lib/python2.7/site-packages/invoke/cli.py", line 261, in main
dispatch(argv)
File "/Users/derekwillis/code/core/lib/python2.7/site-packages/invoke/cli.py", line 231, in dispatch
args, collection, tasks = parse(argv)
File "/Users/derekwillis/code/core/lib/python2.7/site-packages/invoke/cli.py", line 163, in parse
collection = loader.load_collection(args.collection.value)
File "/Users/derekwillis/code/core/lib/python2.7/site-packages/invoke/loader.py", line 65, in load_collection
@dwillis
dwillis / talks.md
Last active August 29, 2015 13:56
Lightning Talks NICAR 2014 Lineup
  1. Refactoring; or Why Your Code Sucks and How to Fix It, Christopher Groskopf
  2. A Few of My Favorite Wee Things, Lena Groeger
  3. Natural Language Processing in the kitchen, Anthony Pesce
  4. Five (more) algorithms in five (more) minutes, Chase Davis
  5. What we can learn from terrible data viz, Katie Park
  6. Practical Calculus, Steven Rich
  7. Detecting What Isn't There, Sisi Wei
  8. The whole internet in 5 minutes!, Jeremy Bowers
  9. How to Raise an Army, Tyler Fisher
  10. You Must Learn, Ben Welsh

Keybase proof

I hereby claim:

  • I am dwillis on github.
  • I am dwillis (https://keybase.io/dwillis) on keybase.
  • I have a public key whose fingerprint is B6AA 74D7 6FE5 1CEA 42AB 1E33 D4B7 DC44 6926 D2EE

To claim this, I am signing this object:

(function(){
$('#filterVoteStates').change(function () {
on_state = $(this).val()
on_party = $('#filterVoteParties').val()
if((on_state == 'all') && (on_party == 'A')){
$('table.roll-call-table tbody tr').show()
} else if((on_state != 'all') && (on_party == 'A')){
$('table.roll-call-table tbody tr[rel='+on_state+']').show()
$('table.roll-call-table tbody tr[rel!='+on_state+']').hide()
} else {
(core)dereks-air:core derekwillis$ invoke datasource.filename_url_pairs --state wv --datefilter 2000
(u'20001107__wv__general__president.csv',
u'http://www.sos.wv.gov/elections/history/electionreturns/Documents/2000/2000%20US%20President%20Gen.pdf')
(u'20001107__wv__general__senate.csv',
u'http://www.sos.wv.gov/elections/history/electionreturns/Documents/2000/2000%20US%20Senate%20Gen.pdf')
(u'20001107__wv__general__house.csv',
@dwillis
dwillis / gist:028af9c64827c5f70c90
Created June 24, 2014 17:06
TweetRewrite bookmarklet
javascript:q=location.href;if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;void(open('http://tweetrewrite.herokuapp.com/show?url='+encodeURIComponent(q)+'&result_type=recent','Rewrite', 'toolbar=no,width=700,height=350'));
from selenium import webdriver
from selenium.webdriver.support.ui import Select
election = {"year": "2012", "type": "primary", "id": "16", "datestring":"20120712"}
jurisdiction = {'slug': "carson_city", "id": "4", 'name':'Carson City'}
driver = webdriver.Firefox()
driver.get('http://www.nvsos.gov/electionresults/PrecinctReport.aspx')
election_select = Select(driver.find_element_by_name('ddlElections'))
election_select.select_by_value(election['id'])
Wrote a memo this am for pol practitioners about how to evaluate soc sci research. Sample size was discussed, but least important #bigdata
# FEC Updating Process SQL
# updating recind
SELECT * INTO [DevFEC].[fec_user].[lk_recindbak] FROM [DevFEC].[fec_user].[lk_recind] WHERE CYCLE='04';
DELETE FROM [DevFEC].[fec_user].[lk_recind] WHERE CYCLE='04';
INSERT INTO [DevFEC].[fec_user].[lk_recind]([filer_id], [trans_type], [INCLUDE], [CONTRIB], [PREFIX], [NICKNAME], [LNAME], [MI], [FNAME], [SUFFIX], [city], [state], [zip], [occupation], [employer], [newocc], [orgid], [personid], [recno], [datenew], [amountnew], [otherid], [cycle], [datafile], [timestamp], [notes])