Skip to content

Instantly share code, notes, and snippets.

Michal Migurski migurski

Block or report user

Report or block migurski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Landsat 8 gdal processing
#! /bin/bash -ex
# Convert Landsat 8 GeoTIFF images into RGB pan-sharpened JPEGs.
#
# Requirements:
# * gdal http://www.mapbox.com/tilemill/docs/guides/gdal/
# * Dan Stahlke's https://github.com/gina-alaska/dans-gdal-scripts
# * convert (image-magick)
#
# Reference info:
View find.py
''' Search for records in g20151-slice.csv using index g20151-index.csv.
Also search for a few junk records, to make sure they're not found.
'''
import csv, os, io
from remote import RemoteFileObject
INDEX_URL = 'http://localhost/~migurski/Census-Reporter/g20151-index.csv'
DATA_URL = 'http://localhost/~migurski/Census-Reporter/g20151-slice.csv'
View blosxom.php
<?php
// What's this blog's title?
$blog_title = "tecznotes";
// What's this blog's description (for outgoing RSS feed)?
$blog_description = "Michal Migurski's notebook, listening post, and soapbox.";
// What's this blog's primary language (for outgoing RSS feed)?
$blog_language = "en";
@migurski
migurski / Compare G-Econ.ipynb
Last active Feb 15, 2016
Testing Compare G-Econ.ipynb
View Compare G-Econ.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@migurski
migurski / index.json
Last active Jan 17, 2016
Mapzen API index
View index.json
{
"vector_tile_url": "http://vector.mapzen.com/osm/{layers}/{z}/{x}/{y}.{format}{?api_key}",
"time_distance_matrix_url": "https://matrix.mapzen.com/{action}{?api_key,json}",
"search_geocode_url": "https://search.mapzen.com/v1/search{?api_key,text}{&size,boundary.country,boundary.rect.min_lat,boundary.rect.min_lon,boundary.rect.max_lat,boundary.rect.max_lon,boundary.circle.lat,boundary.circle.lon,boundary.circle.radius,focus.point.lat,focus.point.lon,sources,layers}",
"search_reverse_url": "https://search.mapzen.com/v1/reverse{?api_key,point.lat,point.lon}{&size,boundary.country,sources,layers}",
"search_autocomplete_url": "https://search.mapzen.com/v1/autocomplete{?api_key,text}{&focus.point.lat,focus.point.lon}",
"search_place_url": "https://search.mapzen.com/v1/place{?api_key,ids}",
"elevation_url": "https://elevation.mapzen.com/height{?api_key,json}"
}
@migurski
migurski / stats2runs.py
Created Jul 23, 2015
Converting from OpenAddresses stats table to runs and sets table
View stats2runs.py
from __future__ import print_function
from os import environ
from psycopg2 import connect
from psycopg2.extras import DictCursor, Json
from itertools import count, groupby
from datetime import timedelta, datetime
from operator import itemgetter
from uritemplate import expand
from dateutil.parser import parse
@migurski
migurski / index.html
Last active Aug 29, 2015
Grabbing census tracts around Oakland, messing with Turf
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Untitled</title>
<script src="https://code.jquery.com/jquery-1.11.2.min.js" charset="utf-8"></script>
<script src="modestmaps.min.js" charset="utf-8"></script>
<script src="turf.min.js" charset="utf-8"></script>
</head>
<body>
@migurski
migurski / squares-map.js
Created Mar 3, 2015
Compiled TypeScript sample
View squares-map.js
var Map = (function () {
function Map(parent, template, proj, loc, zoom) {
this.selection = d3.select(parent);
this.loaded_tiles = {
};
this.template = template;
this.parent = parent;
var size = Mouse.element_size(this.parent), coord = proj.locationCoordinate(loc).zoomTo(zoom);
this.grid = new Grid.Grid(size.x, size.y, coord, 3);
this.projection = proj;
@migurski
migurski / guess.py
Created Jan 28, 2015
guess reason for OpenAddresses failure
View guess.py
def guess_reason(log):
'''
'''
if 'JobTimeoutException' in log:
return 'took too long'
elif 'DownloadError: 404 response' in log:
return 'missing source'
elif 'Source says to skip' in log:
return 'skipped'
elif 'Invalid number of points in LinearRing' in log:
View data.acgov.org.txt
% curl -sIL 'https://data.acgov.org/api/geospatial/8e4s-7f4v?method=export&format=Original'
HTTP/1.1 405 Method Not Allowed
Server: nginx
Date: Tue, 13 Jan 2015 01:52:36 GMT
Connection: keep-alive
Access-Control-Allow-Origin: *
X-Error-Code: method_not_allowed
X-Error-Message: HEAD not allowed
X-Socrata-Region: production
You can’t perform that action at this time.