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
{ | |
"$schema": "http://json-schema.org/schema#", | |
"type": "object", | |
"properties": { | |
"pos": { | |
"type": "string", | |
"enum": [ | |
"noun", | |
"verb", | |
"adj", |
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
from shapely import wkb | |
from shapely.ops import triangulate | |
from shapely.geometry import LineString | |
import trimesh | |
# Hol-y building https://www.openstreetmap.org/relation/3868363 | |
wkb_holes = bytes.fromhex( | |
""" | |
01060000000100000001030000000500000036000000BBA067EAA3D836414EC6A5B2124A5A415E4 | |
E319AAED83641F70DA6AD114A5A4151BE9F9CB9D83641BE8D6992104A5A416011309ED4D8364162 |
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
Computer Information: | |
Manufacturer: Unknown | |
Model: Unknown | |
Form Factor: Laptop | |
No Touch Input Detected | |
Processor Information: | |
CPU Vendor: AuthenticAMD | |
CPU Brand: AMD Ryzen 7 PRO 4750U with Radeon Graphics | |
CPU Family: 0x17 |
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
England | London | |
---|---|---|
Scotland | Edinburgh | |
United Kingdom | London | |
Northern Ireland | Belfast | |
France | Paris | |
Wales | Cardiff | |
Georgia | Tbilisi | |
Germany | Berlin | |
Greece | Athens | |
Greenland | Nuuk |
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
#!/usr/bin/env bash | |
##### | |
# This script runs OUTSIDE docker, and uses pgosm-flex to load a PBF file into postgres | |
# then generates a dump, which is used later to rebuild a DB from scratch | |
# Usage: ./database_from_pbf.sh some-file.osm.pbf | |
##### | |
# exit on error | |
set -e |
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
#!/bin/bash | |
# This script is designed to run INSIDE the pgosm-flex container | |
# Run with: | |
# ./sql_flex_dump_from_pbf.sh \ | |
# /app/input/filename.pbf \ | |
# 4000 \ | |
# run-all | |
# | |
# $1 - the PBF file to ingest | |
# $2 - Cache (mb) - e.g. 4000 |
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
from asyncio.queues import Queue | |
import uvicorn | |
from starlette.applications import Starlette | |
from starlette.requests import Request | |
from starlette.responses import JSONResponse, StreamingResponse, HTMLResponse | |
class SSE: | |
def __init__(self, data, event=None, event_id=None, retry=None): |
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
"""Calculate the sunrise, sunset and noon time for a given coordinate. | |
Based on the code at: https://michelanders.blogspot.com/2010/12/calulating-sunrise-and-sunset-in-python.html | |
""" | |
from math import cos, sin, acos, asin, tan | |
from math import degrees as deg, radians as rad | |
from datetime import datetime, time, timezone, timedelta | |
class Sun: | |
""" |
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
import datetime | |
import time | |
# not used, but required by pyjwt, import to ensure it exists | |
import cryptography | |
import jwt | |
key = 'secret' | |
encoded = jwt.encode({'some': 'payload'}, key, algorithm='HS256') | |
print('encoded', encoded) |
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
#!/bin/sh | |
# processes a requirements.txt file, creates the virtualenv in a given folder | |
# if it does not exist already and creates a symlink to that | |
if [[ ! $# -eq 3 ]] ; then | |
echo 'Parameters error' 1>&2 | |
echo 'Required: the requirements.txt path, the folder for the virtualenvs and the symlink to create' 1>&2 | |
exit 1 | |
fi | |
set -x |
NewerOlder