This Web Components keeps the year in your copyright notice up-to-date.
export { CopyrightYearElement }
const name = "copyright-year";
class CopyrightYearElement extends HTMLSpanElement {
#!/usr/bin/env bash | |
# useful for platforms that don't currently have GNU Parallel in their repo. | |
# does NOT work on Git Bash due to missing GNU Make etc. | |
# it builds on Cygwin, but may have runtime issues--give it a try. | |
set -e | |
curl -O ftp://ftp.gnu.org/gnu/parallel/parallel-latest.tar.bz2 |
Basically two types:
Let's say you have a drawing tool that permits both. Both geometry types benefit from some non-standard drawing abilities: it would be nice to resize circles, and it would be nice to resize rectangles in a way that keeps them rectangular. However, GeoJSON does not have circle or rectangle types. Both are represented as polygons. This gives us two options:
<!-- | |
Install: | |
Copy this file into /layouts/shortcodes | |
Usage: | |
{{% mapml %}} | |
<mapml-viewer projection="OSMTILE" zoom="0" lat="0.0" lon="0.0" controls style="width:100%;height:400px"> |
For those who use Google Lens on Android as an OCR to capture text from images, screenshots, etc.. here is a bash script that does the same on Ubuntu.
Sometimes we need to copy a telephone number in an APP where there isn't a copy to clipboard feature enabled or maybe to copy texts from an picture.
This can be done with a OCR, this script does that allowing to drag&drop select a region of the screen and copy to clipboard the text parsed from the image.
#!/bin/bash
-- original source: https://medium.com/adhawk-engineering/using-postgresql-to-generate-slugs-5ec9dd759e88 | |
-- https://www.postgresql.org/docs/9.6/unaccent.html | |
CREATE EXTENSION IF NOT EXISTS unaccent; | |
CREATE OR REPLACE FUNCTION public.slugify(v TEXT) RETURNS TEXT | |
LANGUAGE plpgsql | |
STRICT IMMUTABLE AS | |
$function$ | |
BEGIN |
-- plpython needs to be enabled. Furthermore scipy needs to be installed in the python used. | |
-- CREATE LANGUAGE plpythonu; | |
CREATE OR REPLACE FUNCTION septima.voronoi(geom geometry, boundingpointdistance double precision) | |
RETURNS SETOF geometry_dump AS | |
$BODY$ | |
from scipy.spatial import Voronoi | |
import numpy | |
class GeoVoronoi: |
#/usr/bin/python | |
# http://exploreflask.com/en/latest/views.html | |
# https://stackoverflow.com/questions/51691730/flask-middleware-for-specific-route | |
# https://dev.to/rhymes/logging-flask-requests-with-colors-and-structure--7g1 | |
import logging | |
from logging.handlers import RotatingFileHandler | |
from flask import Flask, request, jsonify | |
from time import strftime |
# Code borrowed from https://subscription.packtpub.com/book/application_development/9781783984985/1/ch01lvl1sec18/creating-a-standalone-application | |
# and upgraded for QGIS 3.0 | |
import sys | |
from qgis.core import (QgsApplication, QgsFeature, QgsGeometry, | |
QgsProject, QgsVectorLayer) | |
from qgis.gui import QgsMapCanvas | |
from qgis.PyQt.QtCore import Qt | |
# Unused so commented | |
# from qgis.PyQt.QtGui import * |
-- convert a grid-reference E.g. SH123456 into a northing easting geometry for postgis with SRID=27700 (OSGB36) | |
-- standing on the shoulders of... | |
-- http://www.movable-type.co.uk/scripts/latlong-os-gridref.html | |
-- https://github.com/chrisveness/geodesy/blob/master/osgridref.js [MIT] | |
-- consider this MIT licensed also. | |
CREATE OR REPLACE FUNCTION get_geom_from_grid_ref(IN grid_ref character varying) | |
RETURNS public.geometry | |
LANGUAGE 'plpgsql' | |
AS $BODY$ |