This file contains hidden or 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/circus/arbiter.py b/circus/arbiter.py | |
| index 006fed3..303b1ab 100644 | |
| --- a/circus/arbiter.py | |
| +++ b/circus/arbiter.py | |
| @@ -146,8 +146,8 @@ class Arbiter(object): | |
| self.check_delay) | |
| @classmethod | |
| - def load_from_config(cls, config_file): | |
| - cfg = get_config(config_file) |
This file contains hidden or 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
| window.SVGMap = (function () { | |
| var SM = function (){ | |
| return SM.init.apply(SM, arguments); | |
| }, | |
| undefined, | |
| doc = document, | |
| win = window, | |
| svgns = 'http://www.w3.org/2000/svg'; | |
| // Partially borrowed from RaphaelJS lib by D. Baranosvkiy. |
This file contains hidden or 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
| def _transfer_foo(self, foo_id, new_parent_id): | |
| try: | |
| d = foobar.delete().where( | |
| foobar.c.foo_id == foo_id) | |
| self.session.execute(d) | |
| self._add_relationship(new_parent_id, foo_id) | |
| except: | |
| self.session.rollback() |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| from functools import partial | |
| from redis import Redis | |
| import settings | |
| redis_client = Redis(host=settings.REDIS_HOST, port=settings.REDIS_PORT, | |
| db=settings.REDIS_DB) | |
| class memoize(object): |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| from functools import wraps, partial | |
| class memoize(object): | |
| """cache the return value of a method | |
| This class is meant to be used as a decorator of methods. The return value | |
| from a given method invocation will be cached on the instance whose method | |
| was invoked. All arguments passed to a method decorated with memoize must | |
| be hashable. |
This file contains hidden or 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
| # -*- coding: utf-8 -*- | |
| from functools import wraps, partial | |
| from redis import Redis | |
| redis_client = Redis() | |
| class redis_memoize(object): | |
| """cache the return value of a method into redis |
This file contains hidden or 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 os | |
| import sys | |
| from redis import Redis | |
| import argparse | |
| import simplejson as json | |
| import settings | |
| redis_client = Redis(host=settings.REDIS_HOST, port=settings.REDIS_PORT, | |
| db=settings.REDIS_DB) |
This file contains hidden or 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 scrapy.spider import BaseSpider | |
| from scrapy.conf import settings | |
| from scrapy.http import Request | |
| from random import choice | |
| class DoubleIPSpider(BaseSpider): | |
| name = "double_ip_test" | |
| allowed_domains = ["httpbin.org"] |
This file contains hidden or 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
| if (!String.prototype.endsWith) { | |
| Object.defineProperty(String.prototype, 'endsWith', { | |
| enumerable: false, | |
| configurable: false, | |
| writable: false, | |
| value: function (searchString, position) { | |
| position = position || this.length; | |
| position = position - searchString.length; | |
| var lastIndex = this.lastIndexOf(searchString); | |
| return lastIndex !== -1 && lastIndex === position; |
This file contains hidden or 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
| /* | |
| * Not only does your robot come equipped with sensors and thrusters. It also | |
| * has a radar that can be used to determine distances. | |
| * | |
| * The radar has two methods: | |
| * | |
| * | |
| * - angle() - the current direction the radar is pointing (0-359) | |
| * - angle(number) - set the radar direction (0-359) | |
| * |