Skip to content

Instantly share code, notes, and snippets.

@dzwarg
dzwarg / git.tcl
Created October 20, 2011 19:42
DistrictBuilder IRC git info bot
global repo
set repo "/projects/PublicMapping/DistrictBuilder"
global ghurl
set ghurl "https://github.com/PublicMapping/DistrictBuilder/"
bind msg -|- ".help" helphandle
proc helphandle {nick host handle txt} {
puthelp "PRIVMSG $nick :I recongize the following commands:"
puthelp "PRIVMSG $nick : .rXYZ : Get the author, time, log message, and URL of commit XYZ."
puthelp "PRIVMSG $nick : .#XYZ : Get the title and URL to issue XYZ in GitHub."
@dzwarg
dzwarg / gist:1676990
Created January 25, 2012 16:11
Patch for development version upgrade
diff --git a/django/publicmapping/redistricting/management/commands/database_i18n.py b/django/publicmapping/redistricting/manageme
index a889235..3702116 100644
--- a/django/publicmapping/redistricting/management/commands/database_i18n.py
+++ b/django/publicmapping/redistricting/management/commands/database_i18n.py
@@ -100,7 +100,7 @@ class Command(BaseCommand):
# The short label for all districts in this body
poutil.add_or_update(
msgid=u'%s short label' % legislativebody.name,
- msgstr=legislativebody.title.replace('%s', '%(district_id)s')
+ msgstr=legislativebody.short_label.replace('%s', '%(district_id)s')
@dzwarg
dzwarg / gist:2352056
Created April 10, 2012 15:13
noUiSlider toggle offset bug
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>noUiSlider layout bug.</title>
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="nouislider.css"/>
<script type="text/javascript" src="jquery-1.7.1.js"></script>
<script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-button.js"></script>
<script type="text/javascript" src="jquery.nouislider.js"></script>
@dzwarg
dzwarg / gist:2423989
Created April 19, 2012 20:37
noUiSlider hidden 'move' method bug
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>noUiSlider move bug.</title>
<link rel="stylesheet" type="text/css" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="nouislider.css"/>
<script type="text/javascript" src="jquery-1.7.1.js"></script>
<script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-button.js"></script>
<script type="text/javascript" src="jquery.nouislider.js"></script>
@dzwarg
dzwarg / ProcessorTest.cs
Last active December 14, 2015 01:39
Example test setup for JSTest.NET
using JSTest;
using JSTest.ScriptElements;
using JSTest.ScriptLibraries;
using NUnit.Framework;
namespace JSLib.Test
{
[TestFixture]
public class ProcessorTests
{

#BTVVotes - Public Feedback

BTVVotes.org can be accessed here until the redistricing process has ended

  1. The press loves it but doesn't quite know what to make of it. One reporter expressed great respect for the council after giving up halfway through a plan; more a reflection on the process than on the tool in that case.
  2. The city likes the concept but doesn't see the need to move past PDFs - I was frequently asked to make "One of those GIS maps" in PDF to show something that had a perfectly-shareable URL. This could be reflective of the digital divide in some ways (big chunks of the city could be called "digitally disinfranchised"), but a basic failure of outreach in others. The city waffled.
  3. One misguided neighborh
@dzwarg
dzwarg / arcgis2geojson.js
Last active December 30, 2015 20:29
A script to scrape an ArcGIS server that has a feature limit of 500, in diminishing bounding boxes until the # of items returned is less than 500 per block.
// grab a URL from an ArcGIS Server in ersijson format
// and save it to a local .geojson file in GeoJSON format
// requires:
// esri2geo
var toGeoJSON = require('esri2geo'),
fs = require('fs'),
http = require('http');
// convert a box to as string, rounding to 5 decimal places
@dzwarg
dzwarg / web-servers.md
Created January 16, 2017 19:08 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@dzwarg
dzwarg / crawl.js
Last active July 1, 2017 13:51
A simple web crawler that spiders and copies a php website.
#!/usr/bin/env node
var Spider = require('node-spider'),
fs = require('fs'),
host = process.argv.length == 1 ? process.argv[0] : '',
filesToSave = -1,
start = Date.now();
// configure the spider
var spider = new Spider({
concurrent:1,
@dzwarg
dzwarg / 01-getting-started.md
Created October 11, 2019 17:20
Fractal Documentation Example

Getting Started

This link works in "server" mode:

View the Change Log

This link works in "build" mode:

View the Change Log