Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Lukach alukach

View GitHub Profile
@alukach
alukach / app.yaml
Last active Jun 5, 2020
An example Github Actions for Python + Pipenv + Postgres + Pyright
View app.yaml
# .github/workflows/app.yaml
name: My Python Project
on: push
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
services:
@alukach
alukach / boilerplate.py
Last active Dec 23, 2019
AWS S3 Batch Operation boilerplate
View boilerplate.py
import urllib
import boto3
from botocore.exceptions import ClientError
s3 = boto3.resource("s3")
TMP_FAILURE = "TemporaryFailure"
FAILURE = "PermanentFailure"
@alukach
alukach / parse-inventory.py
Last active May 7, 2020
Parsing S3 Inventory results in Python
View parse-inventory.py
import json
import csv
import gzip
import boto3
s3 = boto3.resource('s3')
def list_keys(bucket, manifest_key):
@alukach
alukach / example.py
Last active Mar 14, 2020
An example of a PIL-friendly object to represent an S3 file.
View example.py
from typing import IO
from dataclasses import dataclass, field
from io import BytesIO
import boto3
from PIL import Image
s3 = boto3.resource("s3")
@alukach
alukach / bundles.json
Last active Nov 6, 2019
Convert Planet product bundles description into JSON
View bundles.json
{
"bundles": {
"analytic": {
"name": "Analytic Radiance",
"description": "Orthorectified product, calibrated to at-sensor radiance",
"assets": {
"Landsat8L1G": [
"analytic_b1",
"analytic_b2",
"analytic_b3",
@alukach
alukach / custom-errors.ts
Last active Jul 23, 2019
Typescript Favorites
View custom-errors.ts
/*
In this file, we subclass the built-in Error object to create custom errors.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
*/
// tslint:disable:max-classes-per-file
abstract class CustomError extends Error {
constructor(...params: any[]) {
// Pass remaining arguments (including vendor specific ones) to parent constructor
super(...params);
@alukach
alukach / 1.organization.md
Last active May 10, 2019
A framework for a Volunteer Software Dev program
View 1.organization.md

Organization

The basic idea of this organization is to link up software developers with organizations (from here on out referred to as "partners") that need custom software development.

Motivations

For Developers

Developers may be interested for the following reasons:

@alukach
alukach / README.md
Last active Apr 9, 2018
Calgary building detection
View README.md

Generating building geometries from satellite imagery

Goals

Currently, the OpenStreetMap dataset for the Calgary, Alberta, Canada region is lacking most of the city's building footprints. The City of Calgary possesses a dataset of the building footprints, however it opts to sell this data rather than distribute it for free via its open data catalogue. The City of Edmonton does distribute its respective building footprint dataset freely and thus the footprints are available via OpenStreetMap. Utilizing high resolution satellite imagery of the City of Edmonton and the building footprint dataset from OpenStreetMap, it should be feasible to train a neural network classifier to generate building footprint polygons from provided satellite imagery of the Calgary region.

Methodology

A similar challenge Kaggle competition exists: Dstl's Satellite Imagery competition

@alukach
alukach / runserver
Last active Mar 29, 2018
Serve ESRI Web App Builder app from HTTP
View runserver
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import json
import os
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
if __name__ == '__main__':
@alukach
alukach / json_pps
Last active Nov 25, 2017 — forked from thiagophx/pp
JSON Pretty Print Stream
View json_pps
#!/usr/bin/python -u
import json
import sys
from pygments import highlight
from pygments.lexers import JsonLexer
from pygments.formatters import Terminal256Formatter
for line in sys.stdin:
if line.strip():
You can’t perform that action at this time.