Skip to content

Instantly share code, notes, and snippets.

@dzwarg
dzwarg / README.md
Created June 18, 2021 15:50
Illuminate some LEDs; one for each pull request open

Bitbucket blinkt

Purpose

Use the blinkt device to indicate how many PRs are open on a fixed set of repositories.

Platform

This software connects to Bitbucket Cloud's REST API to get information about some predetermined Git repositories.

@dzwarg
dzwarg / README.md
Last active June 17, 2021 19:31
Node crawling script to output a neo4j creation statements

Crawling and Graphing a Website

This script will crawl a website, and generate a loadable file that can be fed into neo4j to graph the network of links on a site.

Prerequisites

You will need nodejs installed, as well as neo4j.

Crawling

@dzwarg
dzwarg / commit-msg.py
Created June 17, 2021 18:34
JIRA commit-msg git hook
#!/usr/bin/env python
import re
import sys
COMMENT_RE = re.compile(r'^#.*$')
STORY_RE = re.compile(r'\b[A-Za-z]+-\d+\b')
BRANCH_RE = re.compile(r'^# On branch (?P<ticket>[A-Za-z]+-\d+)(-.*)?$')
def main ():
@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

@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 / 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 / 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

#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 / 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
{
@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>