Requires Python 3.
python3 json_to_csv.py https://gist.githubusercontent.com/walkermatt/19b1108ca9bee94745810f4c39c32165/raw/cities.json /tmp/cities.csv| -- Raises an exception with `failure_message` if `sql_text` does not throw an exception at all. | |
| -- If an exception is thrown but it's SQLSTATE doesn't match `expected_sql_state` then that | |
| -- exception is RE-RAISED | |
| CREATE OR REPLACE FUNCTION pg_temp.test__throws_exception(sql_text text, expected_sql_state text, failure_message text) RETURNS void AS $$ | |
| DECLARE | |
| sql_state text; | |
| BEGIN | |
| EXECUTE sql_text; | |
| RAISE EXCEPTION '%', failure_message; | |
| EXCEPTION WHEN OTHERS THEN GET STACKED DIAGNOSTICS sql_state = RETURNED_SQLSTATE; |
| Description | Entity | Preview |
|---|---|---|
| A With Acute, Latin Capital Letter | Á | Á |
| A With Acute, Latin Small Letter | á | á |
| A With Breve, Latin Small Letter | ă | ă |
| A With Caron, Latin Small Letter | ǎ | ǎ |
| A With Circumflex, Latin Capital Letter | Â | Â |
| A With Circumflex, Latin Small Letter | â | â |
AWS IAM Policy suitable for assigning to a user developing Chalice applications. Allows the developer sucessfully execute chalice deploy, chalice delete and chalice logs
Derived from comments on chalice/issues/59, extended by trial and error :-)
Subsitute YOUR-AWS-REGION in chalice-dev-iam-policy.json with the region you are deploying to, for example eu-west-1.
| npx @marp-team/marp-cli --template bare -o ol-layerswitcher-typescript.html presentation.md |
| function escapeAsCsv(str) { | |
| // Double up double quotes and quote the entire string if necessary | |
| if (str.includes(',') || str.includes('\n') || str.includes('"')) { | |
| return '"' + str.replace(/"/g, '""') + '"'; | |
| } | |
| return str; | |
| } | |
| // Export Confluence table as CSV | |
| // Select the tbody element in Chrome devtools Elements panel then run the |
| // OpenLayers. See https://openlayers.org/ | |
| // License: https://raw.githubusercontent.com/openlayers/openlayers/master/LICENSE.md | |
| // Version: v4.5.0-70-gfca0b07 | |
| ;(function (root, factory) { | |
| if (typeof exports === "object") { | |
| module.exports = factory(); | |
| } else if (typeof define === "function" && define.amd) { | |
| define([], factory); | |
| } else { | |
| root.ol = factory(); |
| """ Minimal MapProxy Middleware demonstrating wrapping MapProxy and working | |
| with the query string | |
| To run: | |
| 1. Install MapProxy in a virtual enviroment together with Gunicorn | |
| 2. Create a basic MapProxy config and copy this file into the same directory as mapproxy.yaml | |
| 2. Activate virtual environment | |
| 3. Change to the directory containing this file | |
| 4. Run: | |
| gunicorn -k eventlet --workers=1 --log-file=- mapproxy_filter:application |
| # Just the selected features | |
| layer = iface.activeLayer() | |
| for feature in layer.selectedFeatures(): | |
| print feature['name'] | |
| # Filter by current extent of the map | |
| extent = iface.mapCanvas().extent() | |
| request = QgsFeatureRequest() | |
| request.setFilterRect(extent) | |
| layer = iface.activeLayer() |