A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
<?php | |
namespace NoxLogic\DemoBundle\Form\Type; | |
use Doctrine\ORM\EntityManager; | |
use NoxLogic\DemoBundle\Entity\Province; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use Symfony\Component\Form\FormEvent; | |
use Symfony\Component\Form\FormEvents; |
// Theory | |
// http://htmlpurifier.org/live/smoketests/xssAttacks.php | |
// https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet | |
// A full collection of HTML5 related XSS attack vectors: | |
// https://github.com/cure53/H5SC https://raw.githubusercontent.com/cure53/H5SC/master/vectors.txt | |
// Short list | |
<script>alert("XSS: script tag")</script> | |
<script src="http://hackers-site.powertofly.com"></script> |
#!/usr/bin/env python | |
from suds.client import Client | |
import time | |
WSDL_URL = 'https://www.superfinanciera.gov.co/SuperfinancieraWebServiceTRM/TCRMServicesWebService/TCRMServicesWebService?WSDL' | |
date = time.strftime('%Y-%m-%d') | |
def trm(date): | |
try: | |
client = Client(WSDL_URL, location=WSDL_URL, faults=True) |
# Copyright (C) 2016 Martina Pugliese | |
from boto3 import resource | |
from boto3.dynamodb.conditions import Key | |
# The boto3 dynamoDB resource | |
dynamodb_resource = resource('dynamodb') | |
def get_table_metadata(table_name): |
""" | |
More details on the implementation and usage can be found at | |
https://www.pyscoop.com/django-jsonfield-attributes-in-admin-filter/ | |
""" | |
from django.contrib import admin | |
from django.core.exceptions import ImproperlyConfigured | |
class JSONFieldFilter(admin.SimpleListFilter): |
This guide assumes that your django application already running in the container.
You will have to make sure that django-extensions
and jupyter
packages are installed in the container's python virtual environment.
If you need to shell into the container as root
user to do this, you can do so from the host PC: