Skip to content

Instantly share code, notes, and snippets.

View walkermatt's full-sized avatar
💭
Drinking tea

Matt Walker walkermatt

💭
Drinking tea
View GitHub Profile
@rclark
rclark / Issues.md
Last active July 9, 2024 20:16
Leaflet WMS + GetFeatureInfo

There are a bunch of reasons why this is convoluted, mostly in building the URL to make the request:

  1. You have to rely on an AJAX request, this example uses jQuery
  2. To make a GetFeatureInfo request, you must provide a BBOX for a image, and the pixel coordinates for the part of the image that you want info from. A couple of squirrely lines of Leaflet code can give you that.
  3. Output formats. The info_format parameter in the request. We don't know a priori which will be supported by a WMS that we might make a request to. See Geoserver's docs for what formats are available from Geoserver. That won't be the same from WMS to WMS, however.
  4. WMS services return XML docs when there's a mistake in the request or in processing. This sends an HTTP 200, which jQuery doesn't think is an error.
@schlamar
schlamar / example.py
Last active December 20, 2024 08:10
mplog: Python advanced multiprocessing logging.
import logging
import multiprocessing
import time
import mplog
FORMAT = '%(asctime)s - %(processName)s - %(levelname)s - %(message)s'
logging.basicConfig(level=logging.DEBUG, format=FORMAT)
existing_logger = logging.getLogger('x')
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@wsargent
wsargent / docker_cheat.md
Last active August 2, 2025 19:24
Docker cheat sheet
@hgomez
hgomez / mint141516.md
Last active December 29, 2024 11:26
Mint 14 -> Mint 15 -> Mint 16

Mint upgrade procedures

Some investigation and tests on how to upgrade Mint machine.

Tests performed on Mint Cinnamon 14/15/16, on physical machine 14->15 and VirtualBox VMs for 14->15->16 and 14->16.

As usual you could break your machine, so please do backups before and cross fingers.

Mint 14 -> Mint 15

@DavidHernandez
DavidHernandez / Sci-fi books
Last active January 25, 2016 15:12
David's Sci-Fi book collection
The moon is a harsh mistress - Robert A. Heinlein - 5*
A canticle for Leibowitz - Walter M. Miller 4*
Flowers for Algernon - Daniel Keyes 5*
The Forever War - Joe Haldeman - 4*
The Stars my destination (also known as Tiger! Tiger!) - Alfred Bester - 5*
The Road - Cormac Mc Carthy - 4*
God is Dead - Ron Currie Jr. - 4*
The world without us - Alan Weisman (not really sci fi, but interesting, anyways) - 4*
Animal Farm - George Orwell - 5*
1984 - George Orwell - 5*
@sgillies
sgillies / GNU parallel vs concurrent.futures console
Last active March 30, 2017 20:41
Python concurrency benchmarks
vas-y:parallelz seang$ time parallel wc ::: `find ~/writing/blog/2013 -name *.rst`
18 128 791 /Users/seang/writing/blog/2013/10/07/downgrading-my-blog.rst
106 567 4011 /Users/seang/writing/blog/2013/10/08/linking-geojson.rst
34 249 1586 /Users/seang/writing/blog/2013/10/24/joining-mapbox.rst
70 373 2910 /Users/seang/writing/blog/2013/11/24/introducing-rasterio.rst
14 45 395 /Users/seang/writing/blog/2013/12/02/geojson-website-refreshed.rst
25 158 1256 /Users/seang/writing/blog/2013/12/03/atom-extension-for-tinkerer.rst
16 74 627 /Users/seang/writing/blog/2013/11/27/new-home-on-github-for-geojson.rst
143 685 6211 /Users/seang/writing/blog/2013/12/04/json-diff-and-patch-for-geojson.rst
26 202 1237 /Users/seang/writing/blog/2013/12/05/first-blog-post-at-mapbox.rst
@elithrar
elithrar / wale_postgres_recovery.md
Last active June 6, 2025 20:55
WAL-E + Postgres 9.x (single server + DB) Setup and Recovery

A quick "how to" on what you need to do to both setup AND recover a single-server PostgreSQL database using WAL-E

  • WAL-E: https://github.com/wal-e/wal-e
  • Assuming Ubuntu 12.04 LTS ("Precise")
  • We'll be using S3. Make sure you have an IAM in a group with GetObject, ListBucket and PutObject on the bucket you want to use (and that it's not public).

Setup:

  1. These packages:
bash$ GLOBIGNORE="confidential.txt"
bash$ ls -l /opt/too_many_files/*
secret.txt
top_secret.txt
public.txt