Skip to content

Instantly share code, notes, and snippets.

@wildintellect
wildintellect / xarray2gpq.ipynb
Created August 9, 2023 00:34
ATL03 to Geoparquet
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wildintellect
wildintellect / Dockerfile
Created January 7, 2022 00:32
Untwine Docker Image VS Code
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/python-3-miniconda/.devcontainer/base.Dockerfile
FROM mcr.microsoft.com/vscode/devcontainers/miniconda:0-3
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi
# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
@wildintellect
wildintellect / spyder3.desktop
Created October 10, 2019 17:17
Anaconda Spyder3 Desktop Launcher Linux
[Desktop Entry]
Name=Spyder3
Exec=/home/<username>/anaconda3/bin/spyder
Icon=/usr/share/app-install/icons/spyder3.png
Type=Application
Terminal=false
Categories=Office;Development;
MimeType=text/plain
@wildintellect
wildintellect / cli.sh
Last active August 29, 2015 14:19
Bash Magic
# Make a list of all fonts in the layout mapserver wants for a font file
find /usr/share/fonts -name "*.ttf" | xargs -i sh -c 'echo $(basename {}) {}' > fonts.list
@wildintellect
wildintellect / sort.py
Last active August 29, 2015 14:06
Sorts bracketed photos into 3 subfolders
#!/usr/bin/env python
# -*- coding: utf_8 -*
#
# Script to sort bracketed photos by exposure into bins.
# Default assumes 3 photos per bracket set, into 3 folders
#
# Alex Mandel 2014
# tech@wildintellect.com
# requires python
@wildintellect
wildintellect / osm_scales.xml
Created September 22, 2014 21:10
Spherical Mercator tile levels approximate scales for use in QGIS with GDAL TMS layers.
<qgsScales version="1.0">
<!--Approximate Tile Scales for OSM and other Spherical Mercator Projections.
Source:http://www.3liz.com/blog/rldhont/index.php?post/2012/07/17/OpenStreetMap-Tiles-in-QGIS
-->
<scale value="1:591659030"/>
<scale value="1:295829515"/>
<scale value="1:147914757"/>
<scale value="1:73957378"/>
<scale value="1:36978689"/>
<GDAL_WMS>
<Service name="TMS">
<ServerUrl>http://c.tile.thunderforest.com/cycle/${z}/${x}/${y}.png</ServerUrl>
</Service>
<DataWindow>
<UpperLeftX>-20037508.34</UpperLeftX>
<UpperLeftY>20037508.34</UpperLeftY>
<LowerRightX>20037508.34</LowerRightX>
<LowerRightY>-20037508.34</LowerRightY>
<TileLevel>18</TileLevel>
@wildintellect
wildintellect / worldfile
Last active August 29, 2015 14:01
Convert BBOX+Image to World File
#how to make world file from a bounding box and an image file - aka kml/kmz
#Generic Formula
(W-E)/(width pixels)
0
0
(N-S)/(width pixels)
West+.5*abs((W-E)/(width pixels))
North-.5*abs((N-S)/(height pixels))
#Example
@wildintellect
wildintellect / GISTIndexCheck
Created May 19, 2014 18:23
Listing all GIST indexes in a Postgis database.
SELECT i.relname as indexname,
idx.indrelid::regclass as tablename,
am.amname as typename,
ARRAY(
SELECT pg_get_indexdef(idx.indexrelid, k + 1, true)
FROM generate_subscripts(idx.indkey, 1) as k
ORDER BY k
) as indkey_names
FROM pg_index as idx
JOIN pg_class as i
@wildintellect
wildintellect / awstats-historical.sh
Created August 23, 2012 20:23
Bash process old apache logs with awstats
#!/bin/bash
# Alex Mandel 2011
# Apache 2.0 License
#Script outline for updating awstats from historical logs
#Take start number of oldest log via arguments
# grass.osgeo.org
configfile=$1
# grass-access.log
apachelogbase=$2