Skip to content

Instantly share code, notes, and snippets.

View mhkeller's full-sized avatar

Michael Keller mhkeller

View GitHub Profile
@mhkeller
mhkeller / gist:4401797
Last active December 10, 2015 07:29
Daily Beast News app / data internship
The Daily Beast is seeking a News Apps / Data intern starting in January for the Spring semester.
The intern would work directly with our current Data and News Apps Reporter and assist in working
between the Social Media and Developer teams. An interest in working on both deadline stories as well
as longer term newsroom projects is required. Knowledge of HTML/CSS and JavaScript is required and
knowledge of SQL, PostGIS, R, Python, or Ruby preferable.
As a part of the News Apps / Data team, you'll be working on projects like this
(http://www.thedailybeast.com/articles/2012/11/15/not-so-super-pacs-2012-s-winners-and-losers.html)
and this (http://www.thedailybeast.com/articles/2012/09/19/the-dark-money-shuffle-a-map.html)
@mhkeller
mhkeller / gist:4421941
Created December 31, 2012 18:49
State FIPS codes
STATE|STUSAB|STATE_NAME|STATENS
01|AL|Alabama|01779775
02|AK|Alaska|01785533
04|AZ|Arizona|01779777
05|AR|Arkansas|00068085
06|CA|California|01779778
08|CO|Colorado|01779779
09|CT|Connecticut|01779780
10|DE|Delaware|01779781
11|DC|District of Columbia|01702382
@mhkeller
mhkeller / gist:4450180
Created January 4, 2013 05:30
InnerHTML for SVG elements
$(this).children()[0].textContent
@mhkeller
mhkeller / gist:4463281
Last active December 10, 2015 16:48
multigeometry polygon from disparate geometried features
SELECT ST_Multi(ST_Union(the_geom)) as the_geom, cols... FROM table GROUP BY cols...
@mhkeller
mhkeller / gist:4505959
Last active December 10, 2015 22:58
$.ajax call for MapQues Open Geocoding API
// An improved ajax call removing the callback parameter
$.ajax({
url:'http://open.mapquestapi.com/geocoding/v1/address?&inFormat=kvp&outFormat=json&location='+city+','+state,
dataType:'JSONP',
city:city,
state:state,
success: function(data){
console.log(y,this.city,this.state,data)
}
});
@mhkeller
mhkeller / gist:4551137
Created January 16, 2013 21:32
Text labels in Mapnik 2.0
#states_from_esri_subc{
text-name: [state_abbr];
text-face-name: 'DejaVu Sans Book';
text-size: 10;
text-fill: #000;
text-allow-overlap: true;
text-halo-fill: #ccc;
text-halo-radius: 0;
}
@mhkeller
mhkeller / gist:4567006
Last active January 20, 2022 02:46
Open Street Map Geocoder
// BEGIN GEOCODING
$adrsInput = $('#address-submit');
$adrsText = $('#address-text')
var geocoder,
firstRun = true,
markerGroup;
var geoCode = function(address) {
$.ajax({
url:'http://open.mapquestapi.com/geocoding/v1/address?&inFormat=kvp&outFormat=json&location='+address,
@mhkeller
mhkeller / index.html
Created January 24, 2013 06:58
Sample d3 gantt chart, sorting works, filtering broken
<title>Ganttttttttttttt</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.2/underscore-min.js"></script>
<style>
.axis path,
.axis line {
fill: none;
stroke: none;
shape-rendering: crispEdges;
d <- read.csv("all_posts.csv", stringsAsFactors=F)
pattern <- "regex here"
d$guns <- 0
d$guns[grep(pattern, d$text)] <- 1
d_guns <- d[d$guns==1,]
write.csv(d_guns, "gun_posts.csv", row.names=F)
@mhkeller
mhkeller / gist:4961106
Last active December 13, 2015 19:18
Examples of multimedia #lovetoscroll projects in reply to @jtomassini https://twitter.com/jtomassini/status/302438612937625600
CNN — Mauritania: Slavery's Last Stronghold (http://bit.ly/H7vA26)
Pitchfork — Glitter in the dark: Bat for Lashes Profile (http://bit.ly/TBuXDU)
USA Today — Smelting and Lead Contamination (http://usat.ly/TBuZMa)
NY Times — Coming Out (http://nyti.ms/TBw9Hu)
Guardian US — America: Elect! The action-packed journey to US election day in graphic novel form (http://bit.ly/SWM1Gx)
NY Times — This Land (http://nyti.ms/11KDHBY)
National Film Board of Canada — This Land (http://bit.ly/11KDJKn)