This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var box = chartElement.append('g') | |
.attr('class', 'annotation-box') | |
.append('rect'); | |
chartElement.append('g') | |
.attr('class', 'annotation') | |
.append('text') | |
.attr('x', function() { | |
return xScale(d3.time.format('%m/%d/%Y').parse('2/10/2016'))+10 | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Clipping | |
ogr2ogr -clipsrc clipping_polygon.shp output.shp input.shp | |
# reproject a shapefile. -s_srs = original projection -t_srs = new projection | |
ogr2ogr -s_srs EPSG:2269 -t_srs EPSG:4326 outfile.shp infile.shp | |
ogr2ogr -s_srs EPSG:3435 -t_srs EPSG:4326 outfile.shp infile.shp | |
""" | |
Merge shapefiles. | |
The first command copies fil1 to new file_merged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Oembed(object): | |
'''A class representing an oembed for a tweet''' | |
def __init__(self, | |
html=None, | |
author_name=None, | |
provider_url=None, | |
url=None, | |
provider_name=None, | |
version=None, | |
type=None, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table migration ( | |
year varvarchar(4), | |
datanum varchar(4), | |
serial varchar(8), | |
hhwt int(10), | |
statefip varchar(2), | |
county varchar(4), | |
metarea varchar(3), | |
metaread varchar(4), | |
city varchar(4), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import libraries | |
import sunlight | |
import csv | |
#variables for the search | |
state_name = "or" | |
chamber_name = "upper" | |
photo = "undefined.jpg" | |
#pull API data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
// Calls Twitter API, parses resulting JSON and sends info to GetPhoto() | |
var tweetFace = function() { | |
$("#eyer").attr("src","googlyeye_small.png"); | |
$("#eyel").attr("src","googlyeye_small.png"); | |
query=$("#query").val(); | |
$("#text").html("Looking for a face and googly eyes."); | |
twitter = "https://api.twitter.com/1/users/show.json?screen_name=" | |
twitter_json = 'http://twitter.com/users/show/'+query+'.json?callback=?'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>TweetEyes</title> | |
<link href="tweetface.css" rel="stylesheet" /> | |
<link href='http://fonts.googleapis.com/css?family=Arvo' rel='stylesheet' type='text/css'> | |
<link rel="shortcut icon" | |
href="http://chrishaganreporting.com/tweeteyes/favicon.ico" /> | |
<body> |