Skip to content

Instantly share code, notes, and snippets.

View zmpeg's full-sized avatar

Matt Zandstra zmpeg

View GitHub Profile
#!/usr/bin/env python
import argparse
import math
def deg2num(lat_deg, lon_deg, zoom):
lat_rad = math.radians(lat_deg)
n = 2.0 ** zoom
xtile = int((lon_deg + 180.0) / 360.0 * n)
ytile = int((1.0 - math.log(math.tan(lat_rad) + (1 / math.cos(lat_rad))) / math.pi) / 2.0 * n)
return (xtile, ytile)
@zmpeg
zmpeg / .zshrc
Created November 22, 2016 16:34
# Git prompt
source ~/.zsh/git-prompt/zshrc.sh
PROMPT='%B%m%~%b$(git_super_status) %# '
# Jump by word with control
bindkey "^[[1;5C" forward-word
bindkey "^[[1;5D" backward-word
# Fix History
SAVEHIST=999999999
Cloud-init v. 0.7.6 running 'init-local' at Wed, 01 Feb 2017 20:15:19 +0000. Up 8.51 seconds.
Cloud-init v. 0.7.6 running 'init' at Wed, 01 Feb 2017 20:15:19 +0000. Up 8.88 seconds.
ci-info: ++++++++++++++++++++++Net device info+++++++++++++++++++++++
ci-info: Device Up Address Mask Hw-Address
ci-info: lo True 127.0.0.1 255.0.0.0 .
ci-info: eth0 True 10.0.2.108 255.255.255.0 0a:01:fe:b0:17:92
ci-info: +++++++++++++++++++++++++++++Route info++++++++++++++++++++++++++++++
ci-info: Route Destination Gateway Genmask Interface Flags
ci-info: 0 0.0.0.0 10.0.2.1 0.0.0.0 eth0 UG
ci-info: 1 10.0.2.0 0.0.0.0 255.255.255.0 eth0 U