Skip to content

Instantly share code, notes, and snippets.

# hackety hack
from sys import argv
import rasterio as rio
import numpy as np
from sklearn import decomposition
with rio.open(argv[1]) as src:
count = src.meta['count']
@jqtrde
jqtrde / map.geojson
Created September 25, 2015 17:47 — forked from anonymous/map.geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jqtrde
jqtrde / map.geojson
Created September 24, 2015 19:21 — forked from anonymous/map.geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jqtrde
jqtrde / map.geojson
Last active September 18, 2015 00:08 — forked from anonymous/map.geojson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jqtrde
jqtrde / Dockerfile
Last active August 29, 2015 14:26 — forked from klokan/Dockerfile
GDAL in Docker - stable GDAL with JP2KAK, MRSID and ECW: https://registry.hub.docker.com/u/klokantech/gdal/
FROM debian:7
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -qq update \
&& apt-get -qq -y --no-install-recommends install \
autoconf \
automake \
build-essential \
curl \
@jqtrde
jqtrde / panchunk.py
Last active August 29, 2015 14:24 — forked from celoyd/panchunk.py
# Beta-quality Landsat 8-oriented windowed pansharpener by Charlie Loyd
# python3 panchunk.py $SCENE/*B{4,3,2,8}.TIF ${SCENE}-pansharp.tif
# Then you may want something like this to brighten it up:
# convert -channel B -gamma 0.96 -channel RGB -sigmoidal-contrast 40,14% ${SCENE}-pansharp.tif ${SCENE}-pretty.tif
# But that will strip geo tags.
import asyncio
import rasterio as rio
@jqtrde
jqtrde / resize.md
Last active August 29, 2015 14:22 — forked from drewbo/resize.md

How to create D3 visualizations that resize and scale well

When creating the SVG, add this bit of D3:

.attr("id","chart")
.attr("viewBox","0 0 960 500")
.attr("perserveAspectRatio","xMinYMid")

Then later in the code, add this bit of jQuery:

@jqtrde
jqtrde / README.md
Last active August 29, 2015 14:21 — forked from jwass/README.md

Quick idea to understand what modules get imported.

Example:

>>> import importlog

# Run a bunch of code
>>> import shapely.geometry
>>> p = shapely.geometry.Point(0.0, 0.0)
>>> b = p.buffer(1.0)
  1. General Background and Overview

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.

This write-up owes a great deal to dscape's Node.js Deployments with Docker, Dokku, & Digital Ocean, the dokku project itself, and the fine folks working on dokku's issues. I took dscape's article as a starting point when trying this out but found some details lacking so I documented my own process for getting dokku up and running.

1. Get a domain