Skip to content

Instantly share code, notes, and snippets.

@zhm
zhm / install-wkhtmltopdf.sh
Last active September 7, 2017 16:18
Install wkhtmltpdf on Linux
#!/usr/bin/sh
DOWNLOAD_URL="https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz"
cd ~
wget $DOWNLOAD_URL -O ~/wkhtmltox.tar.xz
tar -xvf ~/wkhtmltox.tar.xz
@zhm
zhm / biscuits-and-gravy.md
Created December 23, 2016 23:11
Biscuits and Gravy

Biscuits

  • 1 pound White Lily self-rising flour
  • 1 1/2 cups buttermilk
  • 1/4 pound frozen butter
  • Salt + Pepper

Gravy

  • 1 pound sausage, any kind you want
module ActionController
# This module provides a method which will redirect browser to use HTTPS
# protocol. This will ensure that user's sensitive information will be
# transferred safely over the internet. You _should_ always force browser
# to use HTTPS when you're transferring sensitive information such as
# user authentication, account information, or credit card information.
#
# Note that if you are really concerned about your application security,
# you might consider using +config.force_ssl+ in your config file instead.
# That will ensure all the data transferred via HTTPS protocol and prevent
<!DOCTYPE html>
<meta charset="utf-8">
<title>Non-Contiguous Cartogram</title>
<style>
.land {
fill: #fff;
stroke: #ccc;
}
@zhm
zhm / index.html
Last active January 4, 2016 02:09
<!DOCTYPE html>
<meta charset="utf-8">
<title>Non-Contiguous Cartogram</title>
<style>
.land {
fill: #fff;
stroke: #ccc;
}
@zhm
zhm / gist:5051253
Last active December 14, 2015 07:29
configure.in for GDAL 1.9.2
dnl ***************************************************************************
dnl $Id: configure.in 24333 2012-04-28 12:18:28Z rouault $
dnl
dnl Project: GDAL
dnl Purpose: Configure source file.
dnl Author: Frank Warmerdam, warmerdam@pobox.com
dnl
dnl ***************************************************************************
dnl Copyright (c) 2000, Frank Warmerdam
dnl
{
"address": {
"administrative": "Paris",
"city": "Paris",
"country": "France",
"country_code": "fr",
"county": "Paris",
"postcode": "75004",
"road": "Rue des Francs Bourgeois",
"state": "\u00cele-de-France",
select
(select count(1) from acls) as acls,
(select count(1) from changeset_tags) as changeset_tags,
(select count(1) from changesets) as changesets,
(select count(1) from client_applications) as client_applications,
(select count(1) from countries) as countries,
(select count(1) from current_node_tags) as current_node_tags,
(select count(1) from current_nodes) as current_nodes,
(select count(1) from current_relation_members) as current_relation_members,
(select count(1) from current_relation_tags) as current_relation_tags,
@zhm
zhm / osmtag.sh
Created October 5, 2012 15:02
Make a quick CSV from any tag/value in OSM
TAG="amenity" && VALUE="baby_hatch" && curl -s "http://overpass-api.de/api/interpreter?data=%5Bout%3Ajson%5D%3B%28node%5B${TAG}%3D%27${VALUE}%27%5D%3B%29%3Bout%3B" | grep -E "lat|lon" | sed 's/"//g' | sed -E 's/lat: (.+),/\1|/' | sed 's/lon: //' | sed 's/ //' | xargs | tr ',' '\n' | tr '|' ',' | sed 's/ //g' | grep -Ev '^$'
@zhm
zhm / mbtiles_delete_zoom_level.sql
Created October 3, 2012 23:09
Delete zoom levels from an MBTiles file (set max zoom)
-- change 18 to whatever the max zoom level you want in your MBTiles
DELETE FROM images WHERE
tile_id IN (SELECT tile_id FROM map WHERE zoom_level > 18) AND
tile_id NOT IN (SELECT tile_id FROM map WHERE zoom_level <= 18);
DELETE FROM map WHERE zoom_level > 18;
UPDATE metadata SET value = '18' WHERE name = 'maxzoom';