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 inspect | |
from functools import partial, update_wrapper | |
from spyne.decorator import rpc as original_rpc | |
from spyne.service import ServiceBase, ServiceBaseMeta | |
__all__ = ('rpc', 'DelegateBase', 'ExtensibleServiceBase') | |
class SpyneMethodWrapper(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
[uwsgi] | |
master = true | |
workers = 1 | |
reload-mercy = 30 | |
vacuum = 1 | |
socket = my.sock | |
auto-procname = true | |
enable-threads = true | |
lazy = 0 | |
plugin = python |
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
[uwsgi] | |
master = true | |
chmod-socket = 660 | |
workers = 1 | |
reload-mercy = 30 | |
vacuum = 1 | |
auto-procname = true | |
enable-threads = false | |
lazy = 0 | |
no-orphans = true |
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 contextlib | |
>>> from django.db import models | |
>>> | |
>>> class Sequence(models.Model): | |
... pass | |
>>> | |
>>> @contextlib.contextmanager | |
>>> def unique_threadsafe_id(): | |
... try: | |
... a, created = Sequence.objects.create() |
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 rest_framework import serializers | |
from rest_framework.utils.serializer_helpers import BindingDict | |
class PolymorphicModelSerializer(serializers.ModelSerializer): | |
""" | |
Serializer that serializes a polymorphic model | |
Since the whole point of polymorphism is to have models | |
with different properties in the same queryset, the ``fields`` meta | |
specification in rest_framework becomes rather useless. That is |
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
""" | |
Ensure that only 1 process can be running a managment command at the same | |
time, even across multiple application servers. | |
Uses a database lock on a table row, in a separate database connection. | |
""" | |
import logging | |
from django.conf import settings | |
from django.db import models |
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 AbstractClassWithoutFieldsNamed(cls, *excl): | |
""" | |
Removes unwanted fields from abstract base classes. | |
Usage:: | |
>>> from oscar.apps.address.abstract_models import AbstractBillingAddress | |
>>> from koe.meta import AbstractClassWithoutFieldsNamed as without | |
>>> class BillingAddress(without(AbstractBillingAddress, 'phone_number')): | |
... pass |
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 json | |
import logging | |
import traceback | |
from django.http import HttpResponseServerError | |
from oscarapi.middleware import IsApiRequest | |
logger = logging.getLogger(__name__) | |
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
Pod::Spec.new do |s| | |
s.name = 'GoogleTagManager' | |
s.version = '3.0b1' | |
s.summary = 'Google Tag Manager SDK.' | |
s.description = 'Google Tag Manager enables developers to change configuration values in their mobile applications using the Google Tag Manager interface without having to rebuild and resubmit application binaries to app marketplaces.' | |
s.homepage = 'http://developers.google.com/tag-manager/ios' | |
s.license = { | |
:type => 'Copyright', | |
:text => <<-LICENSE | |
Copyright 2013 Google, Inc. All rights reserved. |
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
apt-get install git | |
apt-get install debianize | |
git clone [email protected]:devopsconsulting/vdt.deploy.git | |
git clone [email protected]:devopsconsulting/vdt.deployplugin.cloudstack.git | |
git clone [email protected]:devopsconsulting/vdt.deployplugin.xen.git | |
git clone [email protected]:devopsconsulting/python-mutexlock.git | |
git clone [email protected]:devopsconsulting/python-cloudstack.git | |
apt-get install virtualenv pip | |
apt-get install python-virtualenv python-pip | |
pip install virtualenvwrapper |