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 / 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 / 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 / server.py
Last active December 27, 2015 21:49
simple websocket msgpack server
import gevent.monkey
gevent.monkey.patch_all()
import msgpack
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler
def websocket_app(environ, start_response):
print('Connected')
if environ["PATH_INFO"] == '/':
ws = environ["wsgi.websocket"]
@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 / post-checkout
Created July 25, 2012 21:05
Show stashed changes after checkout
#!/usr/bin/env python
#
# .git/hooks/post-checkout
import sys
import subprocess
git_name = subprocess.Popen(("git","name-rev","--name-only", "HEAD"),
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
branch_name = git_name.communicate()[0].strip('\n')
git_name.stdout.close()
@colegleason
colegleason / .Xdefaults
Created April 11, 2012 13:20
Yay for urxvt
! Urxvt theme from: http://crunchbanglinux.org/forums/topic/9935/post-your-xdefaults-and-terminal-apps-colorschemes-with-screenshot/
URxvt.perl-ext-common: default,matcher,tabbedex
!enabling clickable links:
URxvt.urlLauncher: /usr/bin/firefox
URxvt.matcher.button: 1
!urxvt scrolling options and cursor style:
@colegleason
colegleason / .zshrc
Created April 11, 2012 13:17
davesdots meets robbseaton
# .zshrc mashup of davesdots and robbseaton
# "compile slow, run fast." - family motto
export CFLAGS="-O3 -funsafe-loop-optimizations -ffast-math -march=native -pipe"
export CXXFLAGS=${CFLAGS}
# export LDFLAGS=${CFLAGS}
# I think I speak for everyone when I say "fuck gcc"
alias cc="clang -Wall -Wextra -Werror"
@colegleason
colegleason / hashmap.c
Created September 13, 2011 06:59
Hashmap
#include <stdio.h>
#include <string.h>
#define MAX_KEY 50
#define MAX_HASH 10
typedef struct node {
char key[MAX_KEY];
int value;
struct node *next;
@colegleason
colegleason / xorg.conf
Created June 4, 2011 22:14
double double head xorg.conf
Section "ServerLayout"
Identifier "aticonfig Layout"
Screen 0 "aticonfig-Screen[0]-0" 0 0
Screen "aticonfig-Screen[0]-1" RightOf "aticonfig-Screen[0]-0"
Screen "aticonfig-Screen[1]-0" RightOf "aticonfig-Screen[0]-1"
Screen "aticonfig-Screen[1]-1" RightOf "aticonfig-Screen[1]-0"
EndSection
Section "Module"
EndSection