Skip to content

Instantly share code, notes, and snippets.

View myaser's full-sized avatar
🧠
What I cannot create, I do not understand

Mahmoud Yaser myaser

🧠
What I cannot create, I do not understand
  • Berlin, Germany
View GitHub Profile
{
"AWSTemplateFormatVersion": "2010-09-09",
"Conditions": {
"EFSEncrypted": {
"Fn::Equals": [
{
"Ref": "EncryptEFS"
},
"true"
]

AWS ECR proxy

an nginx image configured to act as a proxy for ECR repository The container will renew the aws token every 6 hours.

configueration

AWS credentials

set the environment variables:

AWS_KEY
AWS_SECRET
REGION
@myaser
myaser / models.py
Last active September 10, 2018 03:24
postgres partial index for django
class PartialIndex(Index):
def __init__(self, fields=[], name=None, condition=None, unique=False):
# TODO accept condition as dictionary and make sql escaping and quoting
self.condition = condition
self.unique = unique
super(PartialIndex, self).__init__(fields=fields, name=name)
def deconstruct(self):
path, args, kwargs = super(PartialIndex, self).deconstruct()
kwargs['unique'] = self.unique

django-test-abstract-models

a TestCase subclass to help you test your abstract django models

usage:

1- subclass your django abstract models