Skip to content

Instantly share code, notes, and snippets.

View alukach's full-sized avatar
🍊

Anthony Lukach alukach

🍊
View GitHub Profile
@alukach
alukach / custom-errors.ts
Last active July 23, 2019 22:55
Typescript Favorites
/*
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 14:39
A framework for a Volunteer Software Dev program

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 April 9, 2018 11:34
Calgary building detection

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 March 29, 2018 05:08
Serve ESRI Web App Builder app from HTTP
#!/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 November 25, 2017 19:58 — forked from thiagophx/pp
JSON Pretty Print Stream
#!/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():
@alukach
alukach / docker-tips.md
Last active February 12, 2020 21:32
Docker Cheatsheet

Docker Cheatsheet

Glossary

Container
Single unit of computing.
Task
@alukach
alukach / Myanmar.html
Created June 1, 2017 18:42
A quick test of a computers ability to view Myanmar set of Unicode characters.
<!DOCTYPE html>
<html class="client-nojs" lang="en" dir="ltr">
<head>
<meta charset="UTF-8"/>
<title>S'gaw Karen Script - Wikipedia</title>
</head>
<body>
<h3><span class="mw-headline" id="Blocks">Blocks</span><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=S%27gaw_Karen_Script&amp;action=edit&amp;section=2" title="Edit section: Blocks">edit</a><span class="mw-editsection-bracket">]</span></span></h3>
<div role="note" class="hatnote navigation-not-searchable">See also: <a href="/wiki/Myanmar_(Unicode_block)" title="Myanmar (Unicode block)">Myanmar (Unicode block)</a>, <a href="/wiki/Myanmar_Extended-A" title="Myanmar Extended-A">Myanmar Extended-A (Unicode block)</a>, and <a href="/wiki/Myanmar_Extended-B" title="Myanmar Extended-B">Myanmar Extended-B (Unicode block)</a></div>
<p>The Unicode blocks for Burmese, called Myanmar, are U+1000–U+109F, U+AA60–U+AA7B, and U+A9E0-U+A9FF.</p>
@alukach
alukach / threading.py
Created May 11, 2017 20:52
Threading Context Manager
from multiprocessing import cpu_count
import threading
import queue
import logging
logger = logging.getLogger(__name__)
class ThreadQueue(object):
@alukach
alukach / drf-custom-token-auth.py
Last active April 6, 2017 02:42
A custom token authentication system for DRF.
#
# Token Manager
# https://docs.djangoproject.com/en/1.10/topics/signing/
#
from django.core import signing
from django.contrib.auth import get_user_model
class TemporaryApiToken():
"""
@alukach
alukach / test.py
Created June 9, 2016 15:28
A test script to demonstrate that Twisted was locking up after 30k file deletions
import sys
from twisted.internet import inotify, reactor, threads
from twisted.python import filepath
# Resources:
# Introduction to Deferreds:
# http://twisted.readthedocs.io/en/twisted-16.1.1/core/howto/defer-intro.html
# Returning Deferreds from synchronous functions:
# https://twistedmatrix.com/documents/current/core/howto/gendefer.html#returning-deferreds-from-synchronous-functions