download php...
tar -jxvf php-5.5.7.tar.bz2
sudo mkdir -p /usr/include
sudo mv php-5.5.7 /usr/include/php
cd /usr/include/php/php-5.5.7
./configure --without-iconv
sudo cp /etc/php.ini.default /etc/php.ini
cd ext/pdo_pgsql
download php...
tar -jxvf php-5.5.7.tar.bz2
sudo mkdir -p /usr/include
sudo mv php-5.5.7 /usr/include/php
cd /usr/include/php/php-5.5.7
./configure --without-iconv
sudo cp /etc/php.ini.default /etc/php.ini
cd ext/pdo_pgsql
This donut chart is constructed from a CSV file storing the populations of various age groups. The chart employs a number of D3 features:
| ## assumes sibling dirs gitcode, export. commands run in gitcode dir post commit/pull | |
| # need to clear out exports and server dir if files removed from repo | |
| sudo rm -r /var/www/<target app>/* | |
| rm -r ../export/* | |
| # create archive of repo, pipe to ../export | |
| git archive HEAD | (cd ../export && tar -xvf -) | |
| # copy contents of ../export to /var/www/<target app> |
| --FROM http://blog.mackerron.com/2012/06/01/postgis-2-ubuntu-12-04/ | |
| mkdir -p src | |
| # First install PostgreSQL 9.2, plus contributed packages and any missing prerequisites | |
| # === | |
| # add the Postgres PPA | |
| echo 'deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main' \ |
| start | |
| /usr/local/pgsql/bin/pg_ctl start -D /usr/local/pgsql/data | |
| stop | |
| /usr/local/pgsql/bin/pg_ctl stop -D /usr/local/pgsql/data | |
| restart | |
| /usr/local/pgsql/bin/pg_ctl restart -D /usr/local/pgsql/data |
| import json | |
| from functools import wraps | |
| from flask import redirect, request, current_app | |
| def support_jsonp(f): | |
| """Wraps JSONified output for JSONP""" | |
| @wraps(f) | |
| def decorated_function(*args, **kwargs): | |
| callback = request.args.get('callback', False) | |
| if callback: |
| if (!Array.prototype.indexOf) { | |
| Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { | |
| "use strict"; | |
| if (this == null) { | |
| throw new TypeError(); | |
| } | |
| var t = Object(this); | |
| var len = t.length >>> 0; | |
| if (len === 0) { |
| function MercatorToLatLon(mercX, mercY) { | |
| var rMajor = 6378137; //Equatorial Radius, WGS84 | |
| var shift = Math.PI * rMajor; | |
| var lon = mercX / shift * 180.0; | |
| var lat = mercY / shift * 180.0; | |
| lat = 180 / Math.PI * (2 * Math.atan(Math.exp(lat * Math.PI / 180.0)) - Math.PI / 2.0); | |
| return { 'Lon': lon, 'Lat': lat }; | |
| } |
| function LatLonToMercator(lat, lon) { | |
| var rMajor = 6378137; //Equatorial Radius, WGS84 | |
| var shift = Math.PI * rMajor; | |
| var x = lon * shift / 180; | |
| var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180); | |
| y = y * shift / 180; | |
| return {'X': x, 'Y': y}; | |
| } |