Skip to content

Instantly share code, notes, and snippets.

View techieshark's full-sized avatar

Peter W techieshark

View GitHub Profile
@techieshark
techieshark / event-ids
Created August 5, 2014 01:47
event-ids
1924, 1925, 1926, 1927, 1928, 1235, 1237, 1245, 1246, 1250, 1251, 1252, 1253, 1255, 1256, 1265, 1269, 1270, 1272, 1277, 1280, 1283, 1285, 1287, 1290, 1292, 1295, 1297, 1298, 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1311, 1312, 1313, 1314, 1315, 1317, 1318, 1321, 1322, 1323, 1325, 1326, 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1339, 1341, 1342, 1345, 1348, 1350, 1352, 1354, 1355, 1357, 1359, 1360, 1362, 1363, 1372, 1380, 1389, 1391, 1393, 1396, 1398, 1405, 1406, 1407, 1409, 1410, 1413, 1414, 1416, 1417, 1420, 1422, 1423, 1425, 1426, 1430, 1431, 1433, 1437, 1438, 1439, 1440, 1441, 1443, 1445, 1447, 1448, 1449, 1451, 1452, 1456, 1457, 1459, 1460, 1461, 1462, 1464, 1472, 1473, 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1482, 1483, 1484, 1485, 1486, 1488, 1490, 1491, 1492, 1493, 1496, 1497, 1498, 1499, 1500, 1502, 1503, 1506, 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, 1519, 1520, 1521, 1522, 1524, 1525, 1526, 1529, 1530, 1533, 1535, 1536, 1537, 1538, 1539, 1540, 1541, 1543
@techieshark
techieshark / README.md
Last active August 29, 2015 14:05 — forked from mbostock/.block
Contributions by size and day to Scott Wiener's 2010 SF Campaign

Data retrieved Aug 9th, 2014 at the SF Ethics / Campaign Finance hackathon.

I did little to this visualization other than changing the data from that used in the original gist.

Original gist's description: This example demonstrates loading of CSV data, which is then quantized into a diverging color scale. The values are visualized as colored cells per day. Days are arranged into columns by week, then grouped by month and years. Colors by Cynthia Brewer. Layout inspired by Rick Wicklin and Robert Allison.

@techieshark
techieshark / legistar.rb
Created September 9, 2014 07:46
legistar stuff
module Legistar
module_function
# Takes objects with camel case property names and converts
# to ruby format.
# camelcase_object: just SomeObject object which needs to have
# SomeObjectPropertyNames changed to property_names
# prefix_to_strip: any CamelCase part like 'SomeObject' which should be
# removed before converting the rest of the name to snake_case
@techieshark
techieshark / index.html
Last active August 29, 2015 14:07
color generator. co-wrote with @ainsleywagon
<html>
<body>
<!--
<button data-state="name" data-name="MistyRose" data-hex='FFE4E1' data-rgb='255,228,225' class="col-md-1">MistyRose</button>
<button data-state="name" data-name="Blue" data-hex='0000FF' data-rgb='0,0,255' class="col-md-1">Blue</button> -->
<div id="favs"></div>
<div id="unfavs"></div>
@techieshark
techieshark / switch.sh
Created November 6, 2014 06:40
switch heroku db
# we had an existing postgres db on heroku and wanted to switch to another (larger or smaller)
heroku addons:add heroku-postgresql:standard-0 # standard-0 is the $50/mo database we want
heroku pg:wait # exits once the database is ready
heroku pg:info # figure out the new db's name… for this example it is HEROKU_POSTGRESQL_RED_URL, yours may differ
heroku pgbackups:transfer DATABASE_URL HEROKU_POSTGRESQL_RED_URL #copy all the data and enabled extensions
heroku pg:promote HEROKU_POSTGRESQL_RED_URL #make this db accessible via the DATABASE_URL name instead of this long but colorful one
@techieshark
techieshark / gist:7d6d7c851efe80829d93
Created November 24, 2014 22:35
follow-all-error
2014-11-24T22:17:42.216842+00:00 heroku[router]: at=info method=POST path="/follows" host=techieshark-follow-all.herokuapp.com request_id=1c90e2bf-a27f-4723-9cf4-ca522eec4987 fwd="24.5.76.148" dyno=web.1 connect=2ms service=493ms status=500 bytes=1669
2014-11-24T22:17:42.210119+00:00 app[web.1]: Completed 500 Internal Server Error in 476ms
2014-11-24T22:17:42.213234+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/faraday-0.9.0/lib/faraday/response.rb:9:in `block in call'
2014-11-24T22:17:42.213225+00:00 app[web.1]:
2014-11-24T22:17:42.213231+00:00 app[web.1]: Twitter::Error::Unauthorized (Read-only application cannot POST.):
2014-11-24T22:17:42.213232+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/twitter-5.13.0/lib/twitter/rest/response/raise_error.rb:15:in `on_complete'
2014-11-24T22:17:42.213239+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/faraday-0.9.0/lib/faraday/request/multipart.rb:14:in `call'
2014-11-24T22:17:42.213235+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/faraday-0.9.0/lib/far
@techieshark
techieshark / copy-into-browser.js
Last active November 9, 2018 12:14
jquery-and-lodash-in-console
// For quickly trying things out in the browser, jQuery and Lo-Dash (like Underscore.js) are great.
// Read the code below (never copy & paste code you don't trust),
// then you can copy & paste it into the browser console to load jQuery & lodash.
(function () {
var jq = document.createElement('script');
jq.src = 'https://code.jquery.com/jquery-2.1.4.js';
@techieshark
techieshark / find-twitters.js
Created December 12, 2014 23:57
get-all-twitter-links
// first make sure jQuery and Lo-Dash are in the browser by running https://gist.github.com/techieshark/45d6f183f80835757336
var links = _.map($('a'), function(a) { return $(a).attr('href')});
var twitters = _.filter(links, function(l) { return l && l.match(/twitter/) });
twitters.join('\n');
@techieshark
techieshark / update-council-info.sh
Created January 29, 2015 03:14
Syncing techieshark -> mesa Council Info:
git clone git@github.com:CityOfMesaAZ/council-info.git mesa-council-info
cd mesa-council-info/
git remote -v #view remotes already setup. looks like we need to add one:
git remote add techieshark https://github.com/techieshark/council-info.git
git fetch techieshark gh-pages
git merge techieshark/gh-pages
git push #push to origin with the new additions
@techieshark
techieshark / lots-o-git.sh
Created January 29, 2015 03:19
Cleaning Mesa's downstream repo / syncing with CfA
# This is kind of long. It should be a lot simpler in the future, once these steps are done.
# Clone repo:
git clone https://github.com/CityOfMesaAZ/MuniciPal.git mesa-municipal
# get into repo
cd mesa-municipal
# Add the upstream repository:
git remote add upstream https://github.com/codeforamerica/MuniciPal.git