Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am gmcquillan on github.
  • I am gmcquillan (https://keybase.io/gmcquillan) on keybase.
  • I have a public key ASDBFSmvS8ti5PM_gSDN7u93W_TUAc-tDvHJQ1dHmuH8Awo

To claim this, I am signing this object:

@gmcquillan
gmcquillan / be_python_project.md
Last active August 29, 2015 14:05
A Short Python Homework Problem for Building Energy Engineering Candidates.

Python Engineer Take Home Project

Building Energy strives to help businesses and governments understand where energy usage occurs, and how to improve energy efficiency. Let’s look at some real-world data in a similar field; check out World Bank Data on Carbon Emissions. Click "Download Data" and select the format you want to work with, (CSV might be simplest).

Let’s build a simple application to read in this data from the commandline and sort the rows by a function applied across the columns of said rows.

We should be able to answer the following questions:

  • Sort countries according to the average change in carbon emissions per capita (ascending, descending, etc.).
def build_icontains_filters(model_a, a_attr, model_b_class, b_attr):
"""build filters for model_a in model_b_class amoung `attrs`."""
return {'{0}__icontains'.format(attribute): getattr(model_a, attr)}
@gmcquillan
gmcquillan / whisperer.go
Created October 18, 2013 02:46
Whispering Gophers Example Code With UDP Discovery
// Summarily stolen from the Whispering Gophers Example!
//
// Solution to part 8 of the Whispering Gophers code lab.
//
// This program extends part 8.
//
// It connects to the peer specified by -peer.
// It accepts connections from peers and receives messages from them.
// When it sees a peer with an address it hasn't seen before, it makes a
// connection to that peer.
@gmcquillan
gmcquillan / gist:1953453
Created March 1, 2012 21:46
crazy ruby
#!/usr/bin/env ruby
#
print "default = {:hbaseregion => {:handler_count => 25}}\n\n"
default = {:hbaseregion => {:handler_count => 25}}
print "testing defined?(default[:hbaseregion][:handler_count])\n"
if (defined?(default[:hbaseregion][:handler_count]))
print "yes\n\n"
else
print "no\n\n"
#!/usr/bin/env python
from twisted.internet import defer
from twisted.internet import reactor
from twisted.internet import protocol
from twisted.internet import ssl
from twisted.python import usage
from OpenSSL import SSL
import sys, os.path
#!/usr/bin/env python
import io
import logging
import simplejson as json
import time
import beanstalkc
"""
@gmcquillan
gmcquillan / .vimrc
Created October 15, 2010 17:12
My .vimrc, optimized for python development.
set enc=utf-8
set title
set titlestring=%f%(\ [%M]%)
set nocompatible
set cmdheight=2
" Enhanced command menu ctrl + d to expand dirs
set wildmenu
set wildignore+=*.pyc,.svn,.DS_Store

DevOps Requisition:

Urban Airship is looking for DevOps/SysAdmins. We run a high capacity, fault tolerant, and horizontally scalable infrastructure. Urban Airship’s DevOps are involved in design and implementation of automation, deployment, and monitoring systems. We analyze system behavior to tease out performance gains and squash configuration issues. We help maintain healthy distributed databases, web servers, deploy the odd email/smtp server, run load tests, backup mission critical data, know when to use caching, write naming services, and are syslog masters. We’re looking to do more. Can you help us out?

Responsibilities:

  • Linux system administration, including configuration, troubleshooting, and automation.
  • Service configuration for dozens of interconnected applications on virtualized hosts, anything from web servers to databases to home grown services.
# Mixpanel, Inc.
# http://mixpanel.com
max_ring_size = 2**127
def token_percent(token, max):
return round(token / float(max_ring_size), 4)
def calc(ring_load):
highest = {'total': 0, 'percent0': 0, 'percent1': 0}