Skip to content

Instantly share code, notes, and snippets.

View jisantuc's full-sized avatar

James Santucci jisantuc

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jisantuc on github.
  • I am jisantuc (https://keybase.io/jisantuc) on keybase.
  • I have a public key ASCx6ApQ7Jc6OlSZcQzb2MfT7t92FKQom-hJTXtcsQ-Kvgo

To claim this, I am signing this object:

;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@jisantuc
jisantuc / simplify.py
Created December 12, 2017 19:56
Simplification script for Census block shapefile from VA
from concurrent.futures import ThreadPoolExecutor, as_completed
import pickle
import time
from uuid import uuid4
import fiona
from rtree import index
from shapely import geometry
from shapely.geometry import shape
from shapely.ops import cascaded_union
module GraphDot where
{-# LANGUAGE OverloadedStrings #-}
import qualified Data.Map.Strict as M
import qualified Data.ByteString as BS
import Data.Attoparsec.ByteString.Char8
import qualified Data.Attoparsec.Combinator as Comb
import Control.Applicative
module InChapter where
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad.IO.Class
import Control.Monad.Trans.Except
import Control.Monad.Trans.Maybe
import Control.Monad.Trans.Reader
-- EitherT
"""
The goal of this software is to run a simulation of a model presented by
Moon Duchin in the math session at the Austin regional site for the Metric
Geometry and Gerrymandering Group
In broad strokes, it takes an input shape of some sort and splits it
in four at some point in the polygon (don't talk to me about points out
of the polygon, you degenerate). It assumes that the polygon has some proportion
of one delegate's worth of population, and that the shapes resulting from the split

Chapter 29 - IO

tl;dr: IO doesn't do anything, it's just a way of describing getting a value from somewhere

  • we should be proud
  • some examples of effects:
    • printing st stdout (putStrLn)
  • reading from stdin (getChar)
module FiveMinuteFP where
data Option a = Nope | Yup a deriving (Eq, Show)
-- try to make a number odd by adding 1 to it
oddify1 :: Int -> Option Int
oddify1 x =
case (x `mod` 2) of
0 -> Yup (x + 1)
_ -> Nope
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
  • goal: pluggability, so that if someone wants to write the akka-http routes, it's easy for them

  • other question: what's the abstraction? Like -- Meta, or En/Decoder, or...

  • Define Tile Fetching Interface

    • based on layer id
    • something that produces a (Int, Int, Int) => Tile
    • also like Extent => Tile, Extent => Geotiff
    • like TileResolver in existing tile server
  • Cacheing interface -- mostly done, failing tests