Skip to content

Instantly share code, notes, and snippets.

View wboykinm's full-sized avatar

Bill Morris wboykinm

View GitHub Profile
@wboykinm
wboykinm / crowdmapiframe.html
Created October 28, 2012 18:26
vtresponse crowdmap
<iframe src="https://vtresponse.crowdmap.com" width="100%" height="600px"></iframe>
@wboykinm
wboykinm / simplebase.js
Created October 28, 2012 23:06
B&W, simplified Google base layer
function initialize() {
var styler = [
{
stylers: [
{ saturation: -99 },
{ visibility: "simplified" },
{ lightness: 30 }
]
},{
featureType: "water",
@wboykinm
wboykinm / switchmap.g.js
Created October 31, 2012 17:55
switchmap.g.js
//Wax loads Layers into a GMaps wrapper:
var geocoder, map, interaction;
//Directs the click to the appropriate layer
$('td a').click(function() {
//Removes all button highlights then adds it to the active layer button
$('td a').removeClass('pressed')
$(this).addClass('pressed')
//Updates the legend with the new layer label:
$('div.switch-title').text("Marketing Scores for " + $(this).text())
@wboykinm
wboykinm / tooltip_buffer.js
Created November 1, 2012 17:38
Diff of orphaned tooltip_buffer code
- var tooltip = this.getTooltip(feature, context);
+
+
+ tooltip_buffer.push(feature); //20120312-ALaing- Add feature to the feature array.
+ // tooltipbuffer = tooltip_buffer.unique();
+
+
+ var tooltip_html =""; // 201203012-ALaing- Create string for HTML display.
+
+ // // Loop over each value in the array.
@wboykinm
wboykinm / wax.g.js
Created November 1, 2012 17:41
Wax for Google maps 6.0.4 updated w/ interaction.remove(); handler
/* wax - 7.0.0dev10 - v6.0.4-99-gbe8ba88 */
!function (name, context, definition) {
if (typeof module !== 'undefined') module.exports = definition(name, context);
else if (typeof define === 'function' && typeof define.amd === 'object') define(definition);
else context[name] = definition(name, context);
}('bean', this, function (name, context) {
var win = window
, old = context[name]
@wboykinm
wboykinm / publicmapping-error.log
Created November 8, 2012 15:52
publicmapping-error
[Thu Nov 08 10:13:07 2012] [error] DeprecationWarning)
[Thu Nov 08 10:13:43 2012] [error] /usr/local/lib/python2.6/dist-packages/django/utils/translation/__init__.py:63: DeprecationWarning: Translations in the project directory aren't supported anymore. Use the LOCALE_PATHS setting instead.
[Thu Nov 08 10:13:43 2012] [error] DeprecationWarning)
[Thu Nov 08 10:13:46 2012] [error] /usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py:1235: DeprecationWarning: The syntax for the url template tag is changing. Load the `url` tag from the `future` tag library to start using the new behavior.
[Thu Nov 08 10:13:46 2012] [error] category=DeprecationWarning)
[Thu Nov 08 15:13:50 2012] [error] [client 66.31.203.66] Premature end of script headers: publicmapping.wsgi, referer: http://ec2-23-20-163-79.compute-1.amazonaws.com/
[Thu Nov 08 10:14:14 2012] [error] /usr/local/lib/python2.6/dist-packages/django/utils/translation/__init__.py:63: DeprecationWarning: Translations in the project directory aren
@wboykinm
wboykinm / wax.g.js
Created November 8, 2012 18:33
wax.g.js 3.0.8
/* wax - 3.0.8 - 1.0.4-396-g2818da4 */
/*!
* Reqwest! A general purpose XHR connection manager
* copyright Dustin Diaz 2011
* https://github.com/ded/reqwest
* license MIT
*/
!function(context,win){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=win.JSON?win.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(
@wboykinm
wboykinm / hexbins.sql
Created November 15, 2012 15:28
Hexbins out of PostGIS
var query="WITH hgrid AS (SELECT CDB_HexagonGrid(ST_Expand(CDB_XYZ_Extent({x},{y},{z}),CDB_XYZ_Resolution({z}) * ({z}+1)),CDB_XYZ_Resolution({z}) * ({z}+1) ) as cell) SELECT hgrid.cell as the_geom_webmercator, count(i.cartodb_id) as prop_count FROM hgrid, coverage_oldweather_new_style i WHERE ST_Intersects(i.the_geom_webmercator, hgrid.cell) GROUP BY hgrid.cell";
@wboykinm
wboykinm / index.html
Last active October 12, 2015 20:08
Adaptive Map - Mapbox edition
<html>
<head>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<!--Pattern HTML-->
<div id="pattern" class="pattern">
@wboykinm
wboykinm / dberrors.log
Created November 19, 2012 16:23
db errors
/usr/local/lib/python2.6/dist-packages/django/utils/translation/__init__.py:63: DeprecationWarning: Translations in the project directory aren't supported anymore. Use the LOCALE_PATHS setting instead.
DeprecationWarning)
DEBUG:root:geolevel_name: region1_block
INFO:root:Error importing configuration.
INFO:root:Traceback (most recent call last):
File "/projects/DistrictBuilder/django/publicmapping/redistricting/management/commands/setup.py", line 166, in handle
all_ok = all_ok * self.import_prereq(config, force)
File "/projects/DistrictBuilder/django/publicmapping/redistricting/management/commands/setup.py", line 323, in import_prereq
success = success * config.import_scoring(force)
File "/projects/DistrictBuilder/django/publicmapping/redistricting/config.py", line 601, in import_scoring