Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@zhm
zhm / install-wkhtmltopdf.sh
Last active Sep 7, 2017
Install wkhtmltpdf on Linux
View install-wkhtmltopdf.sh
#!/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
View biscuits-and-gravy.md

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
View gist:11549899
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
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Non-Contiguous Cartogram</title>
<style>
.land {
fill: #fff;
stroke: #ccc;
}
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Non-Contiguous Cartogram</title>
<style>
.land {
fill: #fff;
stroke: #ccc;
}
@zhm
zhm / gist:5051253
Last active Dec 14, 2015
configure.in for GDAL 1.9.2
View gist:5051253
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
View gist:4072892
{
"address": {
"administrative": "Paris",
"city": "Paris",
"country": "France",
"country_code": "fr",
"county": "Paris",
"postcode": "75004",
"road": "Rue des Francs Bourgeois",
"state": "\u00cele-de-France",
View gist:4034326
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 Oct 5, 2012
Make a quick CSV from any tag/value in OSM
View osmtag.sh
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 '^$'