Skip to content

Instantly share code, notes, and snippets.

View chartjes's full-sized avatar

Chris Hartjes chartjes

View GitHub Profile
So when our first cat Rusty died, I spent a lot of time trying to decide
if we should get another cat. After all, Pluto had spent a lot of time bullying
Rusty. Rusty was never quite the same -- anxious all the time and got chased
almost every single day by him.
But I liked having two cats around because that was the default in the household
since 2001. So after about 5 months I felt it was time to introduce another
cat into the household. I picked out a really sweet female Tortiseshell cat
and brought her home.
(venv) ~/mozilla-services/ailoads-syncto (master ✘)✹✭ ᐅ make setup_existing
/Users/chartjes/mozilla-services/ailoads-syncto/venv/bin/fxa-client --browserid --auth "ailoads-bitchin@mailinator.com" --account-server "https://api.accounts.firefox.com/v1" --env stage --out loadtest.env
Please enter a password for ailoads-bitchin@mailinator.com:
ERROR:fxa-client:Unknown account
make: *** [setup_existing] Error 1
<?php namespace OpenCFP\Provider;
use Silex\Application;
use Silex\ServiceProviderInterface;
class DatabaseServiceProvider implements ServiceProviderInterface
{
/**
* {@inheritdoc}
*/
import base64
import datetime
import re
import requests
import time
import unittest
class Kinto_Sync(unittest.TestCase):
"""
Tests that given two Kinto servers you can successfully sync data
Here is my scenario:
* using docker-compose to spin up 4 containers: master, read-only, db1, db2
* all four containers are succesfully spun up
* once all the containers are up and running, I need to run the same two commands on master and read-only, one after the other
I have no idea how I can automate this and I prefer to NOT have folks manually do 'docker run blah blah blah'
Here is my current Docker compose file
@chartjes
chartjes / gist:8202226
Created December 31, 2013 21:03
Example of writing a unit test that has two PDO db calls that need to return two different results
<?php
// Let's say we have two different result sets
$result_set = array();
$result_set[0] = array(
array(
'id' => 1,
'name' => 'Foo',
'type' => 'Bar',
'status' => 'valid'
@chartjes
chartjes / sample.py
Created December 30, 2015 15:45
There must be a more idiomatic way
for container in containers:
p1 = re.compile('.*?kinto_read-only_(\d)$')
p2 = re.compile('.*?kinto_master_(\d)$')
print container['Names']
if container['Names']:
for name in container['Names']:
if p1.match(name):
ports = container['Ports']
for port in ports:
self.read_only['ip'] = port['IP']
~/vm/webreg ᐅ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'wheezy64'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Fixed port collision for 22 => 2222. Now on port 2200.
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
return array(
array('foo', 'bar', 'baz'),
array('alpha', 'beta', 'gamma')
);
@chartjes
chartjes / gist:6666003
Created September 23, 2013 02:51
Vim setup
I use Pathogen and have the following bundles installed:
~/.vim/bundle ᐅ ls -l
total 0
drwxr-xr-x 5 chartjes staff 170 1 May 22:53 closetag.vim
drwxr-xr-x 8 chartjes staff 272 1 May 22:54 ctrlp.vim
drwxr-xr-x 8 chartjes staff 272 1 May 22:54 nerdcommenter
drwxr-xr-x 6 chartjes staff 204 1 May 22:51 pb.vim
drwxr-xr-x 18 chartjes staff 612 1 May 22:54 powerline
drwxr-xr-x 8 chartjes staff 272 1 May 22:54 supertab