Skip to content

Instantly share code, notes, and snippets.

View tomplex's full-sized avatar

Tom Caruso tomplex

View GitHub Profile
@Jeremiah-England
Jeremiah-England / directional_distance.py
Last active January 3, 2021 04:32
Directional Distance with Shapely
"""A small module for finding the distance between two geometries in an arbitrary direction
Inspired by a question/issue in the Shapely github repository (`#1051`_).
Notes
-----
There is another way I can think of doing this which will probably be much faster for
large geometries, but less accurate. It should be possible to stretch both geometries
by a very large amount in the direction perpendicular to the direction you want to
find the distance in. Of course, you would loose the 'movement' idea (i.e. it could
@dbaston
dbaston / single-precision-points.sql
Last active April 15, 2022 08:00
Using single-precision points in PostGIS
-- create point table using single-precision coordinates
CREATE TABLE pts (
point_id serial,
x real,
y real
);
-- create a view that converts these into a PostGIS geometry
CREATE VIEW pts_view AS
SELECT point_id, ST_SetSRID(ST_MakePoint(x, y), 4326) AS geom FROM pts;
@basaks
basaks / python36.md
Last active January 28, 2022 13:00
Install Python3.6 interpreter on ubuntu 16.04

Install Python3.6 interpreter on ubuntu 16.04

From here, we can pretty much follow the exact same procedure.

On a terminal just do the following steps:

Install dependencies:

sudo apt install build-essential checkinstall libreadline-gplv2-dev \

@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@mpneuried
mpneuried / Makefile
Last active May 4, 2024 13:46
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active May 22, 2024 19:07
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@dbaston
dbaston / Dockerfile
Created March 29, 2016 14:51
Dockerfile to build pramsey's parallel PostGIS branch against Postgres/GEOS trunk
FROM phusion/baseimage
RUN apt-get update && apt-get install -y \
build-essential \
git \
bison \
flex \
zlib1g-dev \
autoconf \
libtool \
@robinkraft
robinkraft / osgeo_compile.sh
Created June 24, 2014 01:41
compile and install GEOS, PROJ4 and GDAL from source on Ubuntu 12.0.4
# Compile/install GEOS. Taken from:
# http://grasswiki.osgeo.org/wiki/Compile_and_Install_Ubuntu#GEOS_2
cd /tmp
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
bunzip2 geos-3.4.2.tar.bz2
tar xvf geos-3.4.2.tar
cd geos-3.4.2