Skip to content

Instantly share code, notes, and snippets.

View nicopace's full-sized avatar

Nicolás Pace nicopace

View GitHub Profile
@nicopace
nicopace / bootstrap.sh
Last active August 29, 2015 14:10 — forked from keo/bootstrap.sh
Setup encrypted partition for Docker containers
#!/bin/sh
# Setup encrypted disk image
# For Ubuntu 14.04 LTS
CRYPTFS_ROOT=/cryptfs
apt-get update
apt-get -y upgrade
apt-get -y install cryptsetup
@nicopace
nicopace / index.html
Last active August 29, 2015 14:09
Testing OTP polyline decoding in javascript
<html>
<head>
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
<style>
#map { height: 500px; }
</style>
</head>
<body>
<div id="map"></div>
@nicopace
nicopace / squid.conf
Created August 20, 2014 18:57
squid config
# This squidfile is useful for catching big files
#
# WELCOME TO SQUID 3.3.8
# ----------------------------
#
# This is the documentation for the Squid configuration file.
# This documentation can also be found online at:
# http://www.squid-cache.org/Doc/config/
#
# You may wish to look at the Squid home page and wiki for the
function elementInViewport(el) {
var rect = el.getBoundingClientRect()
return rect.bottom > 0 &&
rect.right > 0 &&
rect.left < (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */ &&
rect.top < (window.innerHeight || document.documentElement.clientHeight) /*or $(window).height() */ ;
}
#!/usr/bin/env python
# distance_from_shore.py: compute true distance between points
# and closest geometry.
# shaun walbridge, 2012.05.15
# TODO: no indexing used currently, could stand if performance needs
# improving (currently runs in ~1.5hr for 13k points)
from geopy import distance