Skip to content

Instantly share code, notes, and snippets.

View nicopace's full-sized avatar

Nicolás Pace nicopace

View GitHub Profile
@nicopace
nicopace / limit.js
Created January 27, 2016 16:54 — forked from PatrickJS/limit.js
PubNub Rate Limiting vs. Throttling Messages in AngularJS http://stackoverflow.com/questions/18364918/throttling-pubnub-requests-in-angluarjs
//
// Listen for messages and process all messages at steady rate limit.
//
pubnub.subscribe({
channel : "hello_world",
message : limit( function(message) {
// process your messages at set interval here.
}, 500 /* milliseconds */ )
@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
#!/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