Skip to content

Instantly share code, notes, and snippets.

View panzerama's full-sized avatar

Jason Drew Panzer panzerama

  • Seattle, WA
View GitHub Profile
@panzerama
panzerama / git-files-histogram.py
Created December 3, 2018 23:30
A Python script for visualizing the size of objects in your git repo.
#!/usr/bin/env python3
"""
Counts file size of objects in your repository's packfile and sorts by
buckets. Defaults to buckets of 1M.
Requires third-party libraries matplotlib and numpy
Author: Jason Drew Panzer
"""
from matplotlib import pyplot as plt
from subprocess import run
{% for enum in types.enums %}
extension {{ enum.name }}{% if enum.rawTypeName %}: {{ enum.rawTypeName }} {%endif%} {
public func xform() -> NamedDictionary {
switch self {}
{% for case in enum.cases %}
case .{{case.name}}{% if case.hasAssociatedValue %}({% for value in case.associatedValues %}{% if value.localName %}let {{value.localName}}{% if not forloop.last %}, {% endif %}{% endif %}{%endfor%}){% endif %}:
return .z("{{case.name}}"{% if case.hasAssociatedValue %}, [{% for value in case.associatedValues %}{% if value.localName %}"{{value.localName}}": {{value.localName}}{% if not forloop.last %}, {% endif %}{% endif %}{%endfor%}]{% endif %})
{% endfor %}
default:
return .z("n/a")
@panzerama
panzerama / .bash_profile
Created March 23, 2018 23:12 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management

Sign in to the Amazon Developer Console

https://developer.amazon.com/

Click on the Sign In button on the top right

Enter your credentials

Note: If this is your first time logging in to an Amazon Developer Account, you might need to enter a few more details

@panzerama
panzerama / hough_transform.py
Created January 4, 2017 01:52
Solution for correcting text skew in image with scipy, scikit
#image processing resources
from skimage.io import imread, imshow
from skimage.filters import gaussian, threshold_otsu
from skimage.feature import canny
from skimage.transform import probabilistic_hough_line, rotate
#testing
import numpy as np
import os