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
--- | |
layout: post | |
title: "Hello world: Nerd blogging with Jekyll" | |
description: "We're a new team, and we're trying something new (at least for us) as a blog publishing platform: Jekyll, a generator that creates simple, static websites. <br><br> | |
We're not breaking any ground with this choice, of course, but we liked the idea of launching a blog that's open source — both its code and also its content.<br><br> | |
This initial post is an introduction to Jekyll for the members of our team -- and anyone else who wants to get started with the tool and/or steal our simple code for their own site." | |
author: Matt Stiles | |
--- |
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
--- | |
layout: default | |
--- | |
<article> | |
<header> | |
<h1>{{ page.title }}</h1> | |
<p class="byline"> By {{ page.author }} | {{ page.date | date: "%B %d, %Y" }}</p> | |
</header> |
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
<html> | |
<head> | |
</head> | |
<body> | |
<!-- Paste fusion tables code below --> | |
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
query = '#NPRGL' | |
# Edit this to save results to a different SQLite DB | |
db_path = 'nprgl.db' | |
import sys | |
import json | |
import urllib | |
import urllib2 | |
import dateutil.parser |
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
#set working directory | |
setwd("~/Dropbox/code-data") | |
# Set up | |
library(plyr) | |
library(ggplot2) | |
# load data | |
## Make sure data sets are in your working directory | |
options(stringsAsFactors = FALSE) |
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
#tell R where you're working | |
setwd("~/YourDataFolder") | |
#load libraries | |
library(ggplot2) | |
library(gdata) | |
#load data | |
crime <- read.csv("crime2012.csv") |
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
id,country,subregion,region,uniso,unisolow | |
108,Burundi,Eastern Africa,Africa,BDI,bdi | |
174,Comoros,Eastern Africa,Africa,COM,com | |
262,Djibouti,Eastern Africa,Africa,DJI,dji | |
232,Eritrea,Eastern Africa,Africa,ERI,eri | |
231,Ethiopia,Eastern Africa,Africa,ETH,eth | |
404,Kenya,Eastern Africa,Africa,KEN,ken | |
450,Madagascar,Eastern Africa,Africa,MDG,mdg | |
454,Malawi,Eastern Africa,Africa,MWI,mwi | |
480,Mauritius,Eastern Africa,Africa,MUS,mus |
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import tweepy #https://github.com/tweepy/tweepy | |
import csv | |
import sys | |
#Twitter API credentials | |
consumer_key = "" | |
consumer_secret = "" |
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
import tweepy #https://github.com/tweepy/tweepy | |
import csv | |
#Twitter API credentials | |
consumer_key = "" | |
consumer_secret = "" | |
access_key = "" |
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
for f in *.shp | |
do | |
base=${f%.shp} | |
ogrinfo $f -sql "ALTER TABLE $base ADD COLUMN filename character(15)" | |
ogrinfo $f -dialect SQLite -sql "UPDATE $base SET filename = '$base'" | |
ogr2ogr -update -append merged.shp $f | |
done |