TODO: Write a project description
TODO: Describe the installation process
| #!/usr/bin/python | |
| # Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected]) | |
| # The author disclaims copyright to this source code. | |
| import sys | |
| import struct | |
| import socket | |
| import time | |
| import select |
| class Node: | |
| def __init__(self, label=None, data=None): | |
| self.label = label | |
| self.data = data | |
| self.children = dict() | |
| def addChild(self, key, data=None): | |
| if not isinstance(key, Node): | |
| self.children[key] = Node(key, data) | |
| else: |
| class SampleFilter(filters.FilterSet): | |
| start_date = django_filters.DateFilter(name="date", lookup_type='gte') | |
| end_date = django_filters.DateFilter(name="date", lookup_type='lte') | |
| # How to filter by a foreign key that uses slug as a lookup | |
| foo = django_filters.ModelMultipleChoiceFilter( | |
| queryset=MyModel.objects.all(), | |
| to_field_name='slug', | |
| conjoined=True, | |
| ) | |
| class Meta: |
| from django.db.models import Count, Max | |
| unique_fields = ['field_1', 'field_2'] | |
| duplicates = ( | |
| MyModel.objects.values(*unique_fields) | |
| .order_by() | |
| .annotate(max_id=Max('id'), count_id=Count('id')) | |
| .filter(count_id__gt=1) | |
| ) |
| #!/usr/bin/env python | |
| import sys | |
| import subprocess | |
| diff_requirements = 'git diff ORIG_HEAD HEAD --exit-code -- requirements.txt' | |
| exit_code = subprocess.call(diff_requirements.split()) | |
| if exit_code == 1: | |
| print 'The requirements file has changed! Remember to install new dependencies.' | |
| else: |
| Postgres Internals | |
| Djangocon US 2024 | |
| Elizabeth Christensen | |
| ## psql basics | |
| --whoami | |
| \conninfo | |
| --user list |