Skip to content

Instantly share code, notes, and snippets.

View JSDiamond's full-sized avatar

Jeremy Scott Diamond JSDiamond

  • NYC
View GitHub Profile
@dannguyen
dannguyen / mapzen-geocoding-with-python3.py
Last active November 24, 2015 13:24
Example of using Mapzen's Search API to do geocoding, using Python 3.x and the requests library. More advanced version here: https://gist.github.com/dannguyen/036a62e32fc9f6765b82
# Example of using Mapzen Search for free geocoding
# https://mapzen.com/documentation/search/search/
# result of geocoding all of New York's Starbucks: http://bit.ly/1P34T7h
from os import environ
import requests
API_KEY = environ['MAPZEN_SEARCH_KEY']
BASE_URL = 'https://search.mapzen.com/v1/search'
txt = '1007 MORRIS PARK AVE, 10462'
resp = requests.get(BASE_URL, params = {'api_key': API_KEY, 'size': 1, 'text': txt})
data = resp.json()
@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });