Skip to content

Instantly share code, notes, and snippets.


Cameron Maske cameronmaske

View GitHub Profile
cameronmaske /
Last active Aug 10, 2018
How to use CircleCI's docker executor instead of machine for a Docker Compose project

Docker Compose workarounds with CircleCI's docker executor.

Here is an example configuration with the work arounds listed below.

If you need to build Docker images (which our project does) you have to tell Circle to set up a remote docker environment to execute any docker commands. This isn't necessarily complex to add your configuration, it's a simple one-line addition.

However, it is not possible to mount folders (i.e the volumes key in Docker Compose) for containers run by the remote docker instance.

This means you either to set up a separate docker-compose.yml, without volumes and in your Dockerfile, make sure to ADD any folders/code that you need available to run your tests.

cameronmaske / pre-commit
Created Apr 3, 2018
Yapf + Isort Git Hook Pre-commit Script
View pre-commit
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
View gist:c27c540d6753433f6a29cba561bdc6d6
### Keybase proof
I hereby claim:
* I am cameronmaske on github.
* I am cameronmaske ( on keybase.
* I have a public key whose fingerprint is E996 07E8 8E22 59A6 4844 71D8 5609 7552 9ACD 557B
To claim this, I am signing this object:
cameronmaske / DNS
Last active Jun 3, 2017
Setting up Docker DNS for local dev
View DNS

After setting up your docker machine, change the dns opts to look for a locally running DNS server...

docker-machine ssh
sudo vi /var/lib/boot2docker/profile
# Then add the following...
--label provider=virtualbox
--dns-search dev
cameronmaske /
Created May 15, 2016
Python vs Objective C
NSArray *shoeOrder = @[@"Charles Smith", @(9.5), @"loafer", @"brown"];
NSMutableDictionary *shoeOrderDict = [[NSMutableDictionary alloc] init];
[shoeOrderDict setObject:[shoeOrder objectAtIndex:0] forKey:@"customer"];
[shoeOrderDict setObject:[shoeOrder objectAtIndex:1] forKey:@"size"];
[shoeOrderDict setObject:[shoeOrder objectAtIndex:2] forKey:@"style"];
[shoeOrderDict setObject:[shoeOrder objectAtIndex:3] forKey:@"color"];

Contributing a new backend.

Contributing a new locking backend is greatly appreciated! Each new backend must implement the following methods...

class Backend(object):
    Each new backend must implement the following methods,
    - __init__
View fig.json
"files": {
"pythonpy/": 1,
"pythonpy/": 208,
"pythonpy/": 333,
"": 60,
"test/": 50
"id": "5ba6f1ea925ee4a7edd26236812fac2cd57864db",
import commands
import json
output_name = "commits-over-time"
data = []
past_changes = {}
commits = commands.getstatusoutput(
"git rev-list --all master")[1].split('\n')
View file-changes-over-time.bash
for commit in $(git rev-list --all master)
echo $commit
git checkout $commit > /dev/null 2>&1; find . -name '*.py' | xargs wc -l
git checkout master
cameronmaske /
Created Dec 27, 2014
A script to call out twisters moves written in Python! Only works on OSX.
from random import choice
from time import sleep
from subprocess import call
if __name__ == '__main__':
colors = ["green", "yellow", "blue", "red", "in the air", "other player's choice"]
parts = ["left hand", "right hand", "right foot", "left foot"]
while True:
part = choice(parts)
color = choice(colors)