Skip to content

Instantly share code, notes, and snippets.

View colegleason's full-sized avatar

Cole Gleason colegleason

View GitHub Profile
@colegleason
colegleason / archive_dirs.sh
Last active August 20, 2020 15:34
Zip all subdirectories that are older than a year old, remove source files after zip
find . -type d -mtime +365 -maxdepth 1 -exec zip -mr {}.zip {} \;
@colegleason
colegleason / get_elected_officials.py
Created January 27, 2017 20:05
A quick script to grab many of the elected officials for Allegheny County from Google's Civic Info API
from apiclient.discovery import build
import csv
import os
service = build('civicinfo', 'v2',
developerKey=os.environ['API_KEY'])
r = service.representatives()
d = service.divisions()
@colegleason
colegleason / deploy_posenet.prototxt
Created July 14, 2016 17:32
Deploy network for Posenet
name: "GoogLeNet"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 224
input_dim: 224
layers {
name: "conv1"
type: CONVOLUTION
bottom: "data"
@colegleason
colegleason / keybase.md
Created October 7, 2015 16:36
Keybase verification

Keybase proof

I hereby claim:

  • I am colegleason on github.
  • I am colegleason (https://keybase.io/colegleason) on keybase.
  • I have a public key whose fingerprint is AB7C 7466 28F1 F92E 1DAD 4093 91A7 3434 E6BD 5AFC

To claim this, I am signing this object:

@colegleason
colegleason / weather.py
Created December 28, 2014 04:13
Here's another early Python script. Weather forecast script. Date: 2/7/10
#Cole's Weather Wizard
#First we need to import some modules.
import urllib
from xml.dom import minidom
from string import lower
#Ask the user for their zip code.
zip = input("Enter your zip code: ")
#Create the correct Google url by appending the user's zip code.
url = 'http://www.google.com/ig/api?weather=%d' % (zip, )
#Parse the XML document into a usable DOM.
@colegleason
colegleason / rps.py
Created December 28, 2014 04:07
Not my first program, but definitely early on in my programming career. Probably my Python script that wasn't a Project Euler problem. I remember writing this on a plane using a small netbook. Date: 2/11/10
#Rock Paper Scissors
import random
repeat = True
continue_game = True
while(repeat):
total_rounds = input("What is the maximum number of rounds that you wish to play? ")
curr_round = 1
wins = 0
losses = 0
draws = 0
@colegleason
colegleason / glass.html
Last active August 29, 2015 13:58
[wearscript] Magnify
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<style>
#container {
width: 640px;
@colegleason
colegleason / glass.html
Last active August 29, 2015 13:58
[wearscript] Vision (wizard)
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<style>
#container button {
width: 100%;
@colegleason
colegleason / glass.html
Last active August 29, 2015 13:57
[wearscript] Magnet
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
@colegleason
colegleason / glass.html
Last active August 29, 2015 13:57
[wearscript] MYO Hue Tug of war
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script data-require="jquery" data-semver="2.0.3" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<script>
var HUE_ID = 1;
var PLAYER_A = 1;
var PLAYER_B = 3;
var TARGET = 2;