This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'set' | |
require 'thread' | |
module Prod | |
# A simple thread pool for running N parallel jobs. | |
# | |
# pool = ThreadPool.new(5) | |
# 20.times do | |
# pool.next_thread{ sleep 2 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int WIDTH = 800; | |
int HEIGHT = 400; | |
int ROWS = 10; | |
int ROW_HEIGHT = 40; | |
int STROKE_WIDTH = 10; | |
void setup() { | |
// This code happens once, right when our sketch is launched | |
size(WIDTH, HEIGHT); | |
background(255); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime, timedelta | |
from twisted.internet.defer import inlineCallbacks, returnValue | |
from zope.interface import implements | |
from vumi.tests.helpers import IHelper | |
from vumi.message import format_vumi_date | |
class MessageSequenceHelper(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import timedelta | |
from twisted.internet.defer import inlineCallbacks | |
from vumi.message import parse_vumi_date | |
from vumi.tests.helpers import VumiTestCase, MessageHelper | |
from vumi_message_store.tests.helpers import MessageSequenceHelper | |
class FakeBackend(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ ERROR at teardown of TestMessageExportResource.test_disconnect_kills_server __ | |
Traceback (most recent call last): | |
File "/home/vagrant/Envs/vumi-msg-store-pypy/site-packages/twisted/trial/_asynctest.py", line 209, in _cleanUp | |
clean = util._Janitor(self, result).postCaseCleanup() | |
File "/home/vagrant/Envs/vumi-msg-store-pypy/site-packages/twisted/trial/util.py", line 98, in postCaseCleanup | |
calls = self._cleanPending() | |
File "/home/vagrant/Envs/vumi-msg-store-pypy/site-packages/twisted/internet/utils.py", line 218, in warningSuppressingWrapper | |
return runWithWarningsSuppressed(suppressedWarnings, f, *a, **kw) | |
File "/home/vagrant/Envs/vumi-msg-store-pypy/site-packages/twisted/internet/utils.py", line 201, in runWithWarningsSuppressed | |
reraise(exc_info[1], exc_info[2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Manager.calls_manager | |
def test_index_keys_page_length(self): | |
indexed_model = self.manager.proxy(IndexedModel) | |
yield indexed_model("foo1", a=1, b=u"one").save() | |
yield indexed_model("foo2", a=1, b=u"one").save() | |
yield indexed_model("foo3", a=1, b=None).save() | |
keys1 = yield indexed_model.index_keys_page('a', 1, max_results=2) | |
self.assertEqual(len(keys1), 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# Check that all the apps in Marathon are stored as services in Consul. | |
import requests | |
HOST = '10.1.1.13' | |
CONSUL_PORT = 8500 | |
MARATHON_PORT = 8080 | |
def get_marathon_app_ids(host, port): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
# Sanity check that consul-template is writing the services in Consul to the | |
# nginx config file. | |
import requests | |
HOST = '10.1.1.13' | |
CONSUL_PORT = 8500 | |
NGINX_CONFIG_PATH = '/etc/nginx/sites-enabled/consul_template.conf' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/manifests/config.pp b/manifests/config.pp | |
index 7fbe41a..a7dc508 100644 | |
--- a/manifests/config.pp | |
+++ b/manifests/config.pp | |
@@ -29,21 +29,23 @@ class marathon::config( | |
} | |
if ($mesos_auth_principal != undef and $mesos_auth_secret != undef) { | |
- $secret_options = { | |
- 'mesos_authentication_principal' => $mesos_auth_principal, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import treq | |
from twisted.internet.defer import inlineCallbacks | |
from twisted.trial.unittest import TestCase | |
from twisted.web.client import ProxyAgent | |
from twisted.web.server import Site | |
from txfake import FakeServer |
OlderNewer