Skip to content

Instantly share code, notes, and snippets.

View yuletide's full-sized avatar
🤘

Alex Yule yuletide

🤘
View GitHub Profile
@Sklavit
Sklavit / colorized_voronoi_with_clipping.py
Created March 26, 2017 00:36 — forked from pv/colorized_voronoi.py
Colorized Voronoi diagram with Scipy, in 2D, including infinite regions which are clipped to given box.
# coding=utf-8
import numpy as np
import matplotlib.pyplot as plt
from scipy.spatial import Voronoi
from shapely.geometry import Polygon
def voronoi_finite_polygons_2d(vor, radius=None):
"""
Reconstruct infinite voronoi regions in a 2D diagram to finite
regions.
@adamreisnz
adamreisnz / package.json
Last active January 19, 2024 13:01
Simple pure npm scripts build process
{
"name": "project-name",
"description": "Template for static sites",
"version": "1.0.0",
"homepage": "http://www.project-name.com",
"author": {
"name": "Adam Reis",
"url": "http://adam.reis.nz"
},
"license": "UNLICENSED",
@vasanthk
vasanthk / System Design.md
Last active May 6, 2024 20:21
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@SethTisue
SethTisue / scalawags-22.md
Last active August 29, 2015 14:07
Scalawags #22: Heather Miller in a Pickle
@graydon
graydon / country-bounding-boxes.py
Created April 23, 2014 00:03
country bounding boxes
# extracted from http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_countries.zip
# under public domain terms
country_bounding_boxes = {
'AF': ('Afghanistan', (60.5284298033, 29.318572496, 75.1580277851, 38.4862816432)),
'AO': ('Angola', (11.6400960629, -17.9306364885, 24.0799052263, -4.43802336998)),
'AL': ('Albania', (19.3044861183, 39.624997667, 21.0200403175, 42.6882473822)),
'AE': ('United Arab Emirates', (51.5795186705, 22.4969475367, 56.3968473651, 26.055464179)),
'AR': ('Argentina', (-73.4154357571, -55.25, -53.628348965, -21.8323104794)),
'AM': ('Armenia', (43.5827458026, 38.7412014837, 46.5057198423, 41.2481285671)),
@bensheldon
bensheldon / advice_for_cfa_fellows.md
Last active August 2, 2023 16:50
A summary of conversations I've had with current, former and future Code for America fellows.
  • Who's your customer? The department or the citizen. What’s your product? The negotiated-design process or the actual outcome itself. These things are interrelated, but ensure the entire team is aligned and in agreement on what it is you’re doing and what the outcome is you want. What do you want to say you built at the end-of-year summit? The earlier you can figure this out, the better your year will go. Project uncertainty is the mind-killer.

  • Don't negotiate with yourselves. My team would have achieved so much more if we had come to an agreement internally on how to proceed in our city design negotiations, and let CfA staff tell us if we were unreasonable. Instead, we watered down what we wanted, caved on major issues, and negotiated individually with our city partners rather than as a team.

  • Invest your time in one thing for the entire year. Your understanding of the civic problem-space may change and evolve, but creating a commitment (individually, as a team, and in your city-

@grantslatton
grantslatton / hngen.py
Last active September 27, 2021 11:07
A program that uses Markov chains to generate probabilistic Hacker News titles.
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
@tmcw
tmcw / index.html
Created June 4, 2013 21:54
My Starting-Point Index File
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel='stylesheet' type='text/css' href='' />
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
<meta name='viewport' content='initial-scale=1.0 maximum-scale=1.0'>
</head>
<body>
<script src=''></script>
@perrygeo
perrygeo / zonal_stats.py
Last active March 22, 2023 05:01
Python implementation of zonal statistics function. Optimized for dense polygon layers, uses numpy, GDAL and OGR to rival the speed of starspan.
"""
Zonal Statistics
Vector-Raster Analysis
Copyright 2013 Matthew Perry
Usage:
zonal_stats.py VECTOR RASTER
zonal_stats.py -h | --help
zonal_stats.py --version
@migurski
migurski / README.md
Last active December 14, 2015 18:38
GL-Solar, Rainbow Road edition