git clone <repo>
clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS
Add colors to your ~/.gitconfig file:
This demonstrates that you can configure a Flask application through Flask-Script, without having to create a Flask instance or deal with circular dependencies. Note that Flask-Script's Manager accepts a factory function in place of a Flask app object.
Running:
python manage.py runserver
gives "Hello, world!" on http://localhost:5000/, while running:
python manage.py runserver -c development.cfg
| from flask import render_template | |
| from random import randrange | |
| #create the app object | |
| app = Flask(__name__) | |
| #get the database | |
| from tables import engine, temperature_table | |
| @app.before_request | |
| def before_request(): |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>ArcGIS JavaScript API viewer</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> | |
| <link rel="stylesheet" href="http://js.arcgis.com/3.8/js/esri/css/esri.css"> | |
| <style> | |
| html, body, #map {width:100%; height:100%; margin:0; padding:0; } | |
| </style> | |
| <script src="http://js.arcgis.com/3.8/"></script> |
| from datetime import datetime | |
| import pytz | |
| def is_dst (): | |
| """Determine whether or not Daylight Savings Time (DST) | |
| is currently in effect""" | |
| x = datetime(datetime.now().year, 1, 1, 0, 0, 0, tzinfo=pytz.timezone('US/Eastern')) # Jan 1 of this year | |
| y = datetime.now(pytz.timezone('US/Eastern')) |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Leaflet Demo</title> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> | |
| <link href='http://fonts.googleapis.com/css?family=Open+Sans:600' rel='stylesheet' type='text/css'> | |
| <style> |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Leaflet.draw drawing and editing tools</title> | |
| <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" /> | |
| <link rel="stylesheet" href="js/leaflet.draw.css" /> | |
| <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8 /> | |
| <title>Time slider data</title> | |
| <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
| <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script> | |
| <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> |
| import requests | |
| urlToGoTo = 'URLOfServiceOnAGOL' | |
| r = requests.get(urlToGoTo, allow_redirects=True) | |
| with open(r"FileLocation.ZIP", "wb") as f: | |
| for chunk in r.iter_content(): | |
| f.write(chunk) |
| .leaflet-container path{ | |
| transition: fill .75s; | |
| } |