Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View heewa's full-sized avatar

Heewa Barfchin heewa

  • New York, NY
View GitHub Profile
@heewa
heewa / kaj-board.svg
Created October 10, 2020 20:42
Kaj Board - Outline
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@heewa
heewa / Makefile
Last active June 18, 2016 19:37
gomake - sharable golang makefile
# Makefile to build Golang projects that can be used without putting the
# makefile in the project directory. Using make to build & run go projects
# allows you to reuse build output when files haven't changed, considering
# building go can be slow.
#
# Based On: https://ariejan.net/2015/10/03/a-makefile-for-golang-cli-tools/
#
# By default it builds main.go from the directory you're in, to a binary
# called main. To amke it easier to use, set bash aliases & functions:
#
@heewa
heewa / diff_data.py
Created March 5, 2013 17:52
For when you're comparing two large, deeply hierarchical things that are very slightly different.
def diff_data(d1, d2, d1_name='d1', d2_name='d2'):
"""Return fields in one but not the other, or None if they're the same.
"""
if d1 == d2:
return None
elif type(d1) != type(d2):
return {d1_name: d1, d2_name: d2}
elif isinstance(d1, dict):
diff = {}
for key, v1 in d1.iteritems():