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> | |
<style type="text/css"> | |
@import url("http://github.com/simplegeo/polymaps/raw/v2.2.0/examples/example.css"); | |
html, body {height: 100%;} | |
svg {display: block;} | |
.layer circle {fill: #aaa;stroke: #000;stroke-width: 2px;} |
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>Nick Jaffe's Polymap</title> | |
<script type="text/javascript" src="http://github.com/simplegeo/polymaps/raw/v2.2.0/lib/protovis/protodata.js"></script> | |
<script type="text/javascript" src="http://github.com/simplegeo/polymaps/raw/v2.2.0/polymaps.js"></script> | |
<style type="text/css"> | |
@import url("http://github.com/simplegeo/polymaps/raw/v2.2.0/examples/example.css"); |
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
from postmates import PostmatesAPI, DeliveryQuote, Delivery, Location, PostmatesAPIException | |
key = '[redacted]' | |
customer_id = '[redacted]' | |
api = PostmatesAPI(key, customer_id) | |
pickup = Location('Gather Food LLC', '1440 S. Jackson Street, Seattle, WA', '574-551-2847') | |
dropoff = Location('Bob', '1040 S. Jackson Street, Seattle, WA', '415-777-9999') | |
quote = DeliveryQuote(api, pickup.address, dropoff.address) |
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
app.listen(app.get('port'), function() { | |
console.log('Node app is running on port', app.get('port')); | |
}); |
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
app.post('/post', function(req, res){ | |
var parsed_url = url.format({ | |
pathname: 'https://api.genius.com/search', | |
query: { | |
access_token: process.env.GENIUS_ACCESS, | |
q: req.body.text | |
} | |
}); | |
request(parsed_url, function (error, response, body) { |
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
app.set('port', (process.env.PORT || 9001)); | |
app.get('/', function(req, res){ | |
res.send('It works!'); | |
}); |
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 express = require('express'); | |
var app = express(); | |
var url = require('url'); | |
var request = require('request'); | |
var bodyParser = require('body-parser'); | |
app.use(bodyParser.json()); | |
app.use(bodyParser.urlencoded({ extended: true })); |
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> | |
<style> | |
html, body, #map_canvas { | |
height: 300px; | |
width: 300px; | |
} | |
</style> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3&sensor=false"></script> |
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
<ul id="playlist"></ul> |
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
<div id="image"></div> |