This file contains hidden or 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": 440, | |
| "title": "Station Locations", | |
| "phone": "+12159876034", | |
| "start_date": "2014-08-22T17:31:26-04:00", | |
| "end_date": null, | |
| "confirmation": "Thanks again. There are approx. 90 proposed sites so if you see another sticker, text us from there!", | |
| "public": false, | |
| "questions": [ | |
| { |
This file contains hidden or 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
| City | Cycling Deaths / 1M People | Pop (2010) | Approx # of Deaths | Cyclists as % of Pop | # of Cyclists (2010) | Deaths / 1K Cyclists | |
|---|---|---|---|---|---|---|---|
| Jacksonville | 5.68 | 823316 | 4.67643488 | 0.2 | 1647 | 2.8393654402 | |
| Phoenix | 6.12 | 1449481 | 8.87082372 | 0.6 | 8697 | 1.0199866299 | |
| Mesa | 6.05 | 440248 | 2.6635004 | 0.6 | 2641 | 1.0085196516 | |
| Fresno | 5.98 | 496147 | 2.96695906 | 0.8 | 3969 | 0.7475331469 | |
| Houston | 2.19 | 2107208 | 4.61478552 | 0.5 | 10536 | 0.4380016629 | |
| New Orleans | 5.54 | 347858 | 1.92713332 | 1.8 | 6261 | 0.3077996039 | |
| NYC | 2.1 | 8184899 | 17.1882879 | 0.8 | 65479 | 0.2625007697 | |
| Los Angeles | 1.91 | 3797144 | 7.25254504 | 0.9 | 34174 | 0.2122240604 | |
| Chicago | 2.22 | 2698831 | 5.99140482 | 1.3 | 35085 | 0.1707682719 |
This file contains hidden or 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 __future__ import unicode_literals | |
| import base64 | |
| import binascii | |
| import os | |
| import re | |
| import logging | |
| log = logging.getLogger(__name__) |
This file contains hidden or 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 re | |
| from django.conf import settings | |
| from django.core import cache as django_cache | |
| from mock import patch | |
| from rest_framework.permissions import SAFE_METHODS | |
| from rest_framework.response import Response | |
| class CachedResourceMixin (object): | |
| @property |
This file contains hidden or 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> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.1.2/handlebars.min.js"></script> | |
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <!-- Your handlebars template goes below... --> | |
| <script id="my-one-template" type="text/x-handlebars-template"> | |
| {{#each people}} |
This file contains hidden or 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
| rvm system | |
| travis encrypt SAUCE_USERNAME=$SAUCE_USERNAME --repo openplans/hatch | |
| travis encrypt SAUCE_ACCESS_KEY=$SAUCE_ACCESS_KEY --repo openplans/hatch | |
| # Add the values to your .travis.yml file | |
| # | |
| # NOTE: If you specify "--add env.global" with the encrypt command this will | |
| # be done automatically. | |
| # | |
| # env: |
This file contains hidden or 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 rest_framework_csv.renderers import CSVRenderer | |
| class PaginatedCSVRenderer (CSVRenderer): | |
| results_field = 'results' | |
| def render(self, data, media_type=None, renderer_context=None): | |
| if not isinstance(data, list): | |
| data = data.get(self.results_field, []) | |
| return super(PaginatedCSVRenderer, self).render(data, media_type, renderer_context) |
This file contains hidden or 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
| // We went over: | |
| /* | |
| * - What's JS used for | |
| * - Modifying document structure (the HTML is not the webpage, like the | |
| * blueprint is not the building) | |
| * - Retrieving data from a server without a page reload | |
| * - Widgets and usability | |
| */ |
This file contains hidden or 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
| #!/bin/bash | |
| # Setup and start BrowserStack Tunnel for your TravisCI build | |
| # | |
| # This script was adopted from Santiago Suarez Ordoñez's Sauce Connect | |
| # setup script: https://gist.github.com/santiycr/5139565/ | |
| # | |
| # This script requires your .travis.yml to include the following private | |
| # env variable: | |
| # |