Skip to content

Instantly share code, notes, and snippets.

Justin Palmer caged

Block or report user

Report or block caged

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 locations.csv
location
Luverne, Alabama
Madison, Alabama
Theodore, Alabama
Oneonta, Alabama
Odenville, Alabama
Heflin, Alabama
Jasper, Alabama
Midfield, Alabama
Greenville, Alabama
@caged
caged / index.html
Last active Sep 19, 2015 — forked from mbostock/.block
Cubehelix Color Picker
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.axis path,
.axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
@caged
caged / point-dispersal.sql
Last active Sep 23, 2016
Naive dispersal of overlapping points in PostGIS
View point-dispersal.sql
drop table if exists inspection_point_buffers;
-- Group identical overlapping points and count how many occupy
-- the space.
create temporary table inspection_overlappoing_points as
select a.geom as geom,
count(*)
from latest_inspections a,
latest_inspections b
where st_equals(a.geom, b.geom)
View index.html
<!doctype html>
<head>
<meta charset="utf-8">
<style>
body {
font-family: OpenSans, Helvetica;
}
.title {
margin: 0;
View crash-details.txt
column_name
--------------------------------------------------------
crash_id
record_type
vehicle_id
participant_id
participant_display_seq
vehicle_coded_seq
participant_vehicle_seq
serial_
@caged
caged / feedback.md
Last active Aug 29, 2015
Quick feedback for municipalities working with open data
View feedback.md
  • Datasets first, APIs second - Doing any kind of aggregate analysis usually requires working with complete datasets. REST APIs aren't ideal for this use case. APIs are not data, they are a means of exposing it.
  • Machine-friendly retrieval of raw datasets - Avoid the assumption that there's a human, using a web browser, manually clicking a link. For example, scripts that fetch new daily crime data via curl would be a likely scenario. Make it easy for machines by removing authentication, unnecessary redirects, JavaScript-based retrieval or POST-style retrieval.
  • Document long column names - Shapefile attributes are limited to 10 characters. This makes many attributes difficult to decipher without associated metadata. For example, here are a few attributes from a Garbage Collection dataset. Include a file with the long column name mappings and include both the long and short name in the metada
View my-eyes.sql
drop table if exists combined_geometries;
with boston_area_geometries as
( select name,
msa_code,
geom
from divisions
inner join
( select distinct on (msa_code) msa_code
from area_definitions ) ad on ad.msa_code = nctadvfp ),
@caged
caged / graphite-live.coffee
Created Dec 16, 2014
Autoupdating graphite timeseries in d3
View graphite-live.coffee
#= require d3
# Draw timeseries graphs to the screen. Each element can contain a set of
# data-* attributes used to configure the graph. The graph should always include
# a data-url attribute pointing to an endpoint for time series JSON data.
#
# Any graph that includes a data-realtime attribute will update automatically.
#
# Examples:
# <div class="js-graph" data-url="/graphite?target=github.unicorn.{browser,api}.cpu_time.mean&amp;from=-1hour" data-realtime></div>
View data.tsv
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 40 columns, instead of 10. in line 5.
date C Io JavaScript Lua Ruby Arc Erlang Objective-C VimL Ragel in Ruby Host Scala Emacs Lisp Python Shell Assembly Java Perl C++ Objective-J ActionScript OCaml Nu PHP Common Lisp CSS Clojure Matlab CoffeeScript ooc Fancy Racket Rust TeX Haskell TypeScript Elixir wisp Go C#
2008-02 4.545454545454546 4.545454545454546 9.090909090909092 2.272727272727273 79.54545454545455 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2008-03 7.4074074074074066 0 7.4074074074074066 7.4074074074074066 62.96296296296296 3.7037037037037033 3.7037037037037033 3.7037037037037033 3.7037037037037033 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2008-04 6.25 0 9.375 0 78.125 0 0 0 0 3.125 3.125 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2008-05 3.225806451612903 0 6.451612903225806 0 83.87096774193549 0 0 0 0 0 0 3.225806451612903 3.225806451612903 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2008-06 3.0303030303030303 0 9.090909090909092 0 78.78787878787878 0 0 3.0303030303030303
View osmosis-port.log
osm-building-import┋ master⚡ ᴥ osmosis --read-xml osm/features.osm --truncate-pgsql database=osm_test port=15432 --wp database=osm_test port=15432
Oct 10, 2014 11:56:59 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.42-6-gf39a160-dirty
Oct 10, 2014 11:56:59 AM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Oct 10, 2014 11:56:59 AM org.openstreetmap.osmosis.core.Osmosis main
SEVERE: Execution aborted.
org.openstreetmap.osmosis.core.OsmosisRuntimeException: Argument port for task 2-truncate-pgsql was not recognised.
at org.openstreetmap.osmosis.core.pipeline.common.TaskManagerFactory.createTaskManager(TaskManagerFactory.java:64)
at org.openstreetmap.osmosis.core.pipeline.common.Pipeline.buildTasks(Pipeline.java:50)
You can’t perform that action at this time.