Skip to content

Instantly share code, notes, and snippets.

View nmpeterson's full-sized avatar

Noel Peterson nmpeterson

View GitHub Profile
@mndrake
mndrake / shiny_leaflet_brushing.R
Created March 29, 2017 00:39
Interactive Polygon Brushing with Shiny and Leaflet
# originally from: http://stackoverflow.com/questions/42528400/plot-brushing-or-accessing-drawn-shape-geometry-for-spatial-subsets-in-shiny-lea
# uses https://github.com/bhaskarvk/leaflet.extras
library(shiny)
library(leaflet)
library(leaflet.extras)
library(sp)
cities <- structure(list(AccentCity = c("Saint Petersburg", "Harare", "Qingdao",
"Addis Abeba", "Xian", "Anshan", "Rongcheng", "Kinshasa", "New York",
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@awoodruff
awoodruff / README.md
Last active June 1, 2018 20:05
Projection face!
@nhoffman
nhoffman / read_dcw.py
Created September 7, 2011 03:02
Example demonstrating openpyxl
import itertools
from openpyxl.reader.excel import load_workbook
def getrows(sheet, cols):
headers = [c.value for c in sheet.rows[0] if c.value]
for row in sheet.rows[1:]:
d = dict(zip(headers, [c.value for c in row]))
yield dict((k2, d[k1]) for k1,k2 in cols)