Skip to content

Instantly share code, notes, and snippets.

@dustymugs
dustymugs / download_naip.py
Created August 28, 2023 00:15
Download NAIP from Box.com
#
# This code was written to copy all the contents of specific NAIP directory
# paths into a GCS Bucket
#
# Caveats:
#
# * This code assumes you have added NAIP as a Shared Folder in the
# Favorites collection in My Collections
# * This code is posted so that someone else doesn't need to do the dirty
# work of figuring out Box's API to download NAIP data
@dustymugs
dustymugs / geometry_geojson.yaml
Created November 17, 2020 16:03 — forked from codan-telcikt/geometry_geojson.yaml
An OpenAPI definition for GeoJSON with Geometry and Features.
# MIT License
#
# Copyright (c) 2017 Daniele Andreis <daniele.andreis@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@dustymugs
dustymugs / 1stReadmeForRasterVision
Last active May 17, 2018 02:06
Scripts for building Tensorflow Python wheels in Docker
Note that all file names use backslash instead of forwardslash to represent directories.
Scripts are provided for Docker images to build Tensorflow, deploy Tensorflow and deploy RasterVision
The general build flow is:
1. build conda docker image (conda\Dockerfile-conda)
2. (optional) build docker image for compiling Tensorflow 1.7 for CPU and GPU (configured for AWS) (tensorflow\Dockerfile-build-cpu and tensorflow\Dockerfile-build-gpu)
3. (optional) build docker images containing Tensorflow 1.7 (tensorflow\Dockerfile-cpu and tensorflow\Dockerfile-gpu)
4. (required for RasterVision) build docker images for compiling Tensorflow 1.5 for CPU and GPU (tensorflow\v1.5\Dockerfile-build-cpu and tensorflow\v1.5\Dockerfile-build-gpu)
@dustymugs
dustymugs / gist:e5302a5971344a10d9db
Created February 24, 2016 07:44 — forked from jberkus/gist:6b1bcaf7724dfc2a54f3
Finding Unused Indexes
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
import simplejson
import sqlalchemy
from sqlalchemy import String
from sqlalchemy.ext.mutable import Mutable
class JSONEncodedObj(sqlalchemy.types.TypeDecorator):
"""Represents an immutable structure as a json-encoded string."""
impl = String