Zoomable/rotatable world globe that uses orthographic projection. Drag behavior is enhanced as described here: https://www.jasondavies.com/maps/rotate/
Performance is not good due to redrawing whole world upon zoom/drag.
"""WARNING: not thoroughly tested and does not support full translation | |
between the two libraries. | |
Uses a pydantic root_validator to init the marshmallow schema. It attempts | |
to map marshmallow field types to pydantic field types as well, but not all | |
field types are supported. | |
You can either use the pydantic_from_marshmallow function that does all of | |
the above or just subclass MarshmallowModel and manually define your pydantic | |
fields/types/etc. |
import Combine | |
import ReactiveSwift | |
import SwiftUI | |
class AnySubscription: Subscription { | |
private let cancelable: Cancellable | |
init(cancelable: Cancellable) { | |
self.cancelable = cancelable |
import boto3 | |
import os | |
import json | |
client = boto3.client('s3', | |
region_name=os.getenv('DO_SPACES_REGION'), | |
endpoint_url='https://{}.digitaloceanspaces.com'.format(os.getenv('DO_SPACES_REGION')), | |
aws_access_key_id=os.getenv('DO_SPACES_KEY'), | |
aws_secret_access_key=os.getenv('DO_SPACES_SECRET')) |
Zoomable/rotatable world globe that uses orthographic projection. Drag behavior is enhanced as described here: https://www.jasondavies.com/maps/rotate/
Performance is not good due to redrawing whole world upon zoom/drag.
# A simple script to load data from a shapefile into a spatialite db. | |
# Transfering the geometries is slow. It would probably be much faster to | |
# use WKB directly for the load, but I cannot get this to work. | |
# This is largely copied from | |
# https://github.com/geoalchemy/geoalchemy/blob/master/examples/spatialite.py | |
import os, osgeo.ogr | |
from sqlite3 import dbapi2 as sqlite | |
from sqlalchemy.orm import sessionmaker | |
from sqlalchemy import event, create_engine, MetaData |
git config --global mergetool.sublime.cmd "subl -w \$MERGED" | |
git config --global mergetool.sublime.trustExitCode false | |
git config --global merge.tool sublime | |
git mergetool -y |
I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.
Imagine a long-running development branch periodically merges from master. The
git log --graph --all --topo-order
is not as simple as it could be, as of git version 1.7.10.4.
It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.
// Bounding box of our TMS that define our area of interest | |
var bbox = [-600000, -300000, 1300000, 1600000]; | |
// Resolutions of our TMS that the tiles will be displayed at calculated so | |
// that at resolution 0 the bounds fit one 256x256 tile: (maxx - minx)/256 | |
var res = [7421.875, 3710.9375, 1855.46875, 927.734375]; | |
// Define the Proj4Leaflet coordinate reference system base on British National Grid | |
var crs = L.CRS.proj4js( | |
'EPSG:27700', |
/* | |
* L.TileLayer is used for standard xyz-numbered tile layers. | |
*/ | |
L.Google = L.Class.extend({ | |
includes: L.Mixin.Events, | |
options: { | |
minZoom: 0, | |
maxZoom: 18, | |
tileSize: 256, |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>D3 over Polymap example</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<link rel="stylesheet" href="map.css" /> | |
</head> | |
<body onload="init();"> | |
<div id="map_container"></div> |