Skip to content

Instantly share code, notes, and snippets.


Peter W techieshark

View GitHub Profile
techieshark / fb-event-attendees.html
Created Dec 8, 2011
List of people who responded yes/maybe to Facebook event
View fb-event-attendees.html
<title>Facebook Evevt Attendees</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="yes.js"></script>
<script type="text/javascript" src="maybe.js"></script>
<script type="text/javascript">
// code modified from
techieshark / fix_vancouver.csv
Created Jan 3, 2012
Location of Vancouver, WA for Managing News
View fix_vancouver.csv
Name Lat Lon Parent
Vancouver 45.63 -122.60 United States
techieshark /
Created Jan 10, 2012
Bash script to check for unused .us domains.
for i in `cat`; do
if [ -z "`dig $i +short`" ]; then
echo $i; echo $i | sed 's/\.//' | xargs dict;
techieshark / drupal_vocabs_nodecounts.sql
Created Jan 10, 2012
(Drupal) SQL to count #nodes in each term in each vocabulary.
View drupal_vocabs_nodecounts.sql
SELECT v.vid, AS Vocabulary, td.tid, AS Term, (SELECT count(*) FROM drupal_node n JOIN drupal_term_node tn2 ON n.nid = tn2.nid WHERE tn2.tid = td.tid) AS Count FROM drupal_vocabulary v JOIN drupal_term_data td ON v.vid = td.vid ORDER BY Count DESC;
View .bash.git.aliases
# Git
alias ga='git add'
alias gbs='git bisect'
alias gbl='git blame'
alias gb='git branch'
alias gco='git checkout'
alias gc='git commit'
alias gcl='git clone'
alias gcp='git cherry-pick'
alias gd='git diff'
View gist:67891cae67e44db0483a
Some questions that could be answered by the campaign finance database:
- How much money has been raised in Oregon in 2014? (In state? Out of state?)
- How much money has been spent in Oregon in 2014? (In state? Out of state?)
- Where is the money being spent on? (ex: bar chart, or maybe a wordle of the descriptions)
- How many unique donors are there in Oregon politics (in 2014)?
- What are the three most grass roots PACs? (most unique donations)
- What are the three least grass roots PACs? (fewest unique donations)
- What are the five PACs who have the highest % of their funding from out of state? (And what is that %?)
techieshark / 2013-Oregon-PACs-by-cash-raised.txt
Created Jun 1, 2014
Oregon Campaign Finance Exploration
View 2013-Oregon-PACs-by-cash-raised.txt
campaign_finance=# SELECT filer, ceil(SUM(amount))::text::money as total FROM raw_committee_transactions WHERE tran_date >= '2013-01-01' AND tran_date <= '2013-11-05' AND sub_type LIKE 'Cash Contribution' GROUP BY filer ORDER BY total;
filer | total
Friends of LaVonne Griffin-Valade | $2.00
Voter Approval of Urban Renewal | $5.00
Limit City Debt | $5.00
Jeremy Ferguson for Mayor | $5.00
Friends of Sal Peralta | $9.00
New Covenant PAC |
techieshark / political-spenders.txt
Created Jun 2, 2014
2013 Oregon Political Spenders
View political-spenders.txt
# Biggest spenders in Oregon Politics, in 2013.
# spender: the candidate or PAC
# freq: the number of times they gave to another candidate or PAC
# total: the sum of all contributions the spender made to another candidate or PAC
# using the database found here:
campaign_finance=# SELECT contributor_payee AS spender, COUNT(amount) as Freq, ceil(SUM(amount))::text::money as Total FROM raw_committee_transactions WHERE sub_type LIKE 'Cash Contribution' AND contributor_payee_committee_id IS NOT NULL AND tran_date >= '2013-01-01' AND tran_date <= '2013-12-31' GROUP BY spender ORDER BY total DESC;
spender | freq | total
View 14-0561.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View designer.html
<link rel="import" href="../paper-radio-group/paper-radio-group.html">
<link rel="import" href="../paper-radio-button/paper-radio-button.html">
<polymer-element name="my-element">
:host {
position: absolute;
width: 50%;