Skip to content

Instantly share code, notes, and snippets.

View MattDietz's full-sized avatar

Matt Dietz MattDietz

  • Matthew Dietz, LLC
  • San Antonio, TX
View GitHub Profile

Keybase proof

I hereby claim:

  • I am MattDietz on github.
  • I am cerberus98 (https://keybase.io/cerberus98) on keybase.
  • I have a public key whose fingerprint is 53A1 33BD 42A1 26B9 42D0 B70B C855 080A 9657 F0E7

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am cerberus98 on github.
  • I am cerberus98 (https://keybase.io/cerberus98) on keybase.
  • I have a public key whose fingerprint is 53A1 33BD 42A1 26B9 42D0 B70B C855 080A 9657 F0E7

To claim this, I am signing this object:

@MattDietz
MattDietz / Team Philosophy
Last active August 28, 2017 16:35
Team Philosophy
This is an ivory tower, but we're going to aim high. Patches Accepted.
No dissent goes undiscussed. Everyone has equal say.
You won't always get your way.
All debates must end with a constructive conclusion and a direction forward, and the sooner the better.
Encourage Sharing: Everyone has legimitate ideas worthy of validation
We only succeed or fail as a team
Always present a possible solution after presenting a problem
We will communicate with our teammates if any issues arise
Educating your peers is never a waste of time.
@MattDietz
MattDietz / gist:6144016
Last active December 20, 2015 14:09
Counting word usage. Could be more efficient ways.
import re
data = open("a bunch of text", 'r')
words = {}
strip_punc = re.compile("[!.,]")
whitespace_collapse = re.compile("\s+")
for line in data.readlines():
line = strip_punc.sub('', line)
(compute)~/code/python/path_test/foo python bar.py
['/home/nova/code/python/path_test/foo'...]
(compute)~/code/python/path_test/foo cd ..
(compute)~/code/python/path_test python foo/bar.py
['/home/nova/code/python/path_test/foo'...]
@MattDietz
MattDietz / gist:6072825
Created July 24, 2013 17:51
Finding python tree root
import os
import sys
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir, '<project name>', '__init__.py')):
sys.path.insert(0, possible_topdir)
@MattDietz
MattDietz / gist:6066882
Created July 23, 2013 22:56
Quota driver fixup
commit 93894e70b7313e37f97a58565c75d114d9e180e7
Author: Matt Dietz <matt.dietz@rackspace.com>
Date: Tue Jul 23 22:53:56 2013 +0000
Moves quota config back to plugin
Moves the quota configuration lines back into plugin.py which in turn
solves a weird dependency issue when loading the Quark quota driver via
the neutron.conf.
@MattDietz
MattDietz / gist:5241529
Created March 25, 2013 22:43
Repose tm2
[composite:quantum]
use = egg:Paste#urlmap
/: quantumversions
/v2.0: quantumapi_v2_0
[composite:quantumapi_v2_0]
use = call:quantum.auth:pipeline_factory
noauth = noauth egg:repoze.tm2#tm extensions quantumapiapp_v2_0
#noauth = extensions quantumapiapp_v2_0
keystone = authtoken keystonecontext egg:repoze.tm2#tm extensions quantumapiapp_v2_0
@MattDietz
MattDietz / Gitconfig sloc alias
Created March 20, 2013 17:10
Git sloc alias
sloc = "!f() { git ls-files | xargs -i git blame \\{\\} | egrep -o \"\\(.* \" | cut -f1-2 -d\" \" | sort | uniq -c; }; f"
@MattDietz
MattDietz / gist:3429125
Created August 22, 2012 20:40
tmux config so far
set -g default-terminal "screen-256color"
# remap prefix to Control + a
set -g prefix C-a
unbind C-b
bind C-a send-prefix
# force a reload of the config file
unbind r
bind r source-file ~/.tmux.conf