Skip to content

Instantly share code, notes, and snippets.

View mciantyre's full-sized avatar

Ian McIntyre mciantyre

View GitHub Profile
@mciantyre
mciantyre / Dockerfile
Created July 9, 2018 19:54
Nginx proxy to two microservices
# Temporary image to coordinate the build...
FROM golang:1.10-alpine
ADD service.go /go/src/service/service.go
RUN go install service
# The actual output image
FROM alpine:latest
COPY --from=0 /go/bin/service .
ENV PORT 8080
CMD ["./service"]
@mciantyre
mciantyre / demo.cpp
Created March 16, 2018 22:55
Code: Safer configuration and exception masks in C++
#include <cstdint>
enum class ValidationExceptions : uint32_t
{
COMP_NO_EXCEPTION = 0,
COMP_DIV_BY_ZERO = 1,
COMP_EXCEEDS_MIN = 2,
COMP_EXCEEDS_MAX = 4,
COMP_NOT_ENOUGH = 8,
};
@mciantyre
mciantyre / keybase.md
Created February 17, 2018 17:54
keybase.md

Keybase proof

I hereby claim:

  • I am mciantyre on github.
  • I am mciantyre (https://keybase.io/mciantyre) on keybase.
  • I have a public key ASBwZrz5TxK9H0oPeciOBxpDtuwPZTWH8j3I4DtkkPiDfQo

To claim this, I am signing this object:

@mciantyre
mciantyre / KmlToCsv.py
Last active December 18, 2023 02:39
KML to CSV in Python
"""
A script to take all of the LineString information out of a very large KML file. It formats it into a CSV file so
that you can import the information into the NDB of Google App Engine using the Python standard library. I ran this
script locally to generate the CSV. It processed a ~70 MB KML down to a ~36 MB CSV in about 8 seconds.
The KML had coordinates ordered by
[Lon, Lat, Alt, ' ', Lon, Lat, Alt, ' ',...] (' ' is a space)
The script removes the altitude to put the coordinates in a single CSV row ordered by
[Lat,Lon,Lat,Lon,...]