This gist contains a few example MapSwap configs.
This file contains 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
console.log(parse(`(define (square x) | |
"Function calculate square of a number" | |
(* x x))`)[0].toString()); | |
// ==> (define (square x) "funkcja square wywołanie (square 10) zwraca 100" (* x x)) |
This file contains 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
--- | |
options: | |
hash: m | |
attributionControl: | |
customAttribution: '<a href=".">Overpass Ultra</a>' | |
bounds: [-77.49784362036736,37.50408772391166,-77.40437276428577,37.57742791260068] | |
maxBounds: [-77.49784362036736,37.50408772391166,-77.40437276428577,37.57742791260068] | |
controls: | |
- type: GeolocateControl | |
options: |
This file contains 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
javascript:(() => { | |
const observer = MutationObserver(({addedNodes, removedNodes}) => { | |
console.log("favicon change!", addedNodes, removedNodes); | |
}); | |
observer.observe(document.head, {childList: true}); | |
})(); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
javascript:javascript=window.location=window.location.host.replace(/([^.]+)\.github\.io/, `https://github.com/$1/${window.location.pathname.split("/")[1]}`) |
This file contains 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
.PHONY: help | |
help: # Print help | |
@awk 'BEGIN {FS = ":.*?# *"} /^[.a-zA-Z_-]+:.*?# */ {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) |
This file contains 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
javascript:JSON.parse(window.localStorage.getItem('nyt-wordle-state')).solution.split('').concat(['Enter']).map(key=>window.dispatchEvent(new KeyboardEvent('keydown',{key})))&&undefined; |
This file contains 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
CREATE OR REPLACE FUNCTION ST_LineChunk(geom geometry, max_length float8) RETURNS SETOF geometry AS $$ | |
WITH | |
points AS ( | |
SELECT generate_series(0, CEIL(ST_Length(geom) / max_length)::int) | |
/ CEIL(ST_Length(geom) / max_length) "end" | |
), | |
line_points AS (SELECT LAG("end", 1) OVER (ORDER BY "end") "start", "end" FROM points) | |
SELECT ST_LineSubstring(geom, "start", "end") | |
FROM line_points | |
WHERE "start" IS NOT NULL AND "start" <> 1 |
This file contains 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
-- ported from https://github.com/pramsey/minimal-mvt/blob/58f3e695a305f42024dcf0ba395590bf39b0b573/minimal-mvt.py#L63-L81 | |
CREATE OR REPLACE FUNCTION ST_TileEnvelope(tileZoom integer, tileX integer, tileY integer) RETURNS geometry AS $$ | |
-- Width of world in EPSG:3857 | |
DECLARE worldMercMax float = 20037508.3427892; | |
DECLARE worldMercMin float = -1 * worldMercMax; | |
DECLARE worldMercSize float = worldMercMax - worldMercMin; | |
-- Width in tiles | |
DECLARE worldTileSize float = power(2, tileZoom); | |
-- Tile width in EPSG:3857 | |
DECLARE tileMercSize float = worldMercSize / worldTileSize; |
NewerOlder