Skip to content

Instantly share code, notes, and snippets.

@bmount
bmount / .vimrc
Created May 5, 2014 09:05
Vimrc, go fmt, def, makefile, markdown
" runtime
set runtimepath=~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after
execute pathogen#infect()
" tabs in makefiles
set nocompatible
set visualbell
" global
<!doctype html>
<meta charset="utf-8">
<body>
<form action=# method="GET">
Zip code: <input id=zip-query type="text" name="zip" />
<input id=zip-submit type="submit" value="Submit" />
</form>
#!/bin/bash
usage()
{
cat << EOF
usage: $0 options
Everything except --help takes a single dash.
OPTIONS:
// Add G, [minx, miny, maxx, maxy] as a bbox option to polymaps, after line 212:
case "G": {
var nw = po.map.coordinateLocation({row: c.row, column: column, zoom: c.zoom}),
se = po.map.coordinateLocation({row: c.row + 1, column: column + 1, zoom: c.zoom}),
pn = Math.ceil(Math.log(c.zoom) / Math.LN2);
return nw.lon.toFixed(pn)
+ "," + se.lat.toFixed(pn)
+ "," + se.lon.toFixed(pn)
+ "," + nw.lat.toFixed(pn);
}
@bmount
bmount / wp_bulk_upload_photo_directories_via_rss.py
Created December 21, 2011 11:05
Bulk upload directory tree photo galleries to wordpress via RSS
# a jinja2 xml template compatible with Wordpress RSS
# import. Based on Flickr GeoRSS format.
# wp rss import v 0.2 did not like couple of other
# variations on this.
# takes dictionary like {"directory/subdir":[list, of, filenames],
# "dir2/subdir":[other, file, names]}
<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
@bmount
bmount / polymaps-bvmou-nonwrapping-tms-template.js
Created December 26, 2011 22:34
couple of polymaps tweaks for tms 1.0 (template H line ~205) and couchdb bbox (case "G" same vicinity)
if (!org) var org = {};
if (!org.polymaps) org.polymaps = {};
(function(po){
po.version = "2.5.1"; // semver.org
var zero = {x: 0, y: 0};
po.ns = {
svg: "http://www.w3.org/2000/svg",
xlink: "http://www.w3.org/1999/xlink"
@bmount
bmount / conway.c
Created June 15, 2012 00:48
game of life
#include <stdio.h>
#include <stdlib.h>
#define X 121
#define Y 51
// Conway's Game of Life
// make conway && ./conway
// change X and Y for display area
@bmount
bmount / postgres_plist.xml
Created June 15, 2012 00:49
postgres plist a la homebrew
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>org.pg92beta.plist</string>
<key>ProgramArguments</key>
<array>
@bmount
bmount / datafirst.md
Created October 17, 2012 00:05
Data before APIs before Applications

This is a little feedback for people implementing open government (geo-) data projects — the good guys, like Bronwyn Agrios and Jay Nath. I had a little interaction today with some of you, related to a pedestrian safety dataset and interactive map:

@jay_nath @ajturner @bronwynagrios @shannonspanhake It takes more time for a programmer to figure out that API than to make a better map...

— Brian Mount (@brian_mount) October 15, 2012
@bmount
bmount / designcodes.md
Created October 20, 2012 10:14
differences between different kinds of design codes

1911 tenement

"The discoveries of the last few years have radically altered our methods of treatment of sewage, both within and without the building. We have through these discoveries, learned why it is that sewage must be quickly removed from our neighborhood instead of being allowed to remain in cesspools... The science of bacteriology has become to the sanitary engineer, in a certain sense, the most