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
| apiVersion: networking.istio.io/v1alpha3 | |
| kind: EnvoyFilter | |
| metadata: | |
| name: add-x-workload-header | |
| namespace: istio-system | |
| annotations: | |
| name: Add Workload Header | |
| description: Adds an x-workload-header | |
| spec: | |
| configPatches: |
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
| groups: | |
| # These sum(irate()) functions are in separate groups, so they run in parallel | |
| - name: istio.workload.istio_request_duration_milliseconds_bucket | |
| interval: 10s | |
| rules: | |
| - record: workload:istio_request_duration_milliseconds_bucket:rate1m | |
| expr: | | |
| sum(irate(istio_request_duration_milliseconds_bucket{reporter="source", source_workload!=""}[1m])) | |
| by ( |
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
| from django import forms | |
| from django.forms.fields import MultiValueField | |
| import pytz | |
| # provided by django-timezone-field==0.4 | |
| from timezone_field import TimeZoneFormField | |
| class DatetimeTZWidget(forms.MultiWidget): |
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 django.core.files.storage import FileSystemStorage | |
| from slimit import minify | |
| class StaticFileStorageAndJSMinifier(FileSystemStorage): | |
| """ | |
| A storage backend to be used by the staticfiles app -- STATICFILES_STORAGE | |
| setting. This backend operates just as a normal filesystem storage backend | |
| except when it detects a javascript file. | |
| After a javascript file is saved, we reopen the file, minify the contents |